Skip to content

Limit the proposal to Promise and async/await only? #65

@dfahlander

Description

@dfahlander

This proposal is so great. It fills the black whole - a missing link between promise flows - and I believe it fills a really important missing piece in modern JS.

The described use cases are great - priority tasks, logging contexts etc. But I also believe this proposal could improve many user-land libraries and frameworks and make things possible that weren't before:

  • React will be able to support async components on the client (making it in-pair with their new server components) as React.Context could work thanks to this proposal. All the dancing around async fetching using useEffect() or suspense would suddenly be a piece of cake and drag us back to plain await calls within the components.

  • Dexie.js (my library) will be able to track liveQueries and transactions without having to do it using its own tricks.

...probably a lot more libraries and frameworks that are context aware - that could go all-in on async await without having to re-invent the wheel.

That said, I think the biggest win of this proposal is Promise and async/await. All whatwg related features (especially the discussion around EventTarget #19) could potentially generate some questions that could take time and effort from the core proposal. In the worst case, stall this proposal from advancement.

Could it be a thought to put whatwg-related changes as a non-goal for this proposal and limit it to Promise and async/await only as a first step?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions