Skip to content

Commit 7f2377e

Browse files
authored
Merge pull request #35352 from dotnet/main
2 parents fba6a36 + 70c24cd commit 7f2377e

39 files changed

Lines changed: 771 additions & 304 deletions

.openpublishing.redirection.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1397,6 +1397,11 @@
13971397
"source_path": "aspnetcore/blazor/host-and-deploy/webassembly/integrity-check-failures.md",
13981398
"redirect_url": "/aspnet/core/blazor/host-and-deploy/webassembly/bundle-caching-and-integrity-check-failures",
13991399
"redirect_document_id": false
1400+
},
1401+
{
1402+
"source_path": "aspnetcore/blazor/performance.md",
1403+
"redirect_url": "/aspnet/core/blazor/performance/",
1404+
"redirect_document_id": false
14001405
}
14011406
]
14021407
}

aspnetcore/blazor/components/event-handling.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,7 @@ It's often convenient to close over additional values using C# method parameters
580580

581581
:::moniker-end
582582

583-
Creating a large number of event delegates in a loop may cause poor rendering performance. For more information, see <xref:blazor/performance#avoid-recreating-delegates-for-many-repeated-elements-or-components>.
583+
Creating a large number of event delegates in a loop may cause poor rendering performance. For more information, see <xref:blazor/performance/rendering#avoid-recreating-delegates-for-many-repeated-elements-or-components>.
584584

585585
Avoid using a loop variable directly in a lambda expression, such as `i` in the preceding `for` loop example. Otherwise, the same variable is used by all lambda expressions, which results in use of the same value in all lambdas. Capture the variable's value in a local variable. In the preceding example:
586586

aspnetcore/blazor/components/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1392,7 +1392,7 @@ You can factor out child components purely as a way of reusing rendering logic.
13921392
}
13931393
```
13941394

1395-
For more information, see [Reuse rendering logic](xref:blazor/performance#define-reusable-renderfragments-in-code).
1395+
For more information, see [Reuse rendering logic](xref:blazor/performance/rendering#define-reusable-renderfragments-in-code).
13961396

13971397
## Loop variables with component parameters and child content
13981398

aspnetcore/blazor/components/lifecycle.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ If a disposable component doesn't use a <xref:System.Threading.CancellationToken
326326

327327
For more information on route parameters and constraints, see <xref:blazor/fundamentals/routing>.
328328

329-
For an example of implementing `SetParametersAsync` manually to improve performance in some scenarios, see <xref:blazor/performance#implement-setparametersasync-manually>.
329+
For an example of implementing `SetParametersAsync` manually to improve performance in some scenarios, see <xref:blazor/performance/rendering#implement-setparametersasync-manually>.
330330

331331
## After component render (`OnAfterRender{Async}`)
332332

aspnetcore/blazor/components/prerender.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ In the following example that serializes state for multiple components of the sa
199199
}
200200
```
201201

202-
In the following example that serializes state for a service:
202+
In the following example that serializes state for a dependency injection service:
203203

204204
* Properties annotated with the `[SupplyParameterFromPersistentComponentState]` attribute are serialized during prerendering and deserialized when the app becomes interactive.
205205
* The `AddPersistentService` method is used to register the service for persistence. The render mode is required because the render mode can't be inferred from the service type. Use any of the following values:
@@ -211,6 +211,8 @@ In the following example that serializes state for a service:
211211
> [!NOTE]
212212
> Only persisting scoped services is supported.
213213
214+
<!-- UPDATE 10.0 - Flesh out with a fully-working example. -->
215+
214216
`CounterService.cs`:
215217

