Skip to content

Commit 6586901

Browse files
committed
Additional Blazor script coverage and fix comments
1 parent 7b441ae commit 6586901

File tree

3 files changed

+26
-8
lines changed

3 files changed

+26
-8
lines changed

aspnetcore/blazor/components/integration.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,12 @@ To support routable Razor components in Razor Pages apps:
179179

180180
> [!NOTE]
181181
> The preceding example assumes that the <xref:Microsoft.AspNetCore.Components.Web.HeadOutlet> component and Blazor script (`_framework/blazor.server.js`) are rendered by the app's layout. For more information, see the [Configuration](#configuration) section.
182+
>
183+
> In .NET 10 or later, the Blazor script is included by the framework if the project contains at least one Razor component file (`.razor`). If your app requires the Blazor script but doesn't contain at least one component, add the following MSBuild property to the app's project file to force unconditional script inclusion:
184+
>
185+
> ```xml
186+
> <RequiresAspNetWebAssets>true</RequiresAspNetWebAssets>
187+
> ```
182188
183189
<xref:Microsoft.AspNetCore.Mvc.Rendering.RenderMode> configures whether the `App` component:
184190
@@ -260,6 +266,12 @@ To support routable Razor components in MVC apps:
260266

261267
> [!NOTE]
262268
> The preceding example assumes that the <xref:Microsoft.AspNetCore.Components.Web.HeadOutlet> component and Blazor script (`_framework/blazor.server.js`) are rendered by the app's layout. For more information, see the [Configuration](#configuration) section.
269+
>
270+
> In .NET 10 or later, the Blazor script is included by the framework if the project contains at least one Razor component file (`.razor`). If your app requires the Blazor script but doesn't contain at least one component, add the following MSBuild property to the app's project file to force unconditional script inclusion:
271+
>
272+
> ```xml
273+
> <RequiresAspNetWebAssets>true</RequiresAspNetWebAssets>
274+
> ```
263275
264276
<xref:Microsoft.AspNetCore.Mvc.Rendering.RenderMode> configures whether the `App` component:
265277

aspnetcore/blazor/project-structure.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,11 @@ The `Components/Pages` folder of the server project contains the app's routable
7070
Add the angle brackets around the cross-link when
7171
activating.
7272
73-
:::moniker range=">= aspnetcore-10.0"
73+
moniker range=">= aspnetcore-10.0"
7474
7575
The `NotFound` component (`NotFound.razor`) implements a Not Found page to display when content isn't found for a request path. For more information, see xref:blazor/fundamentals/navigation#not-found-responses.
7676
77-
:::moniker-end
77+
moniker-end
7878
7979
-->
8080

@@ -332,19 +332,19 @@ Project structure:
332332
Add the angle brackets around the cross-link when
333333
activating.
334334
335-
:::moniker-end
335+
moniker-end
336336
337-
:::moniker range=">= aspnetcore-10.0"
337+
moniker range=">= aspnetcore-10.0"
338338
339339
* `Pages` folder: Contains the Blazor app's routable Razor components (`.razor`). The route for each page is specified using the [`@page`](xref:mvc/views/razor#page) directive. The template includes the following components:
340340
* `Counter` component (`Counter.razor`): Implements the Counter page.
341341
* `Index` component (`Index.razor`): Implements the Home page.
342342
* `Weather` component (`Weather.razor`): Implements the Weather page.
343343
* `NotFound` component (`NotFound.razor`) Implements a Not Found page to display when content isn't found for a request path. For more information, see xref:blazor/fundamentals/navigation#not-found-responses.
344344
345-
:::moniker-end
345+
moniker-end
346346
347-
:::moniker range=">= aspnetcore-8.0 < aspnetcore-10.0"
347+
moniker range=">= aspnetcore-8.0 < aspnetcore-10.0"
348348
349349
-->
350350

@@ -357,9 +357,9 @@ Project structure:
357357
https://github.com/dotnet/AspNetCore.Docs/pull/36145
358358
is merged.
359359
360-
:::moniker-end
360+
moniker-end
361361
362-
:::moniker range=">= aspnetcore-8.0"
362+
moniker range=">= aspnetcore-8.0"
363363
364364
-->
365365

aspnetcore/release-notes/aspnetcore-10/includes/blazor.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ For more information, see <xref:blazor/components/quickgrid?view=aspnetcore-10.0
3636

3737
In prior releases of .NET, the Blazor script is served from an embedded resource in the ASP.NET Core shared framework. In .NET 10 or later, the Blazor script is served as a static web asset with automatic compression and fingerprinting.
3838

39+
The Blazor script (`blazor.web.js` or `blazor.server.js`) is included by the framework if the project contains at least one Razor component file (`.razor`). If your app requires the Blazor script but doesn't contain at least one component, add the following MSBuild property to the app's project file to force unconditional script inclusion:
40+
41+
```xml
42+
<RequiresAspNetWebAssets>true</RequiresAspNetWebAssets>
43+
```
44+
3945
For more information, see the following resources:
4046

4147
* <xref:blazor/project-structure?view=aspnetcore-10.0#location-of-the-blazor-script>

0 commit comments

Comments
 (0)