CHANGES.md 29.4 KB
Newer Older
K
Kris Kowal 已提交
1 2 3 4 5 6 7 8

## 1.5.1

 - Q.any now annotates its error message to clarify that Q.any was involved and
   includes only the last error emitted. (Ivan Etchart)
 - Avoid domain.dispose during tests in preparation for Node.js 9. (Anna
   Henningsen)

K
Kris Kowal 已提交
9 10
## 1.5.0

11
 - Q.any gives an error message from the last rejected promise
12
 - Throw if callback supplied to "finally" is invalid (@grahamrhay)
13 14
 - Long stack trace improvements, can now construct long stack traces
   across rethrows.
K
Kris Kowal 已提交
15

K
Kris Kowal 已提交
16 17 18 19 20 21 22
## 1.4.1

 - Address an issue that prevented Q from being used as a `<script>` for
   Firefox add-ons. Q can now be used in any environment that provides `window`
   or `self` globals, favoring `window` since add-ons have an an immutable
   `self` that is distinct from `window`.

K
Kris Kowal 已提交
23 24 25
## 1.4.0

 - Add `noConflict` support for use in `<script>` (@jahnjw).
K
Kris Kowal 已提交
26

K
Kris Kowal 已提交
27 28 29 30
## 1.3.0

 - Add tracking for unhandled and handled rejections in Node.js (@benjamingr).

K
Kris Kowal 已提交
31 32 33 34
## 1.2.1

 - Fix Node.js environment detection for modern Browserify (@kahnjw).

35 36
## 1.2.0

K
Kris Kowal 已提交
37
 - Added Q.any(promisesArray) method (@vergara).
38 39 40 41
   Returns a promise fulfilled with the value of the first resolved promise in
   promisesArray. If all promises in promisesArray are rejected, it returns
   a rejected promise.

K
Kris Kowal 已提交
42 43 44 45 46 47
## 1.1.2

 - Removed extraneous files from the npm package by using the "files"
   whitelist in package.json instead of the .npmignore blacklist.
   (@anton-rudeshko)

K
Kris Kowal 已提交
48 49 50 51 52 53
## 1.1.1

 - Fix a pair of regressions in bootstrapping, one which precluded
   WebWorker support, and another that precluded support in
   ``<script>`` usage outright. #607

K
Kris Kowal 已提交
54
## 1.1.0
55

56 57
 - Adds support for enabling long stack traces in node.js by setting
   environment variable `Q_DEBUG=1`.
K
Kris Kowal 已提交
58 59
 - Introduces the `tap` method to promises, which will see a value
   pass through without alteration.
60 61 62 63 64 65 66 67 68
 - Use instanceof to recognize own promise instances as opposed to
   thenables.
 - Construct timeout errors with `code === ETIMEDOUT` (Kornel Lesiński)
 - More descriminant CommonJS module environment detection.
 - Dropped continuous integration for Node.js 0.6 and 0.8 because of
   changes to npm that preclude the use of new `^` version predicate
   operator in any transitive dependency.
 - Users can now override `Q.nextTick`.

K
Kris Kowal 已提交
69 70 71 72 73 74 75 76 77 78 79 80 81
## 1.0.1

 - Adds support for `Q.Promise`, which implements common usage of the
   ES6 `Promise` constructor and its methods. `Promise` does not have
   a valid promise constructor and a proper implementation awaits
   version 2 of Q.
 - Removes the console stopgap for a promise inspector. This no longer
   works with any degree of reliability.
 - Fixes support for content security policies that forbid eval. Now
   using the `StopIteration` global to distinguish SpiderMonkey
   generators from ES6 generators, assuming that they will never
   coexist.

K
Kris Kowal 已提交
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96
## 1.0.0

:cake: This is all but a re-release of version 0.9, which has settled
into a gentle maintenance mode and rightly deserves an official 1.0.
An ambitious 2.0 release is already around the corner, but 0.9/1.0
have been distributed far and wide and demand long term support.

 - Q will now attempt to post a debug message in browsers regardless
   of whether window.Touch is defined. Chrome at least now has this
   property regardless of whether touch is supported by the underlying
   hardware.
 - Remove deprecation warning from `promise.valueOf`. The function is
   called by the browser in various ways so there is no way to
   distinguish usage that should be migrated from usage that cannot be
   altered.
K
kriskowal 已提交
97

