Skip to content

Interoperability Implementation #64

Closed

Description

@kelunik

Do you plan to implement https://github.com/async-interop/awaitable? Would you mind to provide feedback?

Activity

  1. jsor commented on Sep 23, 2016

    @jsor
    Member

    I'm planning to support at least consuming awaitables through resolve.

    What kind of feedback would you like to have and where? Any specific issues or just general feedback?

  2. kelunik commented on Sep 23, 2016

    @kelunik
    Author

    Mostly general feedback whether it's fine in the current state. Most actively involved people come from Icicle and Amp, would be good to have also feedback from React.

    The signature should be compatible, I hope the order requirements and other requirements are compatible as well.

  3. jsor commented on Sep 26, 2016

    @jsor
    Member

    The only problem i see is the requirement of an event loop implementation. React/Promise doesn't require an event loop. I fear this will block us from implementing the interface directly.

    Will there be a test suite like the one for the event loop?

  4. kelunik commented on Sep 26, 2016

    @kelunik
    Author

    I don't know whether we can provide a test suite, as the interface only standardizes how promises / awaitables can be consumed, not how they're resolved.

    React/Promise doesn't require an event loop. I fear this will block us from implementing the interface directly.

    That might indeed be an issue. If you can't implement the interface directly, I guess we have to live with adapter functions. React doesn't have the issue with the callbacks throwing, as that just fails the returned promise. /cc @bwoebi

  5. bwoebi commented on Sep 26, 2016

    @bwoebi

    Regarding the event loop, we can just make the behavior undefined in case it's lacking. Thus, React can handle it it's own way if there's no event-loop. If people use when() with no event loop driver factory registered, it's their fault.

    After all it just applies to the quite rare case that a callback is throwing, which usually should not happen anyway. It's just for uncaught top-level error condition handling.

    @jsor À propos tests, how can we test an interface with only a mere callback registering method, as the interface doesn't specify a way to trigger the callbacks?

  6. jsor commented on Sep 27, 2016

    @jsor
    Member

    The introduction of a task queue in 3.0 (which defaults to a synchronous implementation but can be replaced with an event loop based implementation) will probably solve this.

    Regarding the tests: I thought about something like the Promises/A+ Compliance Test Suite where you can provide an adapter and then validate if your implementation complies with the spec.

  7. bwoebi commented on Sep 27, 2016

    @bwoebi

    Okay, I'll give a shot at the tests this evening.

  8. bwoebi commented on Oct 24, 2016

    @bwoebi

    @jsor Turns out "This evening" was a bit too ambitious :-P

    Anyway, here it is: https://github.com/async-interop/awaitable-test - I hope this suits your needs? (The loop is optional and just needed for one test, which is skipped if driver set to null)

  9. jsor commented on Oct 24, 2016

    @jsor
    Member

    @bwoebi Great, thanks! I will look into it and see if we can consider implementing Awaitable directly for 3.0.

  10. jsor commented on Nov 30, 2016

    @jsor
    Member

    I've done an implementation for 2.x if anyone wants to review: 2.x...2.x-async-interop

    @bwoebi I've copied your tests over because your repository is still using Awaitable instead of Promise.

  11. kelunik commented on May 27, 2017

    @kelunik
    Author

    Closing as no longer relevant. Amp v2 will have built-in support for React's promises, maybe React wants to do something similar, but that should be discussed in a separate issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions