fix(compiler): use chunk origin in template HMR request URL by clydin · Pull Request #59459 · angular/angular · GitHub
Skip to content

fix(compiler): use chunk origin in template HMR request URL - #59459

Closed
clydin wants to merge 1 commit into
angular:mainfrom
clydin:hmr/full-url
Closed

clydin wants to merge 1 commit into
angular:mainfrom
clydin:hmr/full-url

Conversation

@clydin

@clydin clydin commented Jan 9, 2025

Copy link
Copy Markdown
Member

The URL that is dynamically imported to fetch a potential component update for HMR is now based on the value of import.meta.url. This ensures that the request is sent to the same location that was used to retrieve the application code. For some development server setups the HTML base HREF may not be the location of the Angular development server. By using the application code location which was generated by the development server, HMR requests can continue to work as expected in these scenarios. In most common cases, this change will not have any effect as the HTML base HREF aligns with the location of the application code files.

The URL that is dynamically imported to fetch a potential component update
for HMR is now based on the value of `import.meta.url`. This ensures that
the request is sent to the same location that was used to retrieve the
application code. For some development server setups the HTML base HREF
may not be the location of the Angular development server. By using the
application code location which was generated by the development server,
HMR requests can continue to work as expected in these scenarios. In
most common cases, this change will not have any effect as the HTML base
HREF aligns with the location of the application code files.
@clydin clydin added the target: rc This PR is targeted for the next release-candidate label Jan 9, 2025
@pullapprove
pullapprove Bot requested a review from devversion January 9, 2025 21:29
@angular-robot angular-robot Bot added the area: compiler Issues related to `ngc`, Angular's template compiler label Jan 9, 2025
@ngbot ngbot Bot added this to the Backlog milestone Jan 9, 2025
@clydin
clydin requested review from crisbeto and removed request for devversion January 9, 2025 21:30
@clydin clydin added the action: review The PR is still awaiting reviews from at least one requested reviewer label Jan 9, 2025
Comment thread packages/compiler-cli/test/ngtsc/hmr_spec.ts
Comment thread packages/compiler-cli/test/ngtsc/hmr_spec.ts
@clydin clydin 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 9, 2025
@kirjs

kirjs commented Jan 9, 2025

Copy link
Copy Markdown
Contributor

kirjs pushed a commit that referenced this pull request Jan 9, 2025
The URL that is dynamically imported to fetch a potential component update
for HMR is now based on the value of `import.meta.url`. This ensures that
the request is sent to the same location that was used to retrieve the
application code. For some development server setups the HTML base HREF
may not be the location of the Angular development server. By using the
application code location which was generated by the development server,
HMR requests can continue to work as expected in these scenarios. In
most common cases, this change will not have any effect as the HTML base
HREF aligns with the location of the application code files.

PR Close #59459
@kirjs kirjs closed this in a416414 Jan 9, 2025
@clydin
clydin deleted the hmr/full-url branch January 9, 2025 23:47
PrajaktaB27 pushed a commit to PrajaktaB27/angular that referenced this pull request Feb 7, 2025
…59459)

The URL that is dynamically imported to fetch a potential component update
for HMR is now based on the value of `import.meta.url`. This ensures that
the request is sent to the same location that was used to retrieve the
application code. For some development server setups the HTML base HREF
may not be the location of the Angular development server. By using the
application code location which was generated by the development server,
HMR requests can continue to work as expected in these scenarios. In
most common cases, this change will not have any effect as the HTML base
HREF aligns with the location of the application code files.

PR Close angular#59459
@angular-automatic-lock-bot

Copy link
Copy Markdown

@angular-automatic-lock-bot angular-automatic-lock-bot Bot locked and limited conversation to collaborators Feb 9, 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: compiler Issues related to `ngc`, Angular's template compiler target: rc This PR is targeted for the next release-candidate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants