Skip to content

feat(core): Move zoneless change detection to dev preview #60748

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

Closed
wants to merge 1 commit into from

Conversation

atscott
Copy link
Contributor

@atscott atscott commented Apr 4, 2025

This commit moves zoneless from experimental to developer preview.

  • Update tag on provider API
  • Remove "experimental" from provider name
  • Move documentation from "experimental features" to "Best practices -> Performance" (at least temporarily until there is a better place)

Blocked by the following:

Follow up work:

@angular-robot angular-robot bot added detected: feature PR contains a feature commit area: core Issues related to the framework runtime labels Apr 4, 2025
@ngbot ngbot bot added this to the Backlog milestone Apr 4, 2025
Copy link

github-actions bot commented Apr 4, 2025

Deployed adev-preview for e546e31 to: https://ng-dev-previews-fw--pr-angular-angular-60748-adev-prev-d65gzfow.web.app

Note: As new commits are pushed to this pull request, this link is updated after the preview is rebuilt.

@rainerhahnekamp
Copy link

Great to see that zoneless is moving to developer preview!

What I’m still missing, though, is communication around testing. A lot of existing tests rely on fakeAsync or waitForAsync, which don’t work without zone.js. This raises important questions: Is there a migration path? What’s the recommended approach to handle async behavior in tests going forward?

If fakeAsync/waitForAsync are no longer supported, this could mean a substantial rewrite of many tests. I’d even argue that switching an application to zoneless is relatively straightforward — but updating the tests might be significantly more challenging.

If there’s already an issue or discussion covering this topic, it would be great to link it here. Otherwise, happy to open one if that helps.

@atscott
Copy link
Contributor Author

atscott commented Apr 6, 2025

You do not have to remove fakeAsync from your tests unless you want to purge the ZoneJs library entirely. It’s not much different from any other mock clock library. You could migrate to a different mock clock implementation like sinonJS or jasmine clock if you want.

@rainerhahnekamp
Copy link

Thanks, I understand. Still, I wonder - if I choose to go zoneless in my app, wouldn’t it feel natural to do the same in my tests?

It might be helpful to include a note in the docs explaining:

  1. That waitForAsync and fakeAsync rely on zone.js and keeping them for tests is an option.
  2. A few example tests that show common async scenarios without zone.js and how to leverage the existing async utilities of Jasmine & Jest.

Would that be something worth adding? I’d be more than happy to help out with a PR if that’s helpful!

@atscott
Copy link
Contributor Author

atscott commented Apr 6, 2025

Yes, absolutely. The testing documentation in general could use a good refresh and these would be good topics to cover. Some of them are already in the component testing scenarios page, though that page should be reviewed and updated as a whole.

@rainerhahnekamp
Copy link

Yes, absolutely

Very good. Then I have something to do :)

@atscott atscott marked this pull request as ready for review April 17, 2025 17:33
@pullapprove pullapprove bot requested review from alxhub, crisbeto and kirjs April 17, 2025 17:33
@atscott atscott force-pushed the movezonelessdocs branch 2 times, most recently from 4b4df59 to fe8a0ab Compare April 17, 2025 17:36
@atscott atscott added the target: minor This PR is targeted for the next minor release label Apr 17, 2025
This commit moves zoneless from experimental to developer preview.

* Update tag on provider API
* Remove "experimental" from provider name
* Move documentation from "experimental features" to "Best practives ->
  Performance" (at least temporarily until there is a better place)

BREAKING CHANGE: `provideExperimentalZonelessChangeDetection` is
renamed to `provideZonelessChangeDetection` as it is now "Developer
Preview" rather than "Experimental".
@atscott atscott added target: major This PR is targeted for the next major release and removed target: minor This PR is targeted for the next minor release labels Apr 17, 2025
@angular-robot angular-robot bot added the detected: breaking change PR contains a commit with a breaking change label Apr 17, 2025
Copy link
Contributor

@kirjs kirjs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed-for: public-api

@pullapprove pullapprove bot requested a review from devversion April 21, 2025 13:50
Copy link
Contributor

@AndrewKushnir AndrewKushnir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed-for: public-api

Copy link
Member

@alxhub alxhub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed-for: global-approvers

@atscott atscott added the action: merge The PR is ready for merge by the caretaker label Apr 22, 2025
@pkozlowski-opensource
Copy link
Member

This PR was merged into the repository by commit 953c4b2.

The changes were merged into the following branches: main

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
action: merge The PR is ready for merge by the caretaker adev: preview area: core Issues related to the framework runtime detected: breaking change PR contains a commit with a breaking change detected: feature PR contains a feature commit target: major This PR is targeted for the next major release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants