Skip to content

Commit 76f3d6f

Browse files
Merge branch 'main' into 10/metrics/1
2 parents 9540879 + 786bccc commit 76f3d6f

File tree

127 files changed

+1811
-1359
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

127 files changed

+1811
-1359
lines changed

.github/ISSUE_TEMPLATE/doc-request.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ about: Request a new topic to help us improve
55

66
**Help us make content visible**
77

8-
- Tell us what search terms you used and how you searched docs.
9-
- Tell us what docs you found that didn't address your concern.
8+
* Tell us what search terms you used and how you searched docs.
9+
* Tell us what docs you found that didn't address your concern.
1010

1111
**Describe the new topic**
1212

13-
- Explain why this topic is needed.
14-
- Suggest a location in the Table of Contents.
15-
- Write an abstract. In one **short** paragraph, describe what this topic will cover.
16-
- Create an outline for the new topic. We'll help review the outline and approve it before anyone writes a topic.
13+
* Explain why this topic is needed.
14+
* Suggest a location in the Table of Contents.
15+
* Write an abstract. In one **short** paragraph, describe what this topic will cover.
16+
* Create an outline for the new topic. We'll help review the outline and approve it before anyone writes a topic.

.openpublishing.redirection.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1387,6 +1387,16 @@
13871387
"source_path": "aspnetcore/blazor/host-and-deploy/server.md",
13881388
"redirect_url": "/aspnet/core/blazor/host-and-deploy/server/",
13891389
"redirect_document_id": false
1390+
},
1391+
{
1392+
"source_path": "aspnetcore/blazor/host-and-deploy/webassembly/runtime-and-app-bundle-caching.md",
1393+
"redirect_url": "/aspnet/core/blazor/host-and-deploy/webassembly/bundle-caching-and-integrity-check-failures",
1394+
"redirect_document_id": false
1395+
},
1396+
{
1397+
"source_path": "aspnetcore/blazor/host-and-deploy/webassembly/integrity-check-failures.md",
1398+
"redirect_url": "/aspnet/core/blazor/host-and-deploy/webassembly/bundle-caching-and-integrity-check-failures",
1399+
"redirect_document_id": false
13901400
}
13911401
]
13921402
}

aspnetcore/blazor/components/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1071,14 +1071,14 @@ For more information, see <xref:mvc/views/razor>.
10711071
> [!WARNING]
10721072
> Providing initial values for component parameters is supported, but don't create a component that writes to its own parameters after the component is rendered for the first time. For more information, see <xref:blazor/components/overwriting-parameters>.
10731073
1074-
Component parameters should be declared as *auto-properties*, meaning that they shouldn't contain custom logic in their `get` or `set` accessors. For example, the following `StartData` property is an auto-property:
1074+
Component parameters should be declared as [automatically-implemented properties (*auto properties*)](/dotnet/csharp/programming-guide/classes-and-structs/auto-implemented-properties), meaning that they shouldn't contain custom logic in their `get` or `set` accessors. For example, the following `StartData` property is an auto property:
10751075

10761076
```csharp
10771077
[Parameter]
10781078
public DateTime StartData { get; set; }
10791079
```
10801080

1081-
Don't place custom logic in the `get` or `set` accessor because component parameters are purely intended for use as a channel for a parent component to flow information to a child component. If a `set` accessor of a child component property contains logic that causes rerendering of the parent component, an infinite rendering loop results.
1081+
Don't place custom logic in the `get` or `set` accessor because component parameters are purely intended for use as a channel for a parent component to flow information to a child component. If a `set` accessor of a child component property contains logic that causes rerendering of the parent component, an infinite rendering loop results. Other side effects include unexpected extra renderings and parameter value overwrites.
10821082

10831083
To transform a received parameter value:
10841084

aspnetcore/blazor/components/lifecycle.md

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -828,6 +828,80 @@ In the following example:
828828

829829
:::moniker-end
830830

831+
To display a loading indicator while the background work is taking place, use the following approach.
832+
833+
Create a loading indicator component with a `Loading` parameter that can display child content in a <xref:Microsoft.AspNetCore.Components.RenderFragment>. For the `Loading` parameter:
834+
835+
* When `true`, display a loading indicator.
836+
* When `false`, render the component's content (`ChildContent`). For more information, see [Child content render fragments](xref:blazor/components/index#child-content-render-fragments).
837+
838+
`ContentLoading.razor`:
839+
840+
```razor
841+
@if (Loading)
842+
{
843+
<progress id="loadingIndicator" aria-label="Content loading…"></progress>
844+
}
845+
else
846+
{
847+
@ChildContent
848+
}
849+
850+
@code {
851+
[Parameter]
852+
public RenderFragment? ChildContent { get; set; }
853+
854+
[Parameter]
855+
public bool Loading { get; set; }
856+
}
857+
```
858+
859+
:::moniker range=">= aspnetcore-6.0"
860+
861+
To load CSS styles for the indicator, add the styles to `<head>` content with the <xref:Microsoft.AspNetCore.Components.Web.HeadContent> component. For more information, see <xref:blazor/components/control-head-content>.
862+
863+
```razor
864+
@if (Loading)
865+
{
866+
<!-- OPTIONAL ...
867+
<HeadContent>
868+
<style>
869+
...
870+
</style>
871+
</HeadContent>
872+
-->
873+
<progress id="loadingIndicator" aria-label="Content loading…"></progress>
874+
}
875+
else
876+
{
877+
@ChildContent
878+
}
879+
880+
...
881+
```
882+
883+
:::moniker-end
884+
885+
Wrap the component's Razor markup with the `ContentLoading` component and pass a value in a C# field to the `Loading` parameter when initialization work is performed by the component:
886+
887+
```razor
888+
<ContentLoading Loading="@loading">
889+
...
890+
</ContentLoading>
891+
892+
@code {
893+
private bool loading = true;
894+
...
895+
896+
protected override async Task OnInitializedAsync()
897+
{
898+
await LongRunningWork().ContinueWith(_ => loading = false);
899+
}
900+
901+
...
902+
}
903+
```
904+
831905
## Blazor Server reconnection events
832906

833907
The component lifecycle events covered in this article operate separately from [server-side reconnection event handlers](xref:blazor/fundamentals/signalr#reflect-the-server-side-connection-state-in-the-ui). When the SignalR connection to the client is lost, only UI updates are interrupted. UI updates are resumed when the connection is re-established. For more information on circuit handler events and configuration, see <xref:blazor/fundamentals/signalr>.

aspnetcore/blazor/components/rendering.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,4 +326,4 @@ The state manager approach is similar to the earlier case with <xref:System.Time
326326
<!-- UPDATE 10.0 Will be removed for a new feature in this area.
327327
Tracked by: https://github.com/dotnet/aspnetcore/issues/49056 -->
328328

329-
A loading progress indicator isn't present in an app created from the Blazor Web App project template. A new loading progress indicator feature is planned for a future release of .NET. In the meantime, an app can adopt custom code to create a loading progress indicator. For more information, see <xref:blazor/fundamentals/startup#client-side-loading-progress-indicators>.
329+
A loading progress indicator isn't present in an app created from the Blazor Web App project template. A new loading progress indicator feature is planned for a future release of .NET. In the meantime, an app can adopt custom code to create a loading progress indicator. For more information, see <xref:blazor/fundamentals/startup#client-side-loading-indicators>.

aspnetcore/blazor/fundamentals/routing.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1056,6 +1056,7 @@ Navigation.GetUriWithQueryParameters("{URI}", {PARAMETERS})
10561056
Supported types are identical to supported types for route constraints:
10571057

10581058
* `bool`
1059+
* `DateOnly`
10591060
* `DateTime`
10601061
* `decimal`
10611062
* `double`
@@ -1064,6 +1065,7 @@ Supported types are identical to supported types for route constraints:
10641065
* `int`
10651066
* `long`
10661067
* `string`
1068+
* `TimeOnly`
10671069

10681070
Supported types include:
10691071

0 commit comments

Comments
 (0)