216218
```csharp

aspnetcore/blazor/components/rendering.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Components inherited from <xref:Microsoft.AspNetCore.Components.ComponentBase> s
3939

4040
In most cases, <xref:Microsoft.AspNetCore.Components.ComponentBase> conventions result in the correct subset of component rerenders after an event occurs. Developers aren't usually required to provide manual logic to tell the framework which components to rerender and when to rerender them. The overall effect of the framework's conventions is that the component receiving an event rerenders itself, which recursively triggers rerendering of descendant components whose parameter values may have changed.
4141

42-
For more information on the performance implications of the framework's conventions and how to optimize an app's component hierarchy for rendering, see <xref:blazor/performance#optimize-rendering-speed>.
42+
For more information on the performance implications of the framework's conventions and how to optimize an app's component hierarchy for rendering, see <xref:blazor/performance/rendering>.
4343

4444
::: moniker range=">= aspnetcore-8.0"
4545

@@ -147,7 +147,7 @@ Even if <xref:Microsoft.AspNetCore.Components.ComponentBase.ShouldRender%2A> is
147147

148148
::: moniker-end
149149

150-
For more information on performance best practices pertaining to <xref:Microsoft.AspNetCore.Components.ComponentBase.ShouldRender%2A>, see <xref:blazor/performance#avoid-unnecessary-rendering-of-component-subtrees>.
150+
For more information on performance best practices pertaining to <xref:Microsoft.AspNetCore.Components.ComponentBase.ShouldRender%2A>, see <xref:blazor/performance/rendering#avoid-unnecessary-rendering-of-component-subtrees>.
151151

152152
## `StateHasChanged`
153153

aspnetcore/blazor/components/templated-components.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,6 @@ Without using the `@key` directive attribute in the `TableTemplate` component, t
329329

330330
## Additional resources
331331

332-
* <xref:blazor/performance#define-reusable-renderfragments-in-code>
332+
* <xref:blazor/performance/rendering#define-reusable-renderfragments-in-code>
333333
* <xref:blazor/components/key>
334334
* [Blazor samples GitHub repository (`dotnet/blazor-samples`)](https://github.com/dotnet/blazor-samples) ([how to download](xref:blazor/fundamentals/index#sample-apps))

aspnetcore/blazor/fundamentals/static-files.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,9 +240,15 @@ In the project file (`.csproj`), the `<WriteImportMapToHtml>` property is set to
240240

241241
When resolving imports for JavaScript interop, the import map is used by the browser resolve fingerprinted files.
242242

243+
Any script in `index.html` with the fingerprint marker is fingerprinted by the framework. For example, a script file named `scripts.js` in the app's `wwwroot/js` folder is fingerprinted by adding `#[.{fingerprint}]` before the file extension (`.js`):
244+
245+
```html
246+
<script src="js/scripts#[.{fingerprint}].js"></script>
247+
```
248+
243249
## Fingerprint client-side static assets in Blazor Web Apps
244250

245-
For client-side rendering (CSR) in Blazor Web Apps (Interactive Auto or Interactive WebAssembly render modes), static asset server-side [fingerprinting](https://wikipedia.org/wiki/Fingerprint_(computing)) is enabled by adopting [Map Static Assets routing endpoint conventions (`MapStaticAssets`)](xref:fundamentals/map-static-files), [`ImportMap` component](xref:blazor/fundamentals/static-files#importmap-component), and the <xref:Microsoft.AspNetCore.Components.ComponentBase.Assets?displayProperty=nameWithType> property (`@Assets["..."]`).
251+
For client-side rendering (CSR) in Blazor Web Apps (Interactive Auto or Interactive WebAssembly render modes), static asset server-side [fingerprinting](https://wikipedia.org/wiki/Fingerprint_(computing)) is enabled by adopting [Map Static Assets routing endpoint conventions (`MapStaticAssets`)](xref:fundamentals/map-static-files), [`ImportMap` component](xref:blazor/fundamentals/static-files#importmap-component), and the <xref:Microsoft.AspNetCore.Components.ComponentBase.Assets?displayProperty=nameWithType> property (`@Assets["..."]`). For more information, see <xref:fundamentals/map-static-files>.
246252

247253
To fingerprint additional JavaScript modules for CSR, use the `<StaticWebAssetFingerprintPattern>` item in the app's project file (`.csproj`). In the following example, a fingerprint is added for all developer-supplied `.mjs` files in the app:
248254

aspnetcore/blazor/globalization-localization.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ Adopting [invariant globalization](#invariant-globalization) only results in usi
143143
```
144144

145145
> [!NOTE]
146-
> [`<BlazorEnableTimeZoneSupport>`](xref:blazor/performance#disable-unused-features) overrides an earlier `<InvariantTimezone>` setting. We recommend removing the `<BlazorEnableTimeZoneSupport>` setting.
146+
> [`<BlazorEnableTimeZoneSupport>`](xref:blazor/performance/app-download-size#disable-unused-features) overrides an earlier `<InvariantTimezone>` setting. We recommend removing the `<BlazorEnableTimeZoneSupport>` setting.
147147
148148
:::moniker-end
149149

aspnetcore/blazor/host-and-deploy/configure-linker.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,4 +119,4 @@ For more information, see [I18N: Pnetlib Internationalization Framework Library
119119

120120
## Additional resources
121121

122-
* <xref:blazor/performance#intermediate-language-il-linking>
122+
<xref:blazor/performance/app-download-size#intermediate-language-il-linking>

0 commit comments

Comments
 (0)