Skip to content

Commit fd5c649

Browse files
committed
Apply PR suggestions
1 parent 3fe07e5 commit fd5c649

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

docs/HOSTING.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
# Hosting
22

3-
Web Chat is versatile and can be hosted in many web app scenario.
3+
Web Chat is versatile and can be hosted in many web app scenarios.
44

5-
There are 3 steps to host Web Chat in a web app:
5+
There are three steps to host Web Chat in a web app:
66

77
1. [Importing code into the JavaScript environment](#step-1-importing-code)
88
1. [Constructing chat adapter](#step-2-constructing-chat-adapter)
99
1. [Rendering UI onto the page](#step-3-rendering-ui)
1010

11-
Each step provides multiple approaches to suit different development environments and requirements. These approaches can be mix and match to create a tailored solution for the scenario.
11+
Each step provides multiple approaches to suit different development environments and requirements. These approaches can be mixed and matched to create a tailored solution for the scenario.
1212

1313
## Step 1: Importing code
1414

15-
There are 3 ways to import the code:
15+
There are three ways to import the code:
1616

1717
- Pure HTML (bundler-less)
1818
- [Import via `<script type="importmap">`](#esm-import-via-script-typeimportmap)
@@ -67,7 +67,7 @@ Copy and paste the following code snippet into your HTML page. It imports React
6767
```
6868
</details>
6969

70-
Using an import map alongside a smart CDN service (such as, [esm.sh](https://esm.sh/) or [esm.run](https://esm.run/)) allows leveraging modern JavaScript features like lazy-loading and HTTP pipelining, enhancing performance and efficiency.
70+
Using an import map alongside a smart CDN service (such as, [esm.sh](https://esm.sh/) or [esm.run](https://esm.run/)) allows you to leverage modern JavaScript features like lazy-loading and HTTP pipelining, enhancing performance and efficiency.
7171

7272
#### Deploying Web Chat to a static web server or CDN
7373

@@ -85,7 +85,7 @@ Serving Web Chat code from your own service is recommended for these environment
8585

8686
#### React runtime version
8787

88-
For React web app, it is important to have all React components rendered with the same version and instance of React runtime.
88+
For React web apps, it is important to have all React components rendered with the same version and instance of the React runtime.
8989

9090
To choose between different version of React runtime, modify the import map and reference the version of your choice. React runtime must be loaded as ES Modules (ESM) instead of UMD. You may need to use a smart CDN service to load React runtime as ESM.
9191

@@ -151,7 +151,8 @@ React runtime can also be loaded from UMD (`globalThis.React` and `globalThis.Re
151151

152152
### (Deprecated) IIFE/UMD: Import via `<script>`
153153

154-
> Notes: this method is deprecated and is no longer recommended. Please [import via `<script type="importmap">`](#esm-import-via-script-typeimportmap) instead.
154+
> Note: This method is deprecated and is no longer recommended. Please [import via `<script type="importmap">`](#esm-import-via-script-typeimportmap) instead.
155+
>
155156
>
156157
> W3C and browser vendors introduced a modern approach to import JavaScript code into the browser environment. Compare to the traditional IIFE/UMD approach, ES Modules has zero pollution and more guardrails to prevent misuse.
157158
@@ -191,7 +192,7 @@ import { createDirectLine, ReactWebChat, renderWebChat } from 'botframework-webc
191192

192193
## Step 2: Constructing chat adapter
193194

194-
> Notes: Web Chat is a UI component, does not contains any network code, and is not responsible for communicating with the chat service. Web Chat render the messages (a.k.a. activities) provided by the chat adapter.
195+
> Note: Web Chat is a UI component, does not contains any network code, and is not responsible for communicating with the chat service. Web Chat render the messages (a.k.a. activities) provided by the chat adapter.
195196
196197
Chat adapter is an intermediate component which bridge between Web Chat and the underlying chat service.
197198

@@ -201,7 +202,7 @@ By using different chat adapter, Web Chat can connect to different chat service.
201202

202203
The chat adapter for Azure Bot Services (Direct Line) is bundled into Web Chat. A Direct Line token is required to establish the connection with Azure Bot Services. [This article](https://learn.microsoft.com/en-us/azure/bot-service/rest-api/bot-framework-rest-direct-line-3-0-authentication?view=azure-bot-service-4.0#generate-a-direct-line-token) contains instructions on generating and renew a Direct Line token.
203204

204-
> Notes: the Direct Line token is the key to the conversation, which could contains user data. Please protect the token with great care.
205+
> Note: the Direct Line token is the key to the conversation, which could contains user data. Please protect the token with great care.
205206
206207
```tsx
207208
const directLine = createDirectLine({ token: '<direct-line-token>' });
@@ -211,7 +212,7 @@ const directLine = createDirectLine({ token: '<direct-line-token>' });
211212

212213
After Web Chat is loaded and chat adapter instance is constructed, the last step is to render Web Chat on the page.
213214

214-
> Notes: code snippets below assumes the chat adapter instance is stored in the `directLine` constant.
215+
> Note: Code snippets below assume the chat adapter instance is stored in the `directLine` constant.
215216
216217
### Using `renderWebChat()` (no React prior experience)
217218

@@ -229,7 +230,7 @@ Then, run the following JavaScript code to render Web Chat into the placeholder.
229230
renderWebChat({ directLine }, document.getElementById('webchat'));
230231
```
231232

232-
> Notes: `renderWebChat()` is a simple wrapper around `render()` function in React DOM.
233+
> Note: The `renderWebChat()` function is a simple wrapper around `render()` function in React DOM.
233234
234235
### Using `<ReactWebChat>` component
235236

0 commit comments

Comments
 (0)