Skip to content

Commit

Permalink
Merge to Live (#33289)
Browse files Browse the repository at this point in the history
* Use correct example for applying multiple policies to MVC controllers (#33285)

* Grammar updates (#33291)

* Add timezone code/data control coverage (#33293)

* Update quest-config.json (#33286)

---------

Co-authored-by: Kaarel <[email protected]>
Co-authored-by: Luke Latham <[email protected]>
Co-authored-by: Andy (Steve) De George <[email protected]>
  • Loading branch information
4 people authored Aug 8, 2024
1 parent 79c45a8 commit 350b025
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 10 deletions.
35 changes: 34 additions & 1 deletion aspnetcore/blazor/globalization-localization.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ Loading a custom subset of locales in a Blazor WebAssembly app is supported in .

## Invariant globalization

If the app doesn't require localization, configure the app to support the invariant culture, which is generally based on United States English (`en-US`). Set the `InvariantGlobalization` property to `true` in the app's project file (`.csproj`):
*This section only applies to client-side Blazor scenarios.*

If the app doesn't require localization, configure the app to support the invariant culture, which is generally based on United States English (`en-US`). Using invariant globalization reduces the app's download size and results in faster app startup. Set the `InvariantGlobalization` property to `true` in the app's project file (`.csproj`):

```xml
<PropertyGroup>
Expand Down Expand Up @@ -124,6 +126,37 @@ Alternatively, configure invariant globalization with the following approaches:

For more information, see [Runtime configuration options for globalization (.NET documentation)](/dotnet/core/run-time-config/globalization).

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

## Timezone information

*This section only applies to client-side Blazor scenarios.*

Adopting [invariant globalization](#invariant-globalization) only results in using non-localized timezone names. To trim timezone code and data, which reduces the app's download size and results in faster app startup, apply the `<InvariantTimezone>` MSBuild property with a value of `true` in the app's project file:

```xml
<PropertyGroup>
<InvariantTimezone>true</InvariantTimezone>
</PropertyGroup>
```

> [!NOTE]
> [`<BlazorEnableTimeZoneSupport>`](xref:blazor/performance#disable-unused-features) overrides an earlier `<InvariantTimezone>` setting. We recommend removing the `<BlazorEnableTimeZoneSupport>` setting.
:::moniker-end

:::moniker range="< aspnetcore-8.0"

A data file is included to make timezone information correct. If the app doesn't require this feature, consider disabling it by setting the `<BlazorEnableTimeZoneSupport>` MSBuild property to `false` in the app's project file:

```xml
<PropertyGroup>
<BlazorEnableTimeZoneSupport>false</BlazorEnableTimeZoneSupport>
</PropertyGroup>
```

:::moniker-end

## Demonstration component

The following `CultureExample1` component can be used to demonstrate Blazor globalization and localization concepts covered by this article.
Expand Down
31 changes: 25 additions & 6 deletions aspnetcore/blazor/performance.md
Original file line number Diff line number Diff line change
Expand Up @@ -766,7 +766,7 @@ For migration guidance, see [How to migrate from `Newtonsoft.Json` to `System.Te

### Intermediate Language (IL) trimming

*This section only applies to Blazor WebAssembly apps.*
*This section only applies to client-side Blazor scenarios.*

:::moniker range=">= aspnetcore-5.0"

Expand All @@ -786,7 +786,7 @@ dotnet publish -c Release

### Lazy load assemblies

*This section only applies to Blazor WebAssembly apps.*
*This section only applies to client-side Blazor scenarios.*

Load assemblies at runtime when the assemblies are required by a route. For more information, see <xref:blazor/webassembly-lazy-load-assemblies>.

Expand All @@ -800,18 +800,39 @@ After an app is deployed, verify that the app serves compressed files. Inspect t

### Disable unused features

*This section only applies to Blazor WebAssembly apps.*
*This section only applies to client-side Blazor scenarios.*

Blazor WebAssembly's runtime includes the following .NET features that can be disabled for a smaller payload size:

* A data file is included to make timezone information correct. If the app doesn't require this feature, consider disabling it by setting the `BlazorEnableTimeZoneSupport` MSBuild property in the app's project file to `false`:
* By default, Blazor WebAssembly carries globalization resources required to display values, such as dates and currency, in the user's culture. If the app doesn't require localization, you may [configure the app to support the invariant culture](xref:blazor/globalization-localization#invariant-globalization), which is based on the `en-US` culture.

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

* Adopting [invariant globalization](xref:blazor/globalization-localization#invariant-globalization) only results in using non-localized timezone names. To trim timezone code and data from the app, apply the `<InvariantTimezone>` MSBuild property with a value of `true` in the app's project file:

```xml
<PropertyGroup>
<InvariantTimezone>true</InvariantTimezone>
</PropertyGroup>
```

> [!NOTE]
> [`<BlazorEnableTimeZoneSupport>`](xref:blazor/performance#disable-unused-features) overrides an earlier `<InvariantTimezone>` setting. We recommend removing the `<BlazorEnableTimeZoneSupport>` setting.
:::moniker-end

:::moniker range="< aspnetcore-8.0"

* A data file is included to make timezone information correct. If the app doesn't require this feature, consider disabling it by setting the `<BlazorEnableTimeZoneSupport>` MSBuild property to `false` in the app's project file:

```xml
<PropertyGroup>
<BlazorEnableTimeZoneSupport>false</BlazorEnableTimeZoneSupport>
</PropertyGroup>
```

:::moniker-end

:::moniker range="< aspnetcore-5.0"

* Collation information is included to make APIs such as <xref:System.StringComparison.InvariantCultureIgnoreCase?displayProperty=nameWithType> work correctly. If you're certain that the app doesn't require the collation data, consider disabling it by setting the `BlazorWebAssemblyPreserveCollationData` MSBuild property in the app's project file to `false`:
Expand All @@ -823,5 +844,3 @@ Blazor WebAssembly's runtime includes the following .NET features that can be di
```

:::moniker-end

* By default, Blazor WebAssembly carries globalization resources required to display values, such as dates and currency, in the user's culture. If the app doesn't require localization, you may [configure the app to support the invariant culture](xref:blazor/globalization-localization#invariant-globalization), which is based on the `en-US` culture.
2 changes: 1 addition & 1 deletion aspnetcore/client-side/bundling-and-minification.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ This article explains the benefits of applying bundling and minification, includ

Bundling and minification are two distinct performance optimizations you can apply in a web app. Used together, bundling and minification improve performance by reducing the number of server requests and reducing the size of the requested static assets.

Bundling and minification primarily improve the first page request load time. Once a web page has been requested, the browser caches the static assets (JavaScript, CSS, and images). So, bundling and minification don't improve performance when requesting the same page, or pages, on the same site requesting the same assets. If the expires header isn't set correctly on the assets and if bundling and minification isn't used, the browser's freshness heuristics mark the assets stale after a few days. Additionally, the browser requires a validation request for each asset. In this case, bundling and minification provide a performance improvement even after the first page request.
Bundling and minification primarily improve the first page request load time. Once a web page has been requested, the browser caches the static assets (JavaScript, CSS, and images). So, bundling and minification don't improve performance when requesting the same page, or pages, on the same site requesting the same assets. If the expires header isn't set correctly on the assets and if bundling and minification aren't used, the browser's freshness heuristics mark the assets stale after a few days. Additionally, the browser requires a validation request for each asset. In this case, bundling and minification provide a performance improvement even after the first page request.

### Bundling

Expand Down
2 changes: 1 addition & 1 deletion aspnetcore/client-side/dotnet-interop.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ The following is an example project file (`.csproj`) after configuration. The `{
* Specify `WasmMainJSPath` to point to a file on disk. This file is published with the app, but use of the file isn't required if you're integrating .NET into an existing JS app.

In the following example, the JS file on disk is `main.js`, but any JS filename is permissable:
In the following example, the JS file on disk is `main.js`, but any JS filename is permissible:

```xml
<WasmMainJSPath>main.js</WasmMainJSPath>
Expand Down
2 changes: 1 addition & 1 deletion aspnetcore/security/authorization/policies.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ Apply policies to controllers by using the `[Authorize]` attribute with the poli

If multiple policies are applied at the controller and action levels, ***all*** policies must pass before access is granted:

:::code language="csharp" source="~/security/authorization/policies/samples/6.0/AuthorizationPoliciesSample/Controllers/AtLeast21Controller.cs" id="snippet" highlight="1,4":::
:::code language="csharp" source="~/security/authorization/policies/samples/6.0/AuthorizationPoliciesSample/Controllers/AtLeast21Controller2.cs" id="snippet" highlight="1,4":::

## Apply policies to Razor Pages

Expand Down
4 changes: 4 additions & 0 deletions quest-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@
{
"Label": "sfi-admin",
"ParentNodeId": 271716
},
{
"Label": "sfi-images",
"ParentNodeId": 286370
}
],
"DefaultParentNode": 227486,
Expand Down

0 comments on commit 350b025

Please sign in to comment.