Skip to content

Commit

Permalink
refactor(@angular/build): remove deprecated Vite node server hot fiel…
Browse files Browse the repository at this point in the history
…d usage

The `ViteServer` instance's `hot` field is deprecated and will eventually be
removed. The `ws` field can be used in its place.
  • Loading branch information
clydin authored and alan-agius4 committed Oct 1, 2024
1 parent f630726 commit e9b29be
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/angular/build/src/builders/dev-server/vite-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ export async function* serveWithVite(
case ResultKind.Failure:
if (result.errors.length && server) {
hadError = true;
server.hot.send({
server.ws.send({
type: 'error',
err: {
message: result.errors[0].text,
Expand Down Expand Up @@ -230,7 +230,7 @@ export async function* serveWithVite(
if (hadError && server) {
hadError = false;
// Send an empty update to clear the error overlay
server.hot.send({
server.ws.send({
'type': 'update',
updates: [],
});
Expand Down Expand Up @@ -369,7 +369,7 @@ export async function* serveWithVite(
key: 'r',
description: 'force reload browser',
action(server) {
server.hot.send({
server.ws.send({
type: 'full-reload',
path: '*',
});
Expand Down Expand Up @@ -433,7 +433,7 @@ async function handleUpdate(
if (serverOptions.liveReload || serverOptions.hmr) {
if (updatedFiles.every((f) => f.endsWith('.css'))) {
const timestamp = Date.now();
server.hot.send({
server.ws.send({
type: 'update',
updates: updatedFiles.flatMap((filePath) => {
// For component styles, an HMR update must be sent for each one with the corresponding
Expand Down Expand Up @@ -468,7 +468,7 @@ async function handleUpdate(

// Send reload command to clients
if (serverOptions.liveReload) {
server.hot.send({
server.ws.send({
type: 'full-reload',
path: '*',
});
Expand Down

0 comments on commit e9b29be

Please sign in to comment.