-
Notifications
You must be signed in to change notification settings - Fork 165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add normative text and supporting note for handler-returned promises #52
Conversation
I like it, but I think implementer feedback and/or a survey of existing libraries is needed to see if this actually matches how things are done, in practice. If there's another way to make this work that people are doing, we don't want to prohibit it. Thus, I summon @briancavalier @kriskowal @wycats. As an aside, underscore.deferred basically doesn't chain at all with non-underscore.deferred promises. So it's actually really good that we're specifying this. |
@domenic, let’s make a test for assimilation between libraries A and B, then run it on the clique of adapters and see what happens. The language is stronger than necessary for cannibalism and suboptimal for Q since it has other messages than just "then", but the language is quite sufficient for assimilation. |
I think the language here is compatible with when.js's implementation. In all cases, when.js does call In addition to @kriskowal's library-pair-permutation idea, you could also create a small set of "fake" promises for libs to attempt to assimilate. |
I'll rebase this and we can continue to discuss. |
OK, actually this language is a bit too restrictive for Q, as @kriskowal points out. In particular, for Q promises, we bypass In practice, this means that if I wrote a test that used a Q promise as Having a hard time thinking of what to do here :-/. We could move the attempt-procedure entirely into the non-normative section, I guess. |
Hmmm, yes, I see the problem. If a particular implementation recognizes other types of promises and prefers their API over Promises/A+, it makes the implementation non-compliant, even if it does call The text of these particular points is very prescriptive in terms of implementation--more so than the rest of the spec. It seems like sticking with the original language, which dictates only the correct outcome, and adding a note would be ok. Another option might be to reword the text to keep "must" for "into the same state", but use "should" for the portion that deals with calling Other ideas? |
@briancavalier +1 to keeping the existing language and adding a note, though I admit the note doesn't feel necessary to me. What's important here is the outcome. The obvious choice for implementers, given the criteria on lines 67+, is to call the promise's @domenic Tough to test, I agree. |
@domenic If you're also ok with the original language + note, I'll update the pull request. |
@briancavalier sure, give it a shot. |
Ok guys, let me know what you think. The note is a bit long, but seems necessary to include everything that's in there. |
LGTM |
Yeah, looks fine from here. |
This will probably conflict with #49, so either @lsmith or I will need to rebase. Wanted to get feedback, though.