Skip to content

Commit

Permalink
Scale back and upgrade Node.js bridge
Browse files Browse the repository at this point in the history
  • Loading branch information
kriskowal committed Feb 23, 2014
1 parent 856ef93 commit d5bea58
Show file tree
Hide file tree
Showing 4 changed files with 234 additions and 207 deletions.
29 changes: 29 additions & 0 deletions CHANGES.md
Expand Up @@ -58,6 +58,12 @@ deprecation warnings. Deprecated features will be removed outright in version 3.
Q-Connection `v0.5`.
- :warning: The old progress notification system has been removed.
Try the new estimated time to completion feature.
- :warning: `denodeify` now only takes the function to decorate and does not
partially apply arguments. It now also takes a second argument
that determines whether the decorated function needs a variadic or named
argument nodeback.
- :warning: `makeNodeResolver` has been deprecated and no longer
implicitly captures variadic arguments in an array.
- Promises now support vicious cycle detection. If a deferred promise
ultimately depends upon its own resolution, it will be rejected with
the singleton vicious cycle error.
Expand Down Expand Up @@ -124,6 +130,29 @@ progress) will not cause any errors but wont’t send any notifications either.
The feature may be partially restored as a status notification system, but the
behavior will probably change.

### Node.js Bridge

Q 1 supported a wide variety of `n*` methods for bridging to Node.js. In
practice, few of these were used. This release scales back support for the
Node.js bridge to the essential `promise.nodeify`, `Q.denodeify`, and
`Q.ninvoke`.

The beahvior of `denodeify` has been altered to match the behavior of
[RSVP.js][]’s `denodeify`. The version of this method in Q v1 would infer that
the method provided a variable number of arguments (variadic arguments) if the
nodeback was called with more than one non-error argument. This leaves a glaring
ambiguity. With the new interface, whether to collect variadic arguments into an
array, capture arguments by name into an object, or just pass the sole value
argument is decided by a second parameter to `denodeify`. Omitted, you get the
usual Node.js style callback. With `true`, you get variadic arguments. With an
array of names, the arguments will be captured on an object literal with their
respective name.

[RSVP.js]: https://github.com/tildeio/rsvp.js/

The `makeNodeResolver` function has been deprecated and no longer supports the
implicit variadic behavior.

### Deprecations

These have migration shims that simply throw errors.
Expand Down
135 changes: 0 additions & 135 deletions node.js

This file was deleted.

0 comments on commit d5bea58

Please sign in to comment.