Skip to content

Commit

Permalink
refactor: replace vite server.ws.send usages
Browse files Browse the repository at this point in the history
The above mentioned API is deprecated.
  • Loading branch information
alan-agius4 committed May 21, 2024
1 parent ac9fc72 commit 0a69322
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions packages/angular/build/src/builders/dev-server/vite-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ export async function* serveWithVite(
// If server is active, send an error notification
if (result.errors?.length && server) {
hadError = true;
server.ws.send({
server.hot.send({
type: 'error',
err: {
message: result.errors[0].text,
Expand All @@ -188,7 +188,7 @@ export async function* serveWithVite(
} else if (hadError && server) {
hadError = false;
// Send an empty update to clear the error overlay
server.ws.send({
server.hot.send({
'type': 'update',
updates: [],
});
Expand Down Expand Up @@ -249,9 +249,6 @@ export async function* serveWithVite(
const projectRoot = join(context.workspaceRoot, root as string);
const browsers = getSupportedBrowsers(projectRoot, context.logger);
const target = transformSupportedBrowsersToTargets(browsers);
const polyfills = Array.isArray((browserOptions.polyfills ??= []))
? browserOptions.polyfills
: [browserOptions.polyfills];

// Setup server and start listening
const serverConfiguration = await setupServer(
Expand All @@ -263,7 +260,7 @@ export async function* serveWithVite(
!!browserOptions.ssr,
prebundleTransformer,
target,
isZonelessApp(polyfills),
isZonelessApp(browserOptions.polyfills),
browserOptions.loader as EsbuildLoaderOption | undefined,
extensions?.middleware,
transformers?.indexHtml,
Expand Down Expand Up @@ -300,7 +297,7 @@ export async function* serveWithVite(
key: 'r',
description: 'force reload browser',
action(server) {
server.ws.send({
server.hot.send({
type: 'full-reload',
path: '*',
});
Expand Down

0 comments on commit 0a69322

Please sign in to comment.