Skip to content

fix(@angular/build): perform incremental background file updates with component updates #29373

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

Merged
merged 1 commit into from
Jan 16, 2025

Conversation

clydin
Copy link
Member

@clydin clydin commented Jan 16, 2025

When HMR is enabled, a change to a lazy route component template may alter the names of lazy chunks. These lazy chunks must be updated within the development server so that any later non-HMR based update will have access to these chunks. To support this, the incremental results from the build process can now emit background file updates that will provide output file changes without triggering client updates.

@clydin clydin added the target: patch This PR is targeted for the next patch release label Jan 16, 2025
@clydin clydin force-pushed the hmr/incremental-background-updates branch 2 times, most recently from 9cb2bc9 to fa325b2 Compare January 16, 2025 15:56
… component updates

When HMR is enabled, a change to a lazy route component template may alter the
names of lazy chunks. These lazy chunks must be updated within the development
server so that any later non-HMR based update will have access to these chunks.
To support this, the incremental results from the build process can now emit
background file updates that will provide output file changes without triggering
client updates.
@clydin clydin force-pushed the hmr/incremental-background-updates branch from fa325b2 to fbe97d3 Compare January 16, 2025 16:01
@alan-agius4 alan-agius4 linked an issue Jan 16, 2025 that may be closed by this pull request
Copy link
Collaborator

@alan-agius4 alan-agius4 left a comment

Choose a reason for hiding this comment

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

LGTM, I am no longer able to replicate the problem with this change.

NIT: as a followup we should add a test that verifies when accessing main.js vite does not error.

@alan-agius4 alan-agius4 added the action: merge The PR is ready for merge by the caretaker label Jan 16, 2025
@dgp1130 dgp1130 merged commit e59946c into angular:main Jan 16, 2025
31 checks passed
@dgp1130
Copy link
Collaborator

dgp1130 commented Jan 16, 2025

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

@clydin clydin deleted the hmr/incremental-background-updates branch January 16, 2025 17:42
@p1n5u
Copy link

p1n5u commented Jan 22, 2025

@alan-agius4 Do you know when the next 19.1.x release will be available with this fix? I’m currently trying to upgrade my application from 19.0.x to 19.1.x, but this bug prevents ng serve from working as soon as I use dynamic imports in my code (not only when lazy-loading routes).

@alan-agius4
Copy link
Collaborator

@p1n5u, this update was released last week. I believe you may be encountering a different issue.

@p1n5u
Copy link

p1n5u commented Jan 22, 2025

@alan-agius4 you are right. sorry for the noise. will try to create a minimal reproduction example and open an issue.

@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 Feb 22, 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: @angular/build 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 error [plugin:vite:import-analysis] Failed to resolve import
4 participants