Skip to content

fix(core): run HMR replacement in the zone#59562

Closed
crisbeto wants to merge 1 commit intoangular:mainfrom
crisbeto:59559/hmr-zone
Closed

fix(core): run HMR replacement in the zone#59562
crisbeto wants to merge 1 commit intoangular:mainfrom
crisbeto:59559/hmr-zone

Conversation

@crisbeto
Copy link
Copy Markdown
Member

Fixes that in some cases the HMR replacement function was being run outside the zone which meant that change detection would break down after a replacement.

Fixes #59559.

Fixes that in some cases the HMR replacement function was being run outside the zone which meant that change detection would break down after a replacement.

Fixes angular#59559.
@crisbeto crisbeto added action: review The PR is still awaiting reviews from at least one requested reviewer target: patch This PR is targeted for the next patch release labels Jan 16, 2025
@angular-robot angular-robot bot added the area: core Issues related to the framework runtime label Jan 16, 2025
@ngbot ngbot bot added this to the Backlog milestone Jan 16, 2025
ngDevMode && assertTNodeType(tNode, TNodeType.Element);
ngDevMode && assertNotEqual(newDef, oldDef, 'Expected different component definition');
const zone = lView[INJECTOR].get(NgZone, null);
const recreate = () => {
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This logic is the same as before, I just had to wrap it in a callback.

@wartab
Copy link
Copy Markdown
Contributor

wartab commented Jan 16, 2025

I don't like being that guy, but could we get a fast tracked release for this? I had to disable hmr because I'm never sure if the issue is my code or this.

@pkozlowski-opensource
Copy link
Copy Markdown
Member

@wartab we are planning to cut a patch release as soon as this fix lands.

@pkozlowski-opensource pkozlowski-opensource added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Jan 16, 2025
@pkozlowski-opensource
Copy link
Copy Markdown
Member

This PR was merged into the repository by commit c9cd558.

The changes were merged into the following branches: main, 19.1.x

pkozlowski-opensource pushed a commit that referenced this pull request Jan 16, 2025
Fixes that in some cases the HMR replacement function was being run outside the zone which meant that change detection would break down after a replacement.

Fixes #59559.

PR Close #59562
@pkozlowski-opensource
Copy link
Copy Markdown
Member

@wartab 19.1.1 patch release with a fix should be on the npm

@wartab
Copy link
Copy Markdown
Contributor

wartab commented Jan 16, 2025

@pkozlowski-opensource Thank you so much for keeping me updated. I'll give it a try now.

PrajaktaB27 pushed a commit to PrajaktaB27/angular that referenced this pull request Feb 7, 2025
Fixes that in some cases the HMR replacement function was being run outside the zone which meant that change detection would break down after a replacement.

Fixes angular#59559.

PR Close angular#59562
@angular-automatic-lock-bot
Copy link
Copy Markdown

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 Feb 16, 2025
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 target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

HMR Angular DOM Interpolation stop working after first save

3 participants