Skip to content
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

fix(core): ComponentFixture autoDetect feature works like production #55228

Closed

Conversation

atscott
Copy link
Contributor

@atscott atscott commented Apr 5, 2024

This commit fully integrates the autoDetect feature into ApplicationRef.tick without special handling for errors.

BREAKING CHANGE: The autoDetect feature of ComponentFixture will now report errors to the ErrorHandler. Previously, these errors were thrown in a setTimeout. The default behavior of ErrorHandler is to simply log the error to console. This change may cause custom error handlers to observe new failures that were previously unreported.

@atscott atscott added the target: major This PR is targeted for the next major release label Apr 5, 2024
@angular-robot angular-robot bot added the detected: breaking change PR contains a commit with a breaking change label Apr 5, 2024
@atscott atscott force-pushed the componentfixtureautodetect_saneVersion branch 4 times, most recently from 61c7250 to 7ce2963 Compare April 6, 2024 15:05
@pkozlowski-opensource pkozlowski-opensource added the area: core Issues related to the framework runtime label Apr 11, 2024
@ngbot ngbot bot added this to the Backlog milestone Apr 11, 2024
@atscott atscott marked this pull request as draft April 12, 2024 20:05
@atscott atscott force-pushed the componentfixtureautodetect_saneVersion branch 2 times, most recently from c760b3a to c6d5a61 Compare July 29, 2024 23:04
@atscott atscott force-pushed the componentfixtureautodetect_saneVersion branch from c6d5a61 to 1cafc90 Compare August 8, 2024 19:51
@atscott atscott added the action: global presubmit The PR is in need of a google3 global presubmit label Aug 8, 2024
@atscott atscott force-pushed the componentfixtureautodetect_saneVersion branch from 1cafc90 to eb08ef7 Compare August 8, 2024 19:53
@atscott atscott force-pushed the componentfixtureautodetect_saneVersion branch 3 times, most recently from a5f5cfc to 7419fa1 Compare August 12, 2024 19:26
@atscott atscott marked this pull request as ready for review August 13, 2024 21:39
This commit fully integrates the `autoDetect` feature into
`ApplicationRef.tick` without special handling for errors.

This commit also shares the method of autoDetect for change detection between
the zoneless and zone component fixture implementations. The difference
is now limited to:

* autoDetect is defaulted to true with zoneless
* detectChanges with zoneless is AppRef.tick while it is
  ChangeDetectorRef.detectChanges with zones. This should likely
  converge more in the future. Not going through AppRef.tick means that
  the zone fixture does not get guaranteed `afterRender` executions and
  does not get the rerunning behavior if the fixture is marked dirty by
  a render hook.

BREAKING CHANGE: The `autoDetect` feature of `ComponentFixture` will now
attach the fixture to the `ApplicationRef`. As a result, errors during
automatic change detection of the fixture be reported to the `ErrorHandler`.
This change may cause custom error handlers to observe new failures that were previously unreported.
@atscott atscott force-pushed the componentfixtureautodetect_saneVersion branch from 7419fa1 to f4195f4 Compare August 15, 2024 18:43
@atscott atscott added action: merge The PR is ready for merge by the caretaker and removed action: global presubmit The PR is in need of a google3 global presubmit labels Aug 15, 2024
@dylhunn
Copy link
Contributor

dylhunn commented Aug 15, 2024

This PR was merged into the repository by commit f03d274.

The changes were merged into the following branches: main

@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 15, 2024
and-oli pushed a commit to and-oli/angular that referenced this pull request Sep 30, 2024
…ngular#55228)

This commit fully integrates the `autoDetect` feature into
`ApplicationRef.tick` without special handling for errors.

This commit also shares the method of autoDetect for change detection between
the zoneless and zone component fixture implementations. The difference
is now limited to:

* autoDetect is defaulted to true with zoneless
* detectChanges with zoneless is AppRef.tick while it is
  ChangeDetectorRef.detectChanges with zones. This should likely
  converge more in the future. Not going through AppRef.tick means that
  the zone fixture does not get guaranteed `afterRender` executions and
  does not get the rerunning behavior if the fixture is marked dirty by
  a render hook.

BREAKING CHANGE: The `autoDetect` feature of `ComponentFixture` will now
attach the fixture to the `ApplicationRef`. As a result, errors during
automatic change detection of the fixture be reported to the `ErrorHandler`.
This change may cause custom error handlers to observe new failures that were previously unreported.

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

Successfully merging this pull request may close these issues.

4 participants