The following deprecated or undocumented methods will be removed. Their replacements are listed here:
|0.8.x method||0.9 replacement|
(*) Use of
thisp is discouraged. For calling methods, use
- Treat foreign promises as unresolved in
Q.isFulfilled; this lets
Q.allwork on arrays containing foreign promises. #154
- Fix minor incompliances with the Promises/A+ spec and test suite. #157 #158
thisp-less versions of
nbind. The latter are now deprecated. #142
- Long stack traces no longer cause linearly-growing memory usage when chaining promises together. #111
error.stackin a rejection handler will now give a long stack trace. #103
Q.timeoutto clear its timeout handle when the promise is rejected; previously, it kept the event loop alive until the timeout period expired. #145 @dfilatov
q/queuemodule, which exports an infinite promise queue constructor.
doneas a replacement for
end, taking the usual fulfillment, rejection, and progress handlers. It's essentially equivalent to
then(f, r, p).end().
Q.onerror, a settable error trap that you can use to get full stack traces for uncaught errors. #94
thenResolveas a shortcut for returning a constant value once a promise is fulfilled. #108 @ForbesLindesay
- Various tweaks to progress notification, including propagation and transformation of progress values and only forwarding a single progress object.
nodeify. It no longer returns an always-fulfilled promise when a Node callback is passed.
deferred.rejectno longer (sometimes) return
- Fixed stack traces getting mangled if they hit
endtwice. #116 #121 @ef4
npostto work on promises for objects with Node methods. #134
- Fixed accidental coercion of objects with nontrivial
Dates, by the promise's
spreadnot calling the passed rejection handler if given a rejected promise.
- Added preliminary progress notification support, via
promise.then(onFulfilled, onRejected, onProgress),
delreturn the object acted upon for easier chaining. #84
- Fixed coercion cycles with cooperating promises. #106
- Support Montage Require
ninvoketo pass the correct
- Fixed various cases involving unorthodox rejection reasons. #73 #90 @ef4
- Fixed double-resolving of misbehaved custom promises. #75
- Sped up
Q.allfor arrays contain already-resolved promises or scalar values. @ForbesLindesay
- Made stack trace filtering work when concatenating assets. #93 @ef4
- Added warnings for deprecated methods. @ForbesLindesay
.npmignorefile so that dependent packages get a slimmer
- Added preliminary support for long traces (@domenic)
fbindfor non-thisp promised function calls.
returnfor async generators, where generators are implemented.
- Rejected promises now have an "exception" property. If an object isRejected(object), then object.valueOf().exception will be the wrapped error.
- Added Jasmine specifications
- Support Internet Explorers 7–9 (with multiple bug fixes @domenic)
- Support Firefox 12
- Support Safari 5.1.5
- Support Chrome 18
promise.timeoutis now rejected with an
Errorobject and the message now includes the duration of the timeout in miliseconds. This doesn't constitute (in my opinion) a backward-incompatibility since it is a change of an undocumented and unspecified public behavior, but if you happened to depend on the exception being a string, you will need to revise your code.
deferred.makeNodeResolver()to replace the more cryptic
- Added experimental
Q.promise(maker(resolve, reject))to make a promise inside a callback, such that thrown exceptions in the callback are converted and the resolver and rejecter are arguments. This is a shorthand for making a deferred directly and inspired by @gozala’s stream constructor pattern and the Microsoft Windows Metro Promise constructor interface.
- Added experimental
Q.begin()that is intended to kick off chains of
.thenso that each of these can be reordered without having to edit the new and former first step.
isResolvedto the promise prototype.
allResolvedfor waiting for every promise to either be fulfilled or rejected, without propagating an error. @utvara #53
Q.bindas a method to transform functions that return and throw into promise-returning functions. See an example. @domenic
nbind, and added
napplyto complete the set.
noderemains as deprecated. @domenic #58
Methodremains as deprecated and will be removed in the next major version since I expect it has very little usage.
- Added browser console message indicating a live list of unhandled errors.
- Added support for
setImmediate(available via polyfill) as a browser-side
nextTickimplementation. #44 #50 #59
- Stopped using the event-queue dependency, which was in place for
Narwhal support: now directly using
- WARNING: EXPERIMENTAL: added
del. These properties are enquoted in the library for cross-browser compatibility, but may be used as property names in modern engines.
refin favor of
resolveas recommended by @domenic.
- Update event-queue dependency.
- Fixed Opera bug. #35 @cadorn
nextTickinstead. This is more consistent with NodeJS and (subjectively) more explicit and intuitive.
masterinstead. The term
defwas too confusing to new users.
spyremoved in favor of
- WARNING: Removed the
Qfunction module.exports alias for
Q.ref. It conflicts with
Q.applyin weird ways, making it uncallable.
delayso that it accepts both
(timeout)variations based on arguments length.
ref().spread(cb(...args)), a variant of
thenthat spreads an array across multiple arguments. Useful with
defer().node()Node callback generator. The callback accepts
(error, ...values). For multiple value arguments, the fulfillment value is an array, useful in conjunction with
ncall, both with the signature
(fun, thisp_opt, ...args). The former is a decorator and the latter calls immediately.
nodeoptional binds and partially applies.
ncallcan bind and pass arguments.
- Fixed thenable promise assimilation.
- Stopped shimming
Array.prototype.reduce. The enumerable property has bad side-effects. Libraries that depend on this (for example, QQ) will need to be revised.
0.7.0 - BACKWARD INCOMPATIBILITY
- WARNING: Removed
- WARNING: The
callbackargument of the
finfunction no longer receives any arguments. Thus, it can be used to call functions that should not receive arguments on resolution. Use
failif you need a value.
- IMPORTANT: Fixed a bug in the use of
- Added experimental
viewInfofor creating views of promises either when or before they're fulfilled.
- Shims are now externally applied so subsequent scripts or dependees can use them.
- Improved minification results.
- Improved readability.
0.6.0 - BACKWARD INCOMPATIBILITY
- WARNING: In practice, the implementation of
spyand the name
finwere useful. I've removed the old
finimplementation and renamed/aliased
- The "q" module now exports its
reffunction as a "Q" constructor, with module systems that support exports assignment including NodeJS, RequireJS, and when used as a
<script>tag. Notably, strictly compliant CommonJS does not support this, but UncommonJS does.
asyncdecorator for generators that use yield to "trampoline" promises. In engines that support generators (SpiderMonkey), this will greatly reduce the need for nested callbacks.
waitto use it. All of these will now reject at the earliest rejection.
- Minor improvement to
spy; now waits for resolution of callback promise.
- Made most Q API methods chainable on promise objects, and
turned the previous promise-methods of
reportinto Q API methods.
callto the Q API, and
applyas a promise handler.
spyto Q and the promise prototype for convenience when observing rejection, fulfillment and rejection, or just observing without affecting the resolution.
defremains shimmed until the next major release) to
- Switched to using
MessageChannelfor next tick task enqueue in browsers that support it.
0.5.0 - MINOR BACKWARD INCOMPATIBILITY
- Exceptions are no longer reported when consumed.
errorfrom the API. Since exceptions are getting consumed, throwing them in an errback causes the exception to silently disappear. Use
endas both an API method and a promise-chain ending method. It causes propagated rejections to be thrown, which allows Node to write stack traces and emit
uncaughtExceptionevents, and browsers to likewise emit
onerrorand log to the console.
waitas promise chain functions, so you can wait for variadic promises, returning your own promise back, or join variadic promises, resolving with a callback that receives variadic fulfillment values.
endno longer returns a promise. It is the end of the promise chain.
- Stopped reporting thrown exceptions in
whencallbacks and errbacks. These must be explicitly reported through
.then(null, Q.error), or some other mechanism.
reportas an API method, which can be used as an errback to report and propagate an error.
reportas a promise-chain method, so an error can be reported if it passes such a gate.
<script>support that regressed with 0.4.2 because of "use strict" in the module system multi-plexer.
- Added support for RequireJS (jburke)
- Added an "end" method to the promise prototype, as a shorthand for waiting for the promise to be resolved gracefully, and failing to do so, to dump an error message.
0.4.0 - BACKWARD INCOMPATIBLE*
- *Removed the utility modules. NPM and Node no longer expose any module except the main module. These have been moved and merged into the "qq" package.
- *In a non-CommonJS browser, q.js can be used as a script. It now creates a Q global variable.
- Fixed thenable assimilation.
- Fixed some issues with asap, when it resolves to undefined, or throws an exception.
0.3.0 - BACKWARD-INCOMPATIBLE
postmethod has been reverted to its original signature, as provided in Tyler Close's
ref_sendAPI. That is,
postaccepts two arguments, the second of which is an arbitrary object, but usually invocation arguments as an
Array. To provide variadic arguments to
post, there is a new
invokefunction that posts the variadic arguments to the value given in the first argument.
definedmethod has been moved from
q/utilsince it gets no use in practice but is still theoretically useful.
Promiseconstructor has been renamed to
makePromiseto be consistent with the convention that functions that do not require the
newkeyword to be used as constructors have camelCase names.
isResolvedfunction has been renamed to
isFulfilled. There is a new
isResolvedfunction that indicates whether a value is not a promise or, if it is a promise, whether it has been either fulfilled or rejected. The code has been revised to reflect this nuance in terminology.
"q/util"for variadically joining multiple promises.
- The future-compatible
invokemethod has been added, to replace
postwill become backward- incompatible in the next major release.
- Exceptions thrown in the callbacks of a
whencall are now emitted to Node's
processevent in addition to being returned as a rejection reason.
- Exceptions thrown in the callbacks of a
whencall are now consumed, warned, and transformed into rejections of the promise returned by
- Fixed a minor bug in thenable assimilation, regressed because of the change in the forwarding protocol.
- Fixed behavior of "q/util"
deepmethod on dates and other primitives. Github issue #11.
- Thenables (objects with a "then" method) are accepted and provided, bringing this implementation of Q into conformance with Promises/A, B, and D.
makePromise, to replace the
- Rejections are now also duck-typed. A rejection is a promise with a valueOf method that returns a rejection descriptor. A rejection descriptor has a "promiseRejected" property equal to "true" and a "reason" property corresponding to the rejection reason.
- Altered the
makePromiseAPI such that the
fallbackmethod no longer receives a superfluous
resolvedmethod after the
operator. The fallback method is responsible only for returning a resolution. This breaks an undocumented API, so third-party API's depending on the previous undocumented behavior may break.
- Changed promises into a duck-type such that multiple
instances of the Q module can exchange promise objects.
A promise is now defined as "an object that implements the
promiseSend(op, resolved, ...)method and
- Exceptions in promises are now captured and returned as rejections.
- Fixed bug in
delmessages from being received (gozala)
- Fixed a conflict with FireFox 4; constructor property is now read-only.
keysmessage to promises and to the promise API.
- Added boilerplate to
- Fixed missing dependency to
deferobjects now return the resolution promise for convenience.
q/util, which provides
deep, and three reduction orders.
q/queuemodule for a promise
q-commto the list of compatible libraries.
q, with intent to move it to
0.2.0 - BACKWARD INCOMPATIBLE
- Changed post(ref, name, args) to variadic post(ref, name, ...args). BACKWARD INCOMPATIBLE
- Added a def(value) method to annotate an object as being necessarily a local value that cannot be serialized, such that inter-process/worker/vat promise communication libraries will send messages to it, but never send it back.
- Added a send(value, op, ...args) method to the public API, for forwarding messages to a value or promise in a future turn.
- Added isRejected() for testing whether a value is a rejected promise. isResolved() retains the behavior of stating that rejected promises are not resolved.
- Fixed isResolved(null) and isResolved(undefined) [issue #9]
- Fixed a problem with the Object.create shim
- shimmed ES5 Object.create in addition to Object.freeze for compatibility on non-ES5 engines (gozala)
- Q.isResolved added
- promise.valueOf() now returns the value of resolved and near values
- asap retried
- promises are frozen when possible
- fixed dependency list for Teleport (gozala)
- all unit tests now pass (gozala)
- added support for Teleport as an engine (gozala)
- simplified and updated methods for getting internal print and enqueue functions universally (gozala)
- fixed erroneous link to the q module in package.json
- restructured for overlay style package compatibility
- removed asap because it was broken, probably down to the philosophy.
- removed q-util
- fixed asap so it returns a value if completed
- added q-util
- initial version