Skip to content

Commit 5120314

Browse files
authored
Merge pull request #36806 from dotnet/main
Merge to Live
2 parents 1b52d15 + 8196f18 commit 5120314

File tree

11 files changed

+70
-38
lines changed

11 files changed

+70
-38
lines changed

aspnetcore/host-and-deploy/health-checks.md

Lines changed: 23 additions & 22 deletions
Large diffs are not rendered by default.

aspnetcore/tutorials/signalr-typescript-webpack.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ description: This tutorial provides a walkthrough of bundling and building an AS
77
monikerRange: ">= aspnetcore-2.1"
88
ms.author: wpickett
99
ms.custom: mvc, engagement-fy23
10-
ms.date: 01/27/2026
10+
ms.date: 02/24/2026
1111
uid: tutorials/signalr-typescript-webpack
1212
---
1313
# Tutorial: Get started with ASP.NET Core SignalR using TypeScript and Webpack
@@ -205,7 +205,7 @@ In this section, you create a [Node.js](https://nodejs.org/) project to convert
205205

206206
The `HubConnectionBuilder` class creates a new builder for configuring the server connection. The `withUrl` function configures the hub URL.
207207

208-
SignalR enables the exchange of messages between a client and a server. Each message has a specific name. For example, messages with the name `messageReceived` can run the logic responsible for displaying the new message in the messages zone. Listening to a specific message can be done via the `on` function. Any number of message names can be listened to. It's also possible to pass parameters to the message, such as the author's name and the content of the message received. Once the client receives a message, a new `div` element is created with the author's name and the message content in its `innerHTML` attribute. It's added to the main `div` element displaying the messages.
208+
SignalR enables the exchange of messages between a client and a server. Each message has a specific name. For example, messages with the name `messageReceived` can run the logic responsible for displaying the new message in the messages zone. Listening to a specific message can be done via the `on` function. Any number of message names can be listened to. It's also possible to pass parameters to the message, such as the author's name and the content of the message received. Once the client receives a message, a new `div` element is created with the author's name and message content appended as child elements using `textContent`. It's added to the main `div` element displaying the messages.
209209

210210
Sending a message through the WebSockets connection requires calling the `send` method. The method's first parameter is the message name. The message data inhabits the other parameters. In this example, a message identified as `newMessage` is sent to the server. The message consists of the username and the user input from a text box. If the send works, the text box value is cleared.
211211

aspnetcore/tutorials/signalr-typescript-webpack/includes/signalr-typescript-webpack2.1-5.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ The app currently displays a basic form to send messages, but isn't yet function
210210

211211
The preceding code supports receiving messages from the server. The `HubConnectionBuilder` class creates a new builder for configuring the server connection. The `withUrl` function configures the hub URL.
212212

213-
SignalR enables the exchange of messages between a client and a server. Each message has a specific name. For example, messages with the name `messageReceived` can run the logic responsible for displaying the new message in the messages zone. Listening to a specific message can be done via the `on` function. Any number of message names can be listened to. It's also possible to pass parameters to the message, such as the author's name and the content of the message received. Once the client receives a message, a new `div` element is created with the author's name and the message content in its `innerHTML` attribute. It's added to the main `div` element displaying the messages.
213+
SignalR enables the exchange of messages between a client and a server. Each message has a specific name. For example, messages with the name `messageReceived` can run the logic responsible for displaying the new message in the messages zone. Listening to a specific message can be done via the `on` function. Any number of message names can be listened to. It's also possible to pass parameters to the message, such as the author's name and the content of the message received. Once the client receives a message, a new `div` element is created with the author's name and message content appended as child elements using `textContent`. It's added to the main `div` element displaying the messages.
214214

215215
1. Now that the client can receive a message, configure it to send messages. Add the highlighted code to the `src/index.ts` file:
216216

@@ -465,7 +465,7 @@ The app currently displays a simple form to send messages. Nothing happens when
465465

466466
The preceding code supports receiving messages from the server. The `HubConnectionBuilder` class creates a new builder for configuring the server connection. The `withUrl` function configures the hub URL.
467467

468-
SignalR enables the exchange of messages between a client and a server. Each message has a specific name. For example, messages with the name `messageReceived` can run the logic responsible for displaying the new message in the messages zone. Listening to a specific message can be done via the `on` function. You can listen to any number of message names. It's also possible to pass parameters to the message, such as the author's name and the content of the message received. Once the client receives a message, a new `div` element is created with the author's name and the message content in its `innerHTML` attribute. The new message is added to the main `div` element displaying the messages.
468+
SignalR enables the exchange of messages between a client and a server. Each message has a specific name. For example, messages with the name `messageReceived` can run the logic responsible for displaying the new message in the messages zone. Listening to a specific message can be done via the `on` function. You can listen to any number of message names. It's also possible to pass parameters to the message, such as the author's name and the content of the message received. Once the client receives a message, a new `div` element is created with the author's name and message content appended as child elements using `textContent`. The new message is added to the main `div` element displaying the messages.
469469

470470
1. Now that the client can receive a message, configure it to send messages. Add the highlighted code to the `src/index.ts` file:
471471

aspnetcore/tutorials/signalr-typescript-webpack/includes/signalr-typescript-webpack6.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ In this section, you create a [Node.js](https://nodejs.org/) project to convert
177177

178178
The `HubConnectionBuilder` class creates a new builder for configuring the server connection. The `withUrl` function configures the hub URL.
179179

180-
SignalR enables the exchange of messages between a client and a server. Each message has a specific name. For example, messages with the name `messageReceived` can run the logic responsible for displaying the new message in the messages zone. Listening to a specific message can be done via the `on` function. Any number of message names can be listened to. It's also possible to pass parameters to the message, such as the author's name and the content of the message received. Once the client receives a message, a new `div` element is created with the author's name and the message content in its `innerHTML` attribute. It's added to the main `div` element displaying the messages.
180+
SignalR enables the exchange of messages between a client and a server. Each message has a specific name. For example, messages with the name `messageReceived` can run the logic responsible for displaying the new message in the messages zone. Listening to a specific message can be done via the `on` function. Any number of message names can be listened to. It's also possible to pass parameters to the message, such as the author's name and the content of the message received. Once the client receives a message, a new `div` element is created with the author's name and message content appended as child elements using `textContent`. It's added to the main `div` element displaying the messages.
181181

182182
Sending a message through the WebSockets connection requires calling the `send` method. The method's first parameter is the message name. The message data inhabits the other parameters. In this example, a message identified as `newMessage` is sent to the server. The message consists of the username and the user input from a text box. If the send works, the text box value is cleared.
183183

aspnetcore/tutorials/signalr-typescript-webpack/includes/signalr-typescript-webpack7.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ In this section, you create a [Node.js](https://nodejs.org/) project to convert
183183

184184
The `HubConnectionBuilder` class creates a new builder for configuring the server connection. The `withUrl` function configures the hub URL.
185185

186-
SignalR enables the exchange of messages between a client and a server. Each message has a specific name. For example, messages with the name `messageReceived` can run the logic responsible for displaying the new message in the messages zone. Listening to a specific message can be done via the `on` function. Any number of message names can be listened to. It's also possible to pass parameters to the message, such as the author's name and the content of the message received. Once the client receives a message, a new `div` element is created with the author's name and the message content in its `innerHTML` attribute. It's added to the main `div` element displaying the messages.
186+
SignalR enables the exchange of messages between a client and a server. Each message has a specific name. For example, messages with the name `messageReceived` can run the logic responsible for displaying the new message in the messages zone. Listening to a specific message can be done via the `on` function. Any number of message names can be listened to. It's also possible to pass parameters to the message, such as the author's name and the content of the message received. Once the client receives a message, a new `div` element is created with the author's name and message content appended as child elements using `textContent`. It's added to the main `div` element displaying the messages.
187187

188188
Sending a message through the WebSockets connection requires calling the `send` method. The method's first parameter is the message name. The message data inhabits the other parameters. In this example, a message identified as `newMessage` is sent to the server. The message consists of the username and the user input from a text box. If the send works, the text box value is cleared.
189189

aspnetcore/tutorials/signalr-typescript-webpack/includes/signalr-typescript-webpack8-9.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ In this section, you create a [Node.js](https://nodejs.org/) project to convert
185185

186186
The `HubConnectionBuilder` class creates a new builder for configuring the server connection. The `withUrl` function configures the hub URL.
187187

188-
SignalR enables the exchange of messages between a client and a server. Each message has a specific name. For example, messages with the name `messageReceived` can run the logic responsible for displaying the new message in the messages zone. Listening to a specific message can be done via the `on` function. Any number of message names can be listened to. It's also possible to pass parameters to the message, such as the author's name and the content of the message received. Once the client receives a message, a new `div` element is created with the author's name and the message content in its `innerHTML` attribute. It's added to the main `div` element displaying the messages.
188+
SignalR enables the exchange of messages between a client and a server. Each message has a specific name. For example, messages with the name `messageReceived` can run the logic responsible for displaying the new message in the messages zone. Listening to a specific message can be done via the `on` function. Any number of message names can be listened to. It's also possible to pass parameters to the message, such as the author's name and the content of the message received. Once the client receives a message, a new `div` element is created with the author's name and message content appended as child elements using `textContent`. It's added to the main `div` element displaying the messages.
189189

190190
Sending a message through the WebSockets connection requires calling the `send` method. The method's first parameter is the message name. The message data inhabits the other parameters. In this example, a message identified as `newMessage` is sent to the server. The message consists of the username and the user input from a text box. If the send works, the text box value is cleared.
191191

aspnetcore/tutorials/signalr-typescript-webpack/samples/10.x/src/index.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,14 @@ const connection = new signalR.HubConnectionBuilder()
1313
connection.on("messageReceived", (username: string, message: string) => {
1414
const m = document.createElement("div");
1515

16-
m.innerHTML = `<div class="message-author">${username}</div><div>${message}</div>`;
16+
const author = document.createElement("div");
17+
author.className = "message-author";
18+
author.textContent = username;
19+
20+
const content = document.createElement("div");
21+
content.textContent = message;
22+
23+
m.append(author, content);
1724

1825
divMessages.appendChild(m);
1926
divMessages.scrollTop = divMessages.scrollHeight;

aspnetcore/tutorials/signalr-typescript-webpack/samples/2.x/src/index.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,14 @@ const connection = new signalR.HubConnectionBuilder()
1313
connection.on("messageReceived", (username: string, message: string) => {
1414
let messageContainer = document.createElement("div");
1515

16-
messageContainer.innerHTML =
17-
`<div class="message-author">${username}</div><div>${message}</div>`;
16+
const author = document.createElement("div");
17+
author.className = "message-author";
18+
author.textContent = username;
19+
20+
const content = document.createElement("div");
21+
content.textContent = message;
22+
23+
messageContainer.append(author, content);
1824

1925
divMessages.appendChild(messageContainer);
2026
divMessages.scrollTop = divMessages.scrollHeight;

aspnetcore/tutorials/signalr-typescript-webpack/samples/3.x/src/index.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,14 @@ const connection = new signalR.HubConnectionBuilder()
1313
connection.on("messageReceived", (username: string, message: string) => {
1414
let messages = document.createElement("div");
1515

16-
messages.innerHTML =
17-
`<div class="message-author">${username}</div><div>${message}</div>`;
16+
const author = document.createElement("div");
17+
author.className = "message-author";
18+
author.textContent = username;
19+
20+
const content = document.createElement("div");
21+
content.textContent = message;
22+
23+
messages.append(author, content);
1824

1925
divMessages.appendChild(messages);
2026
divMessages.scrollTop = divMessages.scrollHeight;

aspnetcore/tutorials/signalr-typescript-webpack/samples_snapshot/2.x/index2.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,14 @@ const connection = new signalR.HubConnectionBuilder()
1313
connection.on("messageReceived", (username: string, message: string) => {
1414
let m = document.createElement("div");
1515

16-
m.innerHTML =
17-
`<div class="message-author">${username}</div><div>${message}</div>`;
16+
const author = document.createElement("div");
17+
author.className = "message-author";
18+
author.textContent = username;
19+
20+
const content = document.createElement("div");
21+
content.textContent = message;
22+
23+
m.append(author, content);
1824

1925
divMessages.appendChild(m);
2026
divMessages.scrollTop = divMessages.scrollHeight;

0 commit comments

Comments
 (0)