Skip to content

Support for native async await when using noop zone js #22191

Closed

Description

@thduttonuk

🚀 Feature request

Command (mark with an x)

  • new
  • build
  • serve
  • test
  • e2e
  • generate
  • add
  • update
  • lint
  • extract-i18n
  • run
  • config
  • help
  • version
  • doc

Description

A way to enable native async/await. We have a large Angular 13 project running absolutely fine without zone.js

Have the ability to remove the plugin-transform-async-to-generator from the transpile stage. I’ve removed manually for now and everything works. The debugging experience is very nice in a no zone.js native async/await Angular project.

Could this be achieved with a new build option?. Or maybe there is a better way to remove the plug-in that I haven't found.

Activity

  1. added
    feature
    on Nov 18, 2021
  2. added this to the Backlog milestone on Nov 18, 2021
  3. angular-robot commented on Feb 1, 2022

    @angular-robot
    Contributor

    Just a heads up that we kicked off a community voting process for your feature request. There are 20 days until the voting process ends.

    Find more details about Angular's feature request process in our documentation.

  4. added
    feature: votes required
    on Feb 1, 2022
  5. modified the milestones: Backlog, needsTriage on Feb 1, 2022
  6. angular-robot commented on Feb 22, 2022

    @angular-robot
    Contributor

    Thank you for submitting your feature request! Looks like during the polling process it didn't collect a sufficient number of votes to move to the next stage.

    We want to keep Angular rich and ergonomic and at the same time be mindful about its scope and learning journey. If you think your request could live outside Angular's scope, we'd encourage you to collaborate with the community on publishing it as an open source package.

    You can find more details about the feature request process in our documentation.

  7. added
    feature: insufficient votes
    and removed
    feature: votes required
    on Feb 22, 2022
  8. HarelM commented on Oct 17, 2023

    @HarelM

    Is there a way to remove the plugin-transform-async-to-generator using some kind of webpack / babel configuration for specific libraries?
    It seems that we introduced an async-await in the worker code and importing this library in Angular completely breaks the library (maplibre-gl) and the angular app.
    See the following discussion:
    maplibre/maplibre-gl-js#3210

    Any help would be approceicated!
    cc: @JeanMeche

  9. birkskyum commented on Oct 17, 2023

    @birkskyum

    @alan-agius4 , this Feature Request didn't get enough votes two years ago, but when a recent issue was opened with the same request, you closed it as a duplicate of this, without giving it a chance to get the needed votes (it's likely more popular request now due to much higher browser support for await/async). Does it mean that this is already on the roadmap?

  10. ranma42 commented on Oct 17, 2023

    @ranma42

    considering that zone.js might be optional https://angular.io/guide/roadmap#improve-runtime-performance-and-developer-experience-with-a-new-reactivity-model using native async-await in Angular might be even more natural than before 🚀

  11. birkskyum commented on Oct 17, 2023

    @birkskyum

    @ranma42 , right, it'll be very convenient, but it's not working yet as of the latest v17.0.0-next.8. Using Signals, and removing zone.js, doesn't pass the reactive system to Signals - instead it's still mandated to add the manual calls for change detection.

  12. johncrim commented on Oct 19, 2023

    @johncrim

    IMO this voting process deadline doesn't accomodate the idea that most people that use angular don't search for an issue until they encounter it. There are very few angular developers that continually scan the issue list for ideas to vote on.

    IMO issues should be re-opened when they exceed 20 votes, if they were closed due to not enough votes.

  13. 5 remaining items

  14. added 8 commits that reference this issue on Apr 17, 2024
    5c9797d
    50a1bbe
    cb9c608
    70b02eb
    81fcdd7
    5fafed9
    d9ec31c
    a35aaa2
  15. added a commit that references this issue on Apr 18, 2024
    d1c632a
  16. HarelM commented on Apr 21, 2024

    @HarelM

    Is it possible to use this feature while still using zone?
    While there's a big hype and comment around why zone.js is bad and that I shouldn't be using it, there is almost zero documentation on how to really remove it from my app (without almost doing a full rewrite, which for me is counter productive as bundle size is a lot less important than code that actually works well)...

    The following library is using zone.js heavily so removing it will require a lot of work, this library is the main reason I commented in this issue:
    https://github.com/maplibre/ngx-maplibre-gl

    P.S. this is almost the only documentation I found about zone.js and it is describing a super super simple case, and it is obvious that even for this super super simple case, there is a lot of (risky) work that needs to be done:
    https://github.com/manfredsteyer/articles/blob/master/angular-elements-without-zonejs.md

  17. atscott commented on Apr 21, 2024

    @atscott
    Contributor

    Is it possible to use this feature while still using zone

    No, in order for ZoneJS to work properly, it needs to patch all async microtasks. Mixing zone-patched tasks with native tasks will result in them executing in the wrong order.

    The uses of NgZone in the library you mentioned do not look problematic. There should be no problem using it in a Zoneless application.

  18. angular-automatic-lock-bot commented on May 22, 2024

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  19. locked and limited conversation to collaborators on May 22, 2024
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

    area: @angular-devkit/build-angularfeaturefeature: in backlogfeature: under consideration

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions