Skip to content

Allow flag to disable transformation of async/await calls #2990

Closed

Description

@zikaari

Now that Chrome devtools debugger supports stepping over async/await calls, it is extremely helpful when debugging async code.

For example, right now, if I'm paused on

40| const res = await fetch('https://example.com');
// sourcemapped code, not actual

and I hit step over, debugger suddenly jumps to some random line, totally out of context as far as I am concerned.

Now here's where pure gold is, if await calls are not transformed by babel and remain as they are, and again I'm on

40| const res = await fetch('https://example.com');

on hitting step over I jump to, as I'd expect

41| const text = await res.text();

... and so on

Without this, the only option I can use is console.log, .....really painful.

It would be a great addition, maybe we can have this behind a flag of some sort, like yarn start --keep-async

Thoughts, welcome

Activity

  1. gaearon commented on Aug 22, 2017

    @gaearon
    Contributor

    Yea. I think there's an issue for allowing different environments for development and production. Could you look for it?

  2. zikaari commented on Aug 22, 2017

    @zikaari
    ContributorAuthor

    The most relevant one I guess is this Make target browsers configurable #1249

    (Underlying logic of both proposals is exact same, both involves skipping or applying polyfills/transformations)

  3. zikaari commented on Sep 16, 2017

    @zikaari
    ContributorAuthor

    Any progress towards this?

    cc @gaearon

  4. Timer commented on Sep 16, 2017

    @Timer
    Contributor

    Nothing on this front yet, @NeekSandhu. Please keep an eye on #1249.

  5. zikaari commented on Sep 16, 2017

    @zikaari
    ContributorAuthor

    I've been, that discussion has been been still for quite some time.

  6. Timer commented on Sep 16, 2017

    @Timer
    Contributor

    You can try to push that pull request forward, but we won't be adding special treatment for async/await -- it'll need to be accomplished through browser target support.

  7. Timer commented on Sep 16, 2017

    @Timer
    Contributor

    Feel free to make a new PR. 😄

  8. locked and limited conversation to collaborators on Jan 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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