Skip to content

Commit 0e8f1e6

Browse files
committed
refactor(@angular/build): use new HMR documentation URL for console message
The https://angular.dev/hmr URL is now used in the HMR enabled console message for the development server. The message text has also been shortened as the information is available at the aforementioned documentation location.
1 parent a3504fd commit 0e8f1e6

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

packages/angular/build/src/builders/dev-server/tests/options/hmr_spec.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ describeServeBuilder(executeDevServer, DEV_SERVER_BUILDER_INFO, (harness, setupT
1818
setupTarget(harness, {});
1919
});
2020

21-
it('shows message with opt out steps by default', async () => {
21+
it('shows message with documentation by default', async () => {
2222
harness.useTarget('serve', {
2323
...BASE_OPTIONS,
2424
});
@@ -33,12 +33,12 @@ describeServeBuilder(executeDevServer, DEV_SERVER_BUILDER_INFO, (harness, setupT
3333
);
3434
expect(logs).toContain(
3535
jasmine.objectContaining<logging.LogEntry>({
36-
message: jasmine.stringMatching('--no-hmr'),
36+
message: jasmine.stringMatching('angular.dev/hmr'),
3737
}),
3838
);
3939
});
4040

41-
it('shows message with opt out steps when explicitly enabled', async () => {
41+
it('shows message with documentation when explicitly enabled', async () => {
4242
harness.useTarget('serve', {
4343
...BASE_OPTIONS,
4444
hmr: true,
@@ -54,12 +54,12 @@ describeServeBuilder(executeDevServer, DEV_SERVER_BUILDER_INFO, (harness, setupT
5454
);
5555
expect(logs).toContain(
5656
jasmine.objectContaining<logging.LogEntry>({
57-
message: jasmine.stringMatching('--no-hmr'),
57+
message: jasmine.stringMatching('angular.dev/hmr'),
5858
}),
5959
);
6060
});
6161

62-
it('does not show enabled message with opt out steps when explicitly disabled', async () => {
62+
it('does not show enabled message with documentation when explicitly disabled', async () => {
6363
harness.useTarget('serve', {
6464
...BASE_OPTIONS,
6565
hmr: false,
@@ -75,7 +75,7 @@ describeServeBuilder(executeDevServer, DEV_SERVER_BUILDER_INFO, (harness, setupT
7575
);
7676
expect(logs).not.toContain(
7777
jasmine.objectContaining<logging.LogEntry>({
78-
message: jasmine.stringMatching('--no-hmr'),
78+
message: jasmine.stringMatching('angular.dev/hmr'),
7979
}),
8080
);
8181
});

packages/angular/build/src/builders/dev-server/vite-server.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,10 +168,7 @@ export async function* serveWithVite(
168168
browserOptions.aot && serverOptions.liveReload && serverOptions.hmr && useComponentTemplateHmr;
169169
if (browserOptions.templateUpdates) {
170170
context.logger.warn(
171-
'Component HMR has been enabled.\n' +
172-
'If you encounter application reload issues, you can manually reload the page to bypass HMR and/or disable this feature with the' +
173-
' `--no-hmr` command line option.\n' +
174-
'Please consider reporting any issues you encounter here: https://github.com/angular/angular-cli/issues\n',
171+
'Component HMR has been enabled, see https://angular.dev/hmr for more info.',
175172
);
176173
}
177174

0 commit comments

Comments
 (0)