K
Kris Kowal 已提交
98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113
## 0.9.7

 - :warning: `q.min.js` is no longer checked-in.  It is however still
   created by Grunt and NPM.
 - Fixes a bug that inhibited `Q.async` with implementations of the new
   ES6 generators.
 - Fixes a bug with `nextTick` affecting Safari 6.0.5 the first time a
   page loads when an `iframe` is involved.
 - Introduces `passByCopy`, `join`, and `race`.
 - Shows stack traces or error messages on the console, instead of
   `Error` objects.
 - Elimintates wrapper methods for improved performance.
 - `Q.all` now propagates progress notifications of the form you might
   expect of ES6 iterations, `{value, index}` where the `value` is the
   progress notification from the promise at `index`.

K
0.9.6  
Kris Kowal 已提交
114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129
## 0.9.6

 - Fixes a bug in recognizing the difference between compatible Q
   promises, and Q promises from before the implementation of "inspect".
   The latter are now coerced.
 - Fixes an infinite asynchronous coercion cycle introduced by former
   solution, in two independently sufficient ways.  1.) All promises
   returned by makePromise now implement "inspect", albeit a default
   that reports that the promise has an "unknown" state.  2.) The
   implementation of "then/when" is now in "then" instead of "when", so
   that the responsibility to "coerce" the given promise rests solely in
   the "when" method and the "then" method may assume that "this" is a
   promise of the right type.
 - Refactors `nextTick` to use an unrolled microtask within Q regardless
   of how new ticks a requested. #316 @rkatic

K
0.9.5  
Kris Kowal 已提交
130
## 0.9.5
K
Kris Kowal 已提交
131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148

 - Introduces `inspect` for getting the state of a promise as
   `{state: "fulfilled" | "rejected" | "pending", value | reason}`.
 - Introduces `allSettled` which produces an array of promises states
   for the input promises once they have all "settled".  This is in
   accordance with a discussion on Promises/A+ that "settled" refers to
   a promise that is "fulfilled" or "rejected".  "resolved" refers to a
   deferred promise that has been "resolved" to another promise,
   "sealing its fate" to the fate of the successor promise.
 - Long stack traces are now off by default.  Set `Q.longStackSupport`
   to true to enable long stack traces.
 - Long stack traces can now follow the entire asynchronous history of a
   promise, not just a single jump.
 - Introduces `spawn` for an immediately invoked asychronous generator.
   @jlongster
 - Support for *experimental* synonyms `mapply`, `mcall`, `nmapply`,
   `nmcall` for method invocation.

K
0.9.4  
Kris Kowal 已提交
149
## 0.9.4
150

151
 - `isPromise` and `isPromiseAlike` now always returns a boolean
L
lfac 已提交
152
   (even for falsy values). #284 @lfac-pt
153
 - Support for ES6 Generators in `async` #288 @andywingo
S
Schabse Laks 已提交
154
 - Clear duplicate promise rejections from dispatch methods #238 @SLaks
K
0.9.4  
Kris Kowal 已提交
155 156 157
 - Unhandled rejection API #296 @domenic
   `stopUnhandledRejectionTracking`, `getUnhandledReasons`,
   `resetUnhandledRejections`.
L
lfac 已提交
158

