Skip to content

Commit f50963f

Browse files
committed
Update documentation
1 parent 9686e20 commit f50963f

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

Docs/README.MD

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
SSR.Net
33
============
44

5-
SSR.Net enables you to Server Side Render (SSR) components in React 17, React 18 and Vue 3 in .Net Framework/Core/5/6/7. It is open for extension and can support other frontend frameworks. It aims at being a performant, minimalistic way to support SSR in .Net.
5+
SSR.Net enables you to Server-Side Render (SSR) components in React 17, React 18 and Vue 3 in .Net Framework/Core/5/6/7. It is open for extension and can support other frontend frameworks. It aims at being a performant, minimalistic way to support SSR in .Net.
66

77
It is based on many of the ideas in ReactJS.Net: https://github.com/reactjs/React.NET.
88

@@ -140,7 +140,7 @@ namespace SSR.Net.DotNet6.Services
140140
}
141141
```
142142

143-
The code above adds both a server side polyfill named React18TextEncoderPolyfill.js (React 18 needs this, and it's missing in the Java Script Engine), and the bundle we created in [Building a JavaScript bundle fit for SSR](#Building-a-JavaScript-bundle-fit-for-SSR), react18example.js. These script files will be run on each server side JavaScript engine during initialization. This means that each JavaScript engine on the server side will be able to run React, ReactDOMServer, ReactDOMClient and access our FrontPage component through the global variable Components.
143+
The code above adds both a server-side polyfill named React18TextEncoderPolyfill.js (React 18 needs this, and it's missing in the Java Script Engine), and the bundle we created in [Building a JavaScript bundle fit for SSR](#Building-a-JavaScript-bundle-fit-for-SSR), react18example.js. These script files will be run on each server-side JavaScript engine during initialization. This means that each JavaScript engine on the server will be able to run React, ReactDOMServer, ReactDOMClient and access our FrontPage component through the global variable Components.
144144

145145
We use the V8 JavaScript engine in this example. This, and the scripts, is configured in a JavaScriptEnginePool. This pool will manage JavaScript engines, create new ones proactively, dispose exhausted engines and forward the rendering calls to the JavaScript engines.
146146

@@ -164,7 +164,7 @@ builder.Services.AddReact18Renderer(builder.Environment);
164164

165165
### Set up a controller and a view
166166

167-
To do the actual Server Side Rendering, we need to serialize props for the React component we want to Server Side Render and send the props as JSON to the React18Renderer, together with the component name. In this simplified example, we do this directly in the controller (https://github.com/knowit/SSR.Net/blob/main/src/SSR.Net.DotNet6/Controllers/HomeController.cs).
167+
To do the actual Server-Side Rendering, we need to serialize props for the React component we want to Server-Side Render and send the props as JSON to the React18Renderer, together with the component name. In this simplified example, we do this directly in the controller (https://github.com/knowit/SSR.Net/blob/main/src/SSR.Net.DotNet6/Controllers/HomeController.cs).
168168

169169
First, we inject the React18Renderer in the controller (some lines are removed for brevity and clarity):
170170

@@ -286,7 +286,7 @@ if (typeof window !== 'undefined')
286286
```
287287
* Global variables must not be used (except the ones described above for exposing objects to SSR.Net). Each JavaScript Engine is used multiple times, so global variables will cause state to be shared between requests, meaning data can leak from one user to another.
288288
* Some 3rd party packages may fail, if they use the window object or global variables.
289-
* SSR in React won't run useEffect hooks. So using the window object in a useEffect is safe. Also, if you have code that requires the window object and that doesn't contain markup that you need served from the server side, then you can defer rendering it until after the SSR has been performed:
289+
* SSR in React won't run useEffect hooks. So using the window object in a useEffect is safe. Also, if you have code that requires the window object and that doesn't contain markup that you need served from the server, then you can defer rendering it until after the SSR has been performed:
290290

291291
```
292292
const [initialized, setInitialized] = useState(false);

src/SSR.Net/Docs/README.MD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
SSR.Net
22
============
33

4-
SSR.Net makes it possible to server side render components in React 17, React 18 and Vue 3. It is open for extension, and can support other frameworks.
4+
SSR.Net makes it possible to Server-Side Render components in React 17, React 18 and Vue 3. It is open for extension, and can support other frameworks.
55

66
It is based on many of the ideas in ReactJS.Net: https://github.com/reactjs/React.NET
77

src/SSR.Net/SSR.Net.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
<PackageProjectUrl>https://github.com/knowit/SSR.Net</PackageProjectUrl>
1313
<RepositoryUrl>https://github.com/knowit/SSR.Net</RepositoryUrl>
1414
<PackageDescription>
15-
A package that performs Server Sider Rendering (SSR) for React17, React18 and Vue 3 using the JavaScriptEngineSwitcher.Core package.
15+
A package that performs Server-Sider Rendering (SSR) for React17, React18 and Vue 3 using the JavaScriptEngineSwitcher.Core package.
1616
Can be extended to support other frameworks and versions.
1717
</PackageDescription>
18-
<PackageTags>SSR; React; Vue; Server Side Rendering; JavaScriptEngineSwitcher; nodejs; javascript; js;</PackageTags>
18+
<PackageTags>SSR; React; Vue; Server-Side Rendering; JavaScriptEngineSwitcher; nodejs; javascript; js;</PackageTags>
1919
</PropertyGroup>
2020

2121
<PropertyGroup>

0 commit comments

Comments
 (0)