26 KiB
26 KiB
3.7.7
- Fix browserify
3.7.6
- Add browser dist version to npm package
3.7.5
- Improve unhandled rejection formatting in ie8
3.7.4
- Add
when/keys settle, for settling a hash of promises. - Use
polyfrom npm instead of a git link in package.json. No need for git to be available to npm install when. - Various community-contributed documentation updates. Thanks!
3.7.3
- Fix console.log check when using
monitor/consolein IE8. - Fix issues with webpack environment and fake timers.
- Several community-contributed doc fixes. Thanks!
3.7.2
- Republish 3.7.1 npm package: for some reason,
npm publishdid not include the filepoll.jswhen publishing 3.7.1 - No functional changes
3.7.1
- Fix
when.settleunhandled rejection reporting case.
3.7.0
- Add
processandwindowunhandled rejection events for cross-library debugging tools. - Improve internal task queueing performance and memory usage.
- Stabilize handler ordering in the face of multiple promise implementations.
3.6.4
- Fix handling of
nullerrors in unhandled rejection reporting - Add examples of supporting both promise and node style callbacks in the same API
3.6.3
- Fix regression in
when/callbacksintroduced in 3.6.1
3.6.2
- Work around v8 optimizing compiler bug with some truly amazing help from community members. Thank you @anodynos, @jefflage, @pbarnes, @spion, @tsouza.
- Fix regressions in
when.filterandwhen.reduce(which also affectedwhen/sequence).
3.6.1
- Significant improvements to
when.try, andwhen.lift. - Additional improvements to array functions:
when.reduce,when.any, andwhen.some. - Improved handling of early bail-out cases in
when.all,when.map, andwhen.any.
3.6.0
- Significant performance improvements:
- 10x or more for
when.map, especially for large arrays - ~2x for
when.reduceandpromise.fold - ~1.5-2x for generators using
when/generatorlift,call, and/orapply.
- 10x or more for
- Memory use reductions for
when.reduceandpromise.fold.
3.5.2
- Prevent minifiers from clobbering unhandled rejection reporting if they remove
console.*calls. Unhandled rejections will be reported even when using Uglifydrop_console. when/function.applynow handles passing an Arguments object directly, e.g.fn.apply(f, arguments);. Use with care: v8 will deoptimize any function where you passargumentsto another function.
3.5.1
when.race&Promise.racenow reject with aTypeErrorif you pass something that is not iterable.- Improve scheduler compatibility with MutationObserver shims
- Simplify checks for vert.x environment
3.5.0
- Improve
when.race&Promise.raceperformance. - Internal changes to start paving the way toward 4.0.0.
- Deprecate
when.iterateandwhen.unfold. Use cujoJS/most for streaming asynchronous values. - Deprecate progress events. See the docs for more information and tips on refactoring code that uses promise progress.
3.4.6
- Fix webpack compatibility by excluding
vertxfrom browser bundles
3.4.5
- Fixes for edge cases for unhandled rejection reporting
3.4.4
- Workaround for node 0.10.30 setTimeout bug. See this issue
3.4.3
- Improve error handling for predicate catch
- Simplify internals and reduce code size
3.4.2
- Fix for rare false negative in unhandled rejection reporting.
3.4.1
- Fix for
promise.finallynot waiting on returned promises.
3.4.0
- New
when.filterfor filtering arrays of promises. when.mapandwhen.filternow provide the array index as the second param to their mapping and filtering functions.when/keys.mapnow provides the associated key to its mapping function.- Smaller ES6 shim.
3.3.1
- Fix argument ordering bug in
when/nodeintroduced in 3.3.0.
3.3.0
- Promote
when.raceto public API. when.anyandwhen.somenow reject with aRangeErrorif the race is obviously unwinnable, for example:when.some([1,2,3], 4). See thewhen.anyandwhen.somedocs for more info.
3.2.3
- Updated debugging docs
- Report when previously unhandled rejections become handled, with an ID to correlate the two messages.
- Improve unhandled rejection reporting for cases where multiple different promise implementations interleave.
3.2.2
- More mem and perf improvements
- Improvements to unhandled rejection reporting
3.2.1
- Minor mem and perf tweaks for
when.all - Defend against
JSON.stringifyexceptions when formatting unhandled rejection output.
3.2.0
- Potentially unhandled rejections are now logged to
console.errorby default, even without usingdoneorwhen/monitor/console. As before, enablingwhen/monitor/consolestill adds long async stack traces, and usingdonestill makes errors fatal. See Debugging Promises for more info. promise.timeoutnow rejects with aTimeoutErrorby default (unless you specify a custom reason) for better pattern matching withpromise.catch.- Performance improvements across the board, especially to
when.all(andPromise.allin the ES6-shim) andnode.lift: lifted functions and lifting are faster now. - New
promise.foldfor combining two promises to generate a new promise. - Deprecated:
- Using
when/node.lift,when/function.lift, andwhen/callbacks.liftto provide partial arguments promise.then's 3rd argument, andwhen()'s 4th argument. Use the dedicatedpromise.progressAPI to listen to promise progress events.when.some. See https://github.com/cujojs/when/issues/288when/callbacks.promisifySee https://github.com/cujojs/when/issues/318
- Using
3.1.0
- Added optional
reasonparam topromise.timeoutto specify your own timeout value. - Another significant speed bump for
when.all(and es6-shimPromise.all) - More
when/monitor/consolelong stack trace improvements. Traces can track nested async functions even if you forget to return a promise. - Clean up bower and npm installs by ignoring more markdown files
3.0.1
- API doc updates and fixes
- Improvements to unhandled rejection long stack trace filtering
- Internal performance improvements
3.0.0
- New internal architecture with significant performance improvements and memory efficiency
- New APIs
- New liftAll variants for lifting all of an object's functions in one shot, eg.
var promisedFs = node.liftAll(require('fs')) when.Promisepublic, inheritance-friendly, Promise constructor- New ES6 Promise shim
- Check out the tips for upgrading to 3.0 from 2.x
2.8.0
- Experimental ES6 generator support via new
when/generatormodule, withlift,call,apply.
2.7.1
- Internal changes to reduce overall memory usage, along with minor performance improvements.
2.7.0
- Added
promise.catchandpromise.finallyas synonyms forpromise.otherwiseandpromise.ensure. (#212) - New browserify build for those using globals. (#209)
- Added ender support to
package.json. (#223) - Fix compatibility with PhantomJS's CommonJS module support. (#226)
- Fix Sauce Labs tests for pull requests. (#216)
- Added
bower.jsonignoreto trim files installed via bower. (#193)
2.6.0
- New
promise.doneallows consuming the ultimate value at the end of a promise chain while ensuring that any errors are thrown to the host environment so you get loud stack traces. when/node/functionbindCallbackandliftCallbacknow behave more like standard node-style APIs in that they allow exceptions to propagate to the host environment for loud stack traces.
2.5.1
ensurenow ignores non-functions, likethendoes, for consistency. (#207)
2.5.0
- Promises/A+ 1.1 compliant. Passes version 2.0.0 of the Promises/A+ test suite.
2.4.1
- New
MutationObserverscheduler further reduces "time-to-first-handler" in modern browsers. (#198)- Also, this works around a horrible IE10 bug (desktop and mobile) that renders
setImmediate,MessageChannel, andpostMessageunusable as fast task schedulers. Many thanks to @plaa and @calvinmetcalf for their help in discovering the problem and working out a solution. (#197)
- Also, this works around a horrible IE10 bug (desktop and mobile) that renders
2.4.0
- Experimental support for vert.x 2.x. Should now run in vert.x >= 1.1.0.
- New
when.isPromiseLikeas the more accurately-named synonym forwhen.isPromise. - DEPRECATED:
when.isPromise. It can only tell you that something is "promise-like" (aka "thenable") anyway. Use the new, more accurately-namedwhen.isPromiseLikeinstead. - Fix for promise monitor reporting extra unhandled rejections for
when.allandwhen.map.
2.3.0
- New
promise.tapfor adding side effects to a promise chain. - New
MessageChannelscheduler reduces "time-to-first" handler, in environments that support it. - Performance optimizations for promise resolution.
- Internal architecture improvements to pave the way for when.js 3.0.0.
2.2.1
- Fix for
when.defer().reject()bypassing the unhandled rejection monitor. (#166) - Fix for
when/function,when/callbacks, andwhen/node/functionnot preservingthisArg. (#162) - Doc clarifications for
promise.yield. (#164)
2.2.0
- New experimental promise monitoring and debugging via
when/monitor/console. - New
when.promise(resolver)promise creation API. A lighter alternative to the heavierwhen.defer() - New
bindCallbackandliftCallbackinwhen/node/functionfor more integration options with node-style callbacks.
2.1.1
- Quote internal usages of
promise.yieldto workaround .NET minifier tools that don't yet understand ES5 identifier-as-property rules. See #157
2.1.0
- New
when.settlethat settles an array of promises, regardless of whether the fulfill or reject. - New
when/guardgeneralized concurrency guarding and limiting - New
promise.inspectfor synchronously getting a snapshot of a promise's state at a particular instant. - Significant performance improvements when resolving promises with non-primitives (Arrays, Objects, etc.)
- Experimental vert.x support
- DEPRECATED:
onFulfilled,onRejected,onProgresshandler arguments towhen.all,when.any,when.some. Use the returned promise'sthen()(orotherwise(),ensure(), etc) to register handlers instead.- For example, do this:
when.all(array).then(onFulfilled, onRejected)instead of this:when.all(array, onFulfilled, onRejected). The functionality is equivalent.
- For example, do this:
2.0.1
- Account for the fact that Mocha creates a global named
process. Thanks Narsul
2.0.0
- Fully asynchronous resolutions.
- Promises/A+ compliance.
- New
when/keysmodule withall()andmap()for object keys/values. - New
promise.ensureas a better, and safer, replacement forpromise.always. See discussion as to whypromise.alwaysis mistake-prone.- DEPRECATED:
promise.always
- DEPRECATED:
lift()is now the preferred name for what wasbind()in when/function, when/node/function, and when/callbacks.- DEPRECATED:
bind()inwhen/function,when/node/function, andwhen/callbacks. Uselift()instead.
- DEPRECATED:
1.8.1
- Last 1.x.x release before 2.0.0 barring critical fixes.
- To prepare for 2.0.0, test your code against the dev-200 branch. It is fully API compatible, but has fully asynchronous resolutions.
- Performance improvements for when/function.
- Documentation updates and fixes. Thanks, @unscriptable!
- DEPRECATED:
deferred.progressanddeferred.resolver.progress. Usedeferred.notifyanddeferred.resolver.notifyinstead. - DEPRECATED:
when.chain. Useresolver.resolve(promise)orresolver.resolve(promise.yield)(seepromise.yield) instead. - DEPRECATED:
when/timedmodule. Usewhen/delayandwhen/timeoutmodules instead.
1.8.0
- New when/function, when/node/function, and when/callbacks with functional programming goodness, and adapters for turning callback-based APIs into promise-based APIs. Kudos @riccieri!
- New when/unfold, and when/unfold/list promise-aware anamorphic unfolds that can be used to generate and/or process unbounded lists.
- New when/poll promise-based periodic polling and task execution. Kudos @scothis!
1.7.1
- Removed leftover internal usages of
deferred.then. - when/debug allows configuring the set of "fatal" error types that will be rethrown to the host env.
1.7.0
- DEPRECATED:
deferred.thenis deprecated and will be removed in an upcoming release. Usedeferred.promise.theninstead. - promise.yield(promiseOrValue) convenience API for substituting a new value into a promise chain.
- promise.spread(variadicFunction) convenience API for spreading an array onto a fulfill handler that accepts variadic arguments. Mmmm, buttery
- Doc improvements:
- when() and promise.then() have more info about callbacks and chaining behavior.
- More info and clarifications about the roles of Deferred and Resolver
- Several minor clarifications for various APIs
- Internal improvements to assimilation and interoperability with other promise implementations.
1.6.1
- Fix for accidental coercion of non-promises. See #62.
1.6.0
- New when.join - Joins 2 or more promises together into a single promise.
- when.some and when.any now act like competitive races, and have generally more useful behavior. Read the discussion in #60.
- Experimental progress event propagation. Progress events will propagate through promise chains. Read the details here.
- Temporarily removed calls to
Object.freeze. Promises are no longer frozen due to a horrendous v8 performance penalty. Read discussion here.- IMPORTANT: Continue to treat promises as if they are frozen, since
freeze()will be reintroduced once v8 performance improves.
- IMPORTANT: Continue to treat promises as if they are frozen, since
- when/debug now allows setting global a debugging callback for rejected promises.
1.5.2
- Integrate @domenic's Promises/A Test Suite. Runs via
npm test. - No functional change
1.5.1
- Performance optimization for when.defer, up to 1.5x in some cases.
- when/debug can now log exceptions and rejections in deeper promise chains, in some cases, even when the promises involved aren't when.js promises.
1.5.0
- New task execution and concurrency management: when/sequence, when/pipeline, and when/parallel.
- Performance optimizations for when.all and when.map, up to 2x in some cases.
- Options for disabling paranoid mode that provides a significant performance gain in v8 (e.g. Node and Chrome). See this v8 performance problem with Object.freeze for more info.
- Important:
deferredanddeferred.resolverno longer throw when resolved/rejected multiple times. They will return silently as if the they had succeeded. This prevents parties to whom only theresolverhas been given from usingtry/catchto determine the state of the associated promise.- For debugging, you can use the when/debug module, which will still throw when a deferred is resolved/rejected multiple times.
1.4.4
- Change UMD boilerplate to check for
exportsto avoid a problem with QUnit. See #54 for more info.
1.4.3
- Fix for infinite promise coercion between when.js and Q (See #50). Thanks @kriskowal and @domenic
1.4.2
- Fix for IE8 infinite recursion (See #49)
1.4.1
- Code and unit test cleanup and streamlining--no functional changes.
1.4.0
- Create a resolved promise:
when.resolve(value)creates a resolved promise forvalue. See API docs. - Resolve/reject return something useful:
deferred.resolveanddeferred.rejectnow return a promise for the fulfilled or rejected value. - Resolve a deferred with another promise:
deferred.resolve(promise)- whenpromiseresolves or rejects, so willdeferred.
1.3.0
- Fixed a deviation from the Promises/A spec where returning undefined from a callback or errback would cause the previous value to be forwarded. See #31
- This could be a breaking change if you depended on this behavior. If you encounter problems, the solution is to ensure that your promise callbacks (registered either with
when()or.then()) return what you intend, keeping in mind that not returning something is equivalent to returningundefined.
- This could be a breaking change if you depended on this behavior. If you encounter problems, the solution is to ensure that your promise callbacks (registered either with
- This change also restores compatibility with the promises returned by
jQuery.get(), which seem to reject with themselves as the rejection value. See issue #41 for more information and discussion. Thanks to @KidkArolis for raising the issue.
1.2.0
promise.otherwise(errback)as a shortcut forpromise.then(null, errback). See discussion here and here. Thanks to @jonnyreeves for suggesting the name "otherwise".- when/debug now detects exceptions that typically represent coding errors, such as SyntaxError, ReferenceError, etc. and propagates them to the host environment. In other words, you'll get a very loud stack trace.
1.1.1
- Updated wiki map/reduce examples, and added simple promise forwarding example
- Fix for calling
when.any()without a callback (#33) - Fix version number in
when.jssource (#36)
1.1.0
when.all/any/some/map/reducecan all now accept a promise for an array in addition to an actual array as input. This allows composing functions to do interesting things likewhen.reduce(when.map(...))when.reject(promiseOrValue)that returns a new, rejected promise.promise.always(callback)as a shortcut forpromise.then(callback, callback)- Highly experimental when/debug module: a drop-in replacement for the main
whenmodule that enables debug logging for promises created or consumed by when.js
1.0.4
- Travis CI integration
- Fix for cancelable deferred not invoking progress callbacks. (#24 Thanks @scothis)
- The promise returned by
when.chainnow rejects when the input promise rejects.
1.0.3
- Fix for specific situation where
nullcould incorrectly be used as a promise resolution value (#23)
1.0.2
- Updated README for running unit tests in both Node and Browsers. See Running the Unit Tests below.
- Set package name to 'when' in package.json
1.0.1
- Fix for rejections propagating in some cases when they shouldn't have been (#19)
- Using buster.js for unit tests now.
1.0.0
- First official when.js release as a part of cujojs.
- Added when/cancelable decorator for creating cancelable deferreds
- Added when/delay and when/timeout helpers for creating delayed promises and promises that timeout and reject if not resolved first.
0.11.1
- Added when/apply helper module for using arguments-based and variadic callbacks with
when.all,when.some,when.map, or any promise that resolves to an array. (#14) .then(),when(), and all other methods that accept callback/errback/progress handlers will throw if you pass something that's not a function. (#15)
0.11.0
when.jsnow assimilates thenables that pass the Promises/A duck-type test, but which may not be fully Promises/A compliant, such as jQuery's Deferred and curl's global API (See the API at a glance section)when(), andwhen.all/some/any/map/reduce/chain()are all now guaranteed to return a fully Promises/A compliant promise, even when their input is not compliant.- Any non-compliant thenable returned by a callback or errback will also be assimilated to protect subsequent promises and callbacks in a promise chain, and preserve Promises/A forwarding guarantees.
0.10.4
- Important Fix for some AMD build/optimizer tools: Switching back to more verbose, builder-friendly boilerplate
- If you are using when.js 0.10.3 with the dojo or RequireJS build tools, you should update to v.10.4 as soon as possible.
0.10.3
Warning: This version will not work with most AMD build tools. You should update to 0.10.4 as soon as possible.
- Minor
package.jsonupdates - Slightly smaller module boilerplate
0.10.2
- Performance optimizations for
when.map()(thanks @smitranic), especially for large arrays where themapFuncis also async (i.e. returns a promise) when.all/some/any/map/reducehandle sparse arrays (thanks @rwaldrn)- Other minor performance optimizations
0.10.1
- Minor tweaks (thanks @johan)
- Add missing semis that WebStorm didn't catch
- Fix DOH submodule ref, and update README with info for running unit tests
0.10.0
when.mapandwhen.reduce- just like Array.map and Array.reduce, but they operate on promises and arrays of promises- Lots of internal size and performance optimizations
- Still only 1k!
0.9.4
- Important fix for break in promise chains