D
0.9.3  
Domenic Denicola 已提交
159 160 161 162 163 164 165 166 167 168 169 170 171
## 0.9.3

 - Add the ability to give `Q.timeout`'s errors a custom error message. #270
   @jgrenon
 - Fix Q's call-stack busting behavior in Node.js 0.10, by switching from
   `process.nextTick` to `setImmediate`. #254 #259
 - Fix Q's behavior when used with the Mocha test runner in the browser, since
   Mocha introduces a fake `process` global without a `nextTick` property. #267
 - Fix some, but not all, cases wherein Q would give false positives in its
   unhandled rejection detection (#252). A fix for other cases (#238) is
   hopefully coming soon.
 - Made `Q.promise` throw early if given a non-function.

D
0.9.2  
Domenic Denicola 已提交
172 173 174 175 176 177
## 0.9.2

 - Pass through progress notifications when using `timeout`. #229 @omares
 - Pass through progress notifications when using `delay`.
 - Fix `nbind` to actually bind the `thisArg`. #232 @davidpadbury

D
0.9.1  
Domenic Denicola 已提交
178 179 180 181 182 183 184
## 0.9.1

 - Made the AMD detection compatible with the RequireJS optimizer's `namespace`
   option. #225 @terinjokes
 - Fix side effects from `valueOf`, and thus from `isFulfilled`, `isRejected`,
   and `isPending`. #226 @benjamn

D
Domenic Denicola 已提交
185
## 0.9.0
K
Kris Kowal 已提交
186

D
Domenic Denicola 已提交
187 188 189 190
This release removes many layers of deprecated methods and brings Q closer to
alignment with Mark Miller’s TC39 [strawman][] for concurrency. At the same
time, it fixes many bugs and adds a few features around error handling. Finally,
it comes with an updated and comprehensive [API Reference][].
K
Kris Kowal 已提交
191 192

[strawman]: http://wiki.ecmascript.org/doku.php?id=strawman:concurrency
D
Domenic Denicola 已提交
193 194 195
[API Reference]: https://github.com/kriskowal/q/wiki/API-Reference

### API Cleanup
K
Kris Kowal 已提交
196 197 198

The following deprecated or undocumented methods have been removed.
Their replacements are listed here:
199 200 201 202 203 204 205 206 207

<table>
   <thead>
      <tr>
         <th>0.8.x method</th>
         <th>0.9 replacement</th>
      </tr>
   </thead>
   <tbody>
D
Domenic Denicola 已提交
208 209 210 211
      <tr>
         <td><code>Q.ref</code></td>
         <td><code>Q</code></td>
      </tr>
212 213
      <tr>
         <td><code>call</code>, <code>apply</code>, <code>bind</code> (*)</td>
214 215 216
         <td><code>fcall</code>/<code>invoke</code>, <code>fapply</code>/<code>post</code>, <code>fbind</code></td>
      </tr>
      <tr>
D
Domenic Denicola 已提交
217 218
         <td><code>ncall</code>, <code>napply</code> (*)</td>
         <td><code>nfcall</code>/<code>ninvoke</code>, <code>nfapply</code>/<code>npost</code></td>
219 220 221 222 223 224
      </tr>
      <tr>
         <td><code>end</code></td>
         <td><code>done</code></td>
      </tr>
      <tr>
D
Domenic Denicola 已提交
225 226
         <td><code>put</code></td>
         <td><code>set</code></td>
227 228 229
      </tr>
      <tr>
         <td><code>node</code></td>
D
Domenic Denicola 已提交
230
         <td><code>nbind</code></td>
231 232 233 234 235
      </tr>
      <tr>
         <td><code>nend</code></td>
         <td><code>nodeify</code></td>
      </tr>
D
Domenic Denicola 已提交
236 237 238 239
      <tr>
         <td><code>isResolved</code></td>
         <td><code>isPending</code></td>
      </tr>
240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258
      <tr>
         <td><code>deferred.node</code></td>
         <td><code>deferred.makeNodeResolver</code></td>
      </tr>
      <tr>
         <td><code>Method</code>, <code>sender</code></td>
         <td><code>dispatcher</code></td>
      </tr>
      <tr>
         <td><code>send</code></td>
         <td><code>dispatch</code></td>
      </tr>
      <tr>
         <td><code>view</code>, <code>viewInfo</code></td>
         <td>(none)</td>
      </tr>
   </tbody>
</table>

D
Domenic Denicola 已提交
259

260 261
(*) Use of ``thisp`` is discouraged. For calling methods, use ``post`` or
``invoke``.
K
Kris Kowal 已提交
262

D
Domenic Denicola 已提交
263 264
### Alignment with the Concurrency Strawman

K
Kris Kowal 已提交
265 266
-   Q now exports a `Q(value)` function, an alias for `resolve`.
    `Q.call`, `Q.apply`, and `Q.bind` were removed to make room for the
D
Domenic Denicola 已提交
267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302
    same methods on the function prototype.
-   `invoke` has been aliased to `send` in all its forms.
-   `post` with no method name acts like `fapply`.

### Error Handling

-   Long stack traces can be turned off by setting `Q.stackJumpLimit` to zero.
    In the future, this property will be used to fine tune how many stack jumps
    are retained in long stack traces; for now, anything nonzero is treated as
    one (since Q only tracks one stack jump at the moment, see #144). #168
-   In Node.js, if there are unhandled rejections when the process exits, they
    are output to the console. #115

### Other

-   `delete` and `set` (née `put`) no longer have a fulfillment value.
-   Q promises are no longer frozen, which
    [helps with performance](http://code.google.com/p/v8/issues/detail?id=1858).
-   `thenReject` is now included, as a counterpart to `thenResolve`.
-   The included browser `nextTick` shim is now faster. #195 @rkatic.

### Bug Fixes

-   Q now works in Internet Explorer 10. #186 @ForbesLindesay
-   `fbind` no longer hard-binds the returned function's `this` to `undefined`.
    #202
-   `Q.reject` no longer leaks memory. #148
-   `npost` with no arguments now works. #207
-   `allResolved` now works with non-Q promises ("thenables"). #179
-   `keys` behavior is now correct even in browsers without native
    `Object.keys`. #192 @rkatic
-   `isRejected` and the `exception` property now work correctly if the
    rejection reason is falsy. #198

### Internals and Advanced

K
Kris Kowal 已提交
303 304 305 306
-   The internal interface for a promise now uses
    `dispatchPromise(resolve, op, operands)` instead of `sendPromise(op,
    resolve, ...operands)`, which reduces the cases where Q needs to do
    argument slicing.
D
Domenic Denicola 已提交
307 308 309 310 311 312 313
-   The internal protocol uses different operands. "put" is now "set".
    "del" is now "delete". "view" and "viewInfo" have been removed.
-   `Q.fulfill` has been added. It is distinct from `Q.resolve` in that
    it does not pass promises through, nor coerces promises from other
    systems. The promise becomes the fulfillment value. This is only
    recommended for use when trying to fulfill a promise with an object that has
    a `then` function that is at the same time not a promise.
K
Kris Kowal 已提交
314

D
Domenic Denicola 已提交
315 316 317 318 319 320 321 322 323
## 0.8.12
- Treat foreign promises as unresolved in `Q.isFulfilled`; this lets `Q.all`
  work on arrays containing foreign promises. #154
- Fix minor incompliances with the [Promises/A+ spec][] and [test suite][]. #157
  #158

[Promises/A+ spec]: http://promises-aplus.github.com/promises-spec/
[test suite]: https://github.com/promises-aplus/promises-tests

K
Kris Kowal 已提交
324
## 0.8.11
K
Kris Kowal 已提交
325

326
 - Added ``nfcall``, ``nfapply``, and ``nfbind`` as ``thisp``-less versions of
K
Kris Kowal 已提交
327
   ``ncall``, ``napply``, and ``nbind``. The latter are now deprecated. #142
328 329 330 331 332 333 334
 - Long stack traces no longer cause linearly-growing memory usage when chaining
   promises together. #111
 - Inspecting ``error.stack`` in a rejection handler will now give a long stack
   trace. #103
 - Fixed ``Q.timeout`` to clear its timeout handle when the promise is rejected;
   previously, it kept the event loop alive until the timeout period expired.
   #145 @dfilatov
K
Kris Kowal 已提交
335 336
 - Added `q/queue` module, which exports an infinite promise queue
   constructor.
337

K
Kris Kowal 已提交
338
## 0.8.10
339 340 341 342 343 344 345 346 347 348 349

 - Added ``done`` as a replacement for ``end``, taking the usual fulfillment,
   rejection, and progress handlers. It's essentially equivalent to
   ``then(f, r, p).end()``.
 - Added ``Q.onerror``, a settable error trap that you can use to get full stack
   traces for uncaught errors. #94
 - Added ``thenResolve`` as 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.
350 351
 - Renamed ``nend`` to ``nodeify``. It no longer returns an always-fulfilled
   promise when a Node callback is passed.
352 353 354 355 356 357 358 359 360 361
 - ``deferred.resolve`` and ``deferred.reject`` no longer (sometimes) return
   ``deferred.promise``.
 - Fixed stack traces getting mangled if they hit ``end`` twice. #116 #121 @ef4
 - Fixed ``ninvoke`` and ``npost`` to work on promises for objects with Node
   methods. #134
 - Fixed accidental coercion of objects with nontrivial ``valueOf`` methods,
   like ``Date``s, by the promise's ``valueOf`` method. #135
 - Fixed ``spread`` not calling the passed rejection handler if given a rejected
   promise.

K
Kris Kowal 已提交
362 363
## 0.8.9

364 365 366 367 368 369 370
 - Added ``nend``
 - Added preliminary progress notification support, via
   ``promise.then(onFulfilled, onRejected, onProgress)``,
   ``promise.progress(onProgress)``, and ``deferred.notify(...progressData)``.
 - Made ``put`` and ``del`` return the object acted upon for easier chaining.
   #84
 - Fixed coercion cycles with cooperating promises. #106
K
Kris Kowal 已提交
371

K
Kris Kowal 已提交
372 373 374 375
## 0.8.7

 - Support [Montage Require](http://github.com/kriskowal/mr)

K
Kris Kowal 已提交
376
## 0.8.6
D
Domenic Denicola 已提交
377 378 379 380 381

 - Fixed ``npost`` and ``ninvoke`` to pass the correct ``thisp``. #74
 - Fixed various cases involving unorthodox rejection reasons. #73 #90
   @ef4
 - Fixed double-resolving of misbehaved custom promises. #75
D
Domenic Denicola 已提交
382 383 384
 - Sped up ``Q.all`` for arrays contain already-resolved promises or scalar
   values. @ForbesLindesay
 - Made stack trace filtering work when concatenating assets. #93 @ef4
D
Domenic Denicola 已提交
385 386 387 388
 - Added warnings for deprecated methods. @ForbesLindesay
 - Added ``.npmignore`` file so that dependent packages get a slimmer
   ``node_modules`` directory.

K
Kris Kowal 已提交
389
## 0.8.5
K
Kris Kowal 已提交
390

391
 - Added preliminary support for long traces (@domenic)
K
Kris Kowal 已提交
392 393 394 395
 - Added ``fapply``, ``fcall``, ``fbind`` for non-thisp
   promised function calls.
 - Added ``return`` for async generators, where generators
   are implemented.
396 397
 - Rejected promises now have an "exception" property.  If an object
   isRejected(object), then object.valueOf().exception will
K
Kris Kowal 已提交
398 399 400 401 402 403
   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
K
Kris Kowal 已提交
404

K
Kris Kowal 已提交
405
## 0.8.4
406 407 408 409 410 411 412

 - WARNING: ``promise.timeout`` is now rejected with an ``Error`` object
   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.
413 414
 - Added ``deferred.makeNodeResolver()`` to replace the more cryptic
   ``deferred.node()`` method.
K
Kris Kowal 已提交
415 416 417 418 419 420
 - 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.
K
Kris Kowal 已提交
421 422 423
 - Added experimental ``Q.begin()`` that is intended to kick off chains
   of ``.then`` so that each of these can be reordered without having to
   edit the new and former first step.
424

K
Kris Kowal 已提交
425
## 0.8.3
426 427 428

 - Added ``isFulfilled``, ``isRejected``, and ``isResolved``
   to the promise prototype.
K
Kris Kowal 已提交
429
 - Added ``allResolved`` for waiting for every promise to either be
K
Kris Kowal 已提交
430
   fulfilled or rejected, without propagating an error. @utvara #53
431 432 433
 - Added ``Q.bind`` as a method to transform functions that
   return and throw into promise-returning functions. See
   [an example](https://gist.github.com/1782808). @domenic
434 435
 - Renamed ``node`` export to ``nbind``, and added ``napply`` to
   complete the set. ``node`` remains as deprecated. @domenic #58
K
Kris Kowal 已提交
436 437 438
 - Renamed ``Method`` export to ``sender``.  ``Method``
   remains as deprecated and will be removed in the next
   major version since I expect it has very little usage.
K
Kris Kowal 已提交
439 440
 - Added browser console message indicating a live list of
   unhandled errors.
441 442 443 444 445
 - Added support for ``msSetImmediate`` (IE10) or ``setImmediate``
   (available via [polyfill](https://github.com/NobleJS/setImmediate))
   as a browser-side ``nextTick`` implementation. #44 #50 #59
 - Stopped using the event-queue dependency, which was in place for
   Narwhal support: now directly using ``process.nextTick``.
446 447 448 449 450
 - WARNING: EXPERIMENTAL: added ``finally`` alias for ``fin``, ``catch``
   alias for ``fail``, ``try`` alias for ``call``, and ``delete`` alias
   for ``del``.  These properties are enquoted in the library for
   cross-browser compatibility, but may be used as property names in
   modern engines.
451

K
Kris Kowal 已提交
452
## 0.8.2
453 454

 - Deprecated ``ref`` in favor of ``resolve`` as recommended by
455
   @domenic.
K
Kris Kowal 已提交
456
 - Update event-queue dependency.
457

K
Kris Kowal 已提交
458
## 0.8.1
K
Kris Kowal 已提交
459

460 461
 - Fixed Opera bug. #35 @cadorn
 - Fixed ``Q.all([])`` #32 @domenic
K
Kris Kowal 已提交
462

K
Kris Kowal 已提交
463
## 0.8.0
464

465
 - WARNING: ``enqueue`` removed.  Use ``nextTick`` instead.
K
Kris Kowal 已提交
466 467
   This is more consistent with NodeJS and (subjectively)
   more explicit and intuitive.
468 469 470
 - WARNING: ``def`` removed.  Use ``master`` instead.  The
   term ``def`` was too confusing to new users.
 - WARNING: ``spy`` removed in favor of ``fin``.
K
Kris Kowal 已提交
471
 - WARNING: ``wait`` removed. Do ``all(args).get(0)`` instead.
472
 - WARNING: ``join`` removed. Do ``all(args).spread(callback)`` instead.
473 474 475
 - WARNING: Removed the ``Q`` function module.exports alias
   for ``Q.ref``. It conflicts with ``Q.apply`` in weird
   ways, making it uncallable.
476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493
 - Revised ``delay`` so that it accepts both ``(value,
   timeout)`` and ``(timeout)`` variations based on
   arguments length.
 - Added ``ref().spread(cb(...args))``, a variant of
   ``then`` that spreads an array across multiple arguments.
   Useful with ``all()``.
 - Added ``defer().node()`` Node callback generator.  The
   callback accepts ``(error, value)`` or ``(error,
   ...values)``.  For multiple value arguments, the
   fulfillment value is an array, useful in conjunction with
   ``spread``.
 - Added ``node`` and ``ncall``, both with the signature
   ``(fun, thisp_opt, ...args)``.  The former is a decorator
   and the latter calls immediately.  ``node`` optional
   binds and partially applies.  ``ncall`` can bind and pass
   arguments.

## 0.7.2
K
Kris Kowal 已提交
494 495 496

 - Fixed thenable promise assimilation.

497
## 0.7.1
K
v0.7.1  
Kris Kowal 已提交
498

499 500 501
 - 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.
K
Kris Kowal 已提交
502

503
## 0.7.0 - BACKWARD INCOMPATIBILITY
K
Kris Kowal 已提交
504 505 506 507 508 509 510 511 512 513

 - WARNING: Removed ``report`` and ``asap``
 - WARNING: The ``callback`` argument of the ``fin``
   function no longer receives any arguments. Thus, it can
   be used to call functions that should not receive
   arguments on resolution.  Use ``when``, ``then``, or
   ``fail`` if you need a value.
 - IMPORTANT: Fixed a bug in the use of ``MessageChannel``
   for ``nextTick``.
 - Renamed ``enqueue`` to ``nextTick``.
K
Kris Kowal 已提交
514 515 516
 - Added experimental ``view`` and ``viewInfo`` for creating
   views of promises either when or before they're
   fulfilled.
K
Kris Kowal 已提交
517 518 519 520
 - Shims are now externally applied so subsequent scripts or
   dependees can use them.
 - Improved minification results.
 - Improved readability.
K
Kris Kowal 已提交
521

522
## 0.6.0 - BACKWARD INCOMPATIBILITY
523

K
v0.6.0  
Kris Kowal 已提交
524
 - WARNING: In practice, the implementation of ``spy`` and
525
   the name ``fin`` were useful.  I've removed the old
526
   ``fin`` implementation and renamed/aliased ``spy``.
527
 - The "q" module now exports its ``ref`` function as a "Q"
528 529
   constructor, with module systems that support exports
   assignment including NodeJS, RequireJS, and when used as
530 531
   a ``<script>`` tag. Notably, strictly compliant CommonJS
   does not support this, but UncommonJS does.
K
Kris Kowal 已提交
532 533 534 535
 - Added ``async`` decorator for generators that use yield
   to "trampoline" promises. In engines that support
   generators (SpiderMonkey), this will greatly reduce the
   need for nested callbacks.
K
Kris Kowal 已提交
536
 - Made ``when`` chainable.
537
 - Made ``all`` chainable.
K
Kris Kowal 已提交
538

539
## 0.5.3
540

541 542 543
 - Added ``all`` and refactored ``join`` and ``wait`` to use
   it.  All of these will now reject at the earliest
   rejection.
544

545
## 0.5.2
546

547 548 549
 - Minor improvement to ``spy``; now waits for resolution of
   callback promise.

550
## 0.5.1
551

K
Kris Kowal 已提交
552 553 554 555 556
 - Made most Q API methods chainable on promise objects, and
   turned the previous promise-methods of ``join``,
   ``wait``, and ``report`` into Q API methods.
 - Added ``apply`` and ``call`` to the Q API, and ``apply``
   as a promise handler.
557 558 559 560 561 562 563 564
 - Added ``fail``, ``fin``, and ``spy`` to Q and the promise
   prototype for convenience when observing rejection,
   fulfillment and rejection, or just observing without
   affecting the resolution.
 - Renamed ``def`` (although ``def`` remains shimmed until
   the next major release) to ``master``.
 - Switched to using ``MessageChannel`` for next tick task
   enqueue in browsers that support it.
K
Kris Kowal 已提交
565

566
## 0.5.0 - MINOR BACKWARD INCOMPATIBILITY
567

K
v0.5.0  
Kris Kowal 已提交
568 569 570 571 572 573 574 575 576 577 578 579 580 581
 - Exceptions are no longer reported when consumed.
 - Removed ``error`` from the API.  Since exceptions are
   getting consumed, throwing them in an errback causes the
   exception to silently disappear.  Use ``end``.
 - Added ``end`` as 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 ``uncaughtException`` events, and browsers to
   likewise emit ``onerror`` and log to the console.
 - Added ``join`` and ``wait`` as 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.

582
## 0.4.4
583

584 585 586 587 588 589 590 591 592 593 594
 - ``end`` no longer returns a promise. It is the end of the
   promise chain.
 - Stopped reporting thrown exceptions in ``when`` callbacks
   and errbacks.  These must be explicitly reported through
   ``.end()``, ``.then(null, Q.error)``, or some other
   mechanism.
 - Added ``report`` as an API method, which can be used as
   an errback to report and propagate an error.
 - Added ``report`` as a promise-chain method, so an error
   can be reported if it passes such a gate.

595
## 0.4.3
596 597 598 599

 - Fixed ``<script>`` support that regressed with 0.4.2
   because of "use strict" in the module system
   multi-plexer.
K
Kris Kowal 已提交
600

601
## 0.4.2
602

603 604
 - Added support for RequireJS (jburke)

605
## 0.4.1
606

607 608 609 610 611
 - 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.

612
## 0.4.0 - BACKWARD INCOMPATIBLE*
613

614 615 616 617 618
 - *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.
619
 - Fixed thenable assimilation.
620 621 622
 - Fixed some issues with asap, when it resolves to
   undefined, or throws an exception.

623
## 0.3.0 - BACKWARD-INCOMPATIBLE
624

625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645
 - The `post` method has been reverted to its original
   signature, as provided in Tyler Close's `ref_send` API.
   That is, `post` accepts 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 `invoke` function that posts
   the variadic arguments to the value given in the first
   argument.
 - The `defined` method has been moved from `q` to `q/util`
   since it gets no use in practice but is still
   theoretically useful.
 - The `Promise` constructor has been renamed to
   `makePromise` to be consistent with the convention that
   functions that do not require the `new` keyword to be
   used as constructors have camelCase names.
 - The `isResolved` function has been renamed to
   `isFulfilled`.  There is a new `isResolved` function 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.
646

647
## 0.2.10
648

K
kriskowal 已提交
649 650 651
 - Added `join` to `"q/util"` for variadically joining
   multiple promises.

652
## 0.2.9
653

K
v0.2.9  
kriskowal 已提交
654 655 656
 - The future-compatible `invoke` method has been added,
   to replace `post`, since `post` will become backward-
   incompatible in the next major release.
657 658 659
 - Exceptions thrown in the callbacks of a `when` call are
   now emitted to Node's `"uncaughtException"` `process`
   event in addition to being returned as a rejection reason.
660

661
## 0.2.8
662

663 664 665 666
 - Exceptions thrown in the callbacks of a `when` call
   are now consumed, warned, and transformed into
   rejections of the promise returned by `when`.

667
## 0.2.7
668

669 670 671 672 673
 - Fixed a minor bug in thenable assimilation, regressed
   because of the change in the forwarding protocol.
 - Fixed behavior of "q/util" `deep` method on dates and
   other primitives. Github issue #11.

674
## 0.2.6
675

676 677 678
 - Thenables (objects with a "then" method) are accepted
   and provided, bringing this implementation of Q
   into conformance with Promises/A, B, and D.
K
kriskowal 已提交
679 680
 - Added `makePromise`, to replace the `Promise` function
   eventually.
K
kriskowal 已提交
681 682 683
 - 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
K
kriskowal 已提交
684
   "promiseRejected" property equal to "true" and a
K
kriskowal 已提交
685
   "reason" property corresponding to the rejection reason.
686 687 688 689 690 691
 - Altered the `makePromise` API such that the `fallback`
   method no longer receives a superfluous `resolved` method
   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.
K
kriskowal 已提交
692

693
## 0.2.5
694

695 696 697 698
 - 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 `valueOf`".
699 700
 - Exceptions in promises are now captured and returned
   as rejections.
K
kriskowal 已提交
701

702
## 0.2.4
703

K
kriskowal 已提交
704 705 706 707 708
 - Fixed bug in `ref` that prevented `del` messages from
   being received (gozala)
 - Fixed a conflict with FireFox 4; constructor property
   is now read-only.

709
## 0.2.3
710

711 712
 - Added `keys` message to promises and to the promise API.

713
## 0.2.2
714

715 716
 - Added boilerplate to `q/queue` and `q/util`.
 - Fixed missing dependency to `q/queue`.
K
kriskowal 已提交
717

718
## 0.2.1
719

720 721 722 723 724 725 726 727 728
 - The `resolve` and `reject` methods of `defer` objects now
   return the resolution promise for convenience.
 - Added `q/util`, which provides `step`, `delay`, `shallow`,
   `deep`, and three reduction orders.
 - Added `q/queue` module for a promise `Queue`.
 - Added `q-comm` to the list of compatible libraries.
 - Deprecated `defined` from `q`, with intent to move it to
   `q/util`.

729
## 0.2.0 - BACKWARD INCOMPATIBLE
730

K
kriskowal 已提交
731
 - Changed post(ref, name, args) to variadic
K
kriskowal 已提交
732 733 734 735 736 737 738
   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
739
   forwarding messages to a value or promise in a future turn.
K
kriskowal 已提交
740

741
## 0.1.9
742

K
kriskowal 已提交
743 744 745 746
 - Added isRejected() for testing whether a value is a rejected
   promise.  isResolved() retains the behavior of stating
   that rejected promises are not resolved.

747
## 0.1.8
748

749
 - Fixed isResolved(null) and isResolved(undefined) [issue #9]
750
 - Fixed a problem with the Object.create shim
751

752
## 0.1.7
753

754 755 756
 - shimmed ES5 Object.create in addition to Object.freeze
   for compatibility on non-ES5 engines (gozala)

757
## 0.1.6
758

759 760 761 762 763 764
 - Q.isResolved added
 - promise.valueOf() now returns the value of resolved
   and near values
 - asap retried
 - promises are frozen when possible

765
## 0.1.5
766

K
v0.1.5  
kriskowal 已提交
767 768 769
 - fixed dependency list for Teleport (gozala)
 - all unit tests now pass (gozala)

770
## 0.1.4
771

K
kriskowal 已提交
772 773 774 775
 - added support for Teleport as an engine (gozala)
 - simplified and updated methods for getting internal
   print and enqueue functions universally (gozala)

776
## 0.1.3
777

K
kriskowal 已提交
778 779
 - fixed erroneous link to the q module in package.json

780
## 0.1.2
781

782 783
 - restructured for overlay style package compatibility

784
## 0.1.0
785

K
kriskowal 已提交
786 787 788
 - removed asap because it was broken, probably down to the
   philosophy.

789
## 0.0.3
790

K
kriskowal 已提交
791 792 793
 - removed q-util
 - fixed asap so it returns a value if completed

794
## 0.0.2
795

K
kriskowal 已提交
796 797
 - added q-util

798
## 0.0.1
799

K
kriskowal 已提交
800
 - initial version