Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
4e57d1b
Merged PR 9371: Revive support for globalization and localization in …
Jul 28, 2020
8a8a1ac
Fixups
pranavkm Aug 17, 2020
58a7592
HTTP2: Optimize header processing (#24945)
JamesNK Aug 18, 2020
512a49c
Add support for model binding DateTime as UTC (#24893)
pranavkm Aug 18, 2020
c92eaa2
Add inline scheduler option for Sockets transport (#24638)
BrennanConroy Aug 18, 2020
28dc9bf
HTTP2: Write data and trailers under one lock (#24822)
JamesNK Aug 18, 2020
592cea6
Optimize writing single segment sequences (#24929)
JamesNK Aug 18, 2020
f68f5b0
Fix HTTP/2 tests that use HttpClient and H2C (#24981)
JamesNK Aug 18, 2020
2ad1b6d
Merged PR 9371: Revive support for globalization and localization in …
pranavkm Aug 18, 2020
cdb3cbd
Remove \r\n for \n when writing to ostream (#24980)
jkotalik Aug 18, 2020
90408c0
Move the code sync action to the release branch (#25003)
Tratcher Aug 18, 2020
5297d5f
Add query param to check if Blazor WASM app is under debug (#24972)
captainsafia Aug 18, 2020
edf25b7
HTTP method matching: Jump table optimized for a single method (#24953)
JamesNK Aug 18, 2020
bc40f40
Log for SameSite=None without Secure (#24970)
Tratcher Aug 18, 2020
ae1981f
Sync shared code from runtime (#25009)
github-actions[bot] Aug 18, 2020
94e314d
Helix pass in -nopath for dotnet-install (#24968)
HaoK Aug 17, 2020
2d6fd45
Allow ProblemDetails \ ValidationProblemDetails to be more testable
pranavkm Aug 17, 2020
24f26e7
React to runtime release branch rename (#25026)
Tratcher Aug 19, 2020
6a3887a
Make Virtualize behave correctly with when ItemSize is unspecified or…
MackinnonBuck Aug 19, 2020
38563dd
[Blazor][Identity] Update to the latest identity server version (#25002)
javiercn Aug 19, 2020
32ea27c
Merge branch 'master' into merge/release/5.0-to-master
Tratcher Aug 19, 2020
32b1e27
Update Version.Details.xml
Tratcher Aug 19, 2020
333d009
Update Versions.props
Tratcher Aug 19, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/runtime-sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,14 @@ jobs:
# Test this script using changes in a fork
repository: 'dotnet/aspnetcore'
path: aspnetcore
ref: release/5.0
- name: Checkout runtime
uses: actions/[email protected]
with:
# Test this script using changes in a fork
repository: 'dotnet/runtime'
path: runtime
ref: release/5.0
- name: Copy
shell: cmd
working-directory: .\runtime\src\libraries\Common\src\System\Net\Http\aspnetcore\
Expand Down Expand Up @@ -65,5 +67,6 @@ jobs:
title: 'Sync shared code from runtime'
body: 'This PR was automatically generated to sync shared code changes from runtime. Fixes #18943'
labels: area-servers
base: release/5.0
branch: github-action/sync-runtime
branch-suffix: timestamp
155 changes: 124 additions & 31 deletions AspNetCore.sln

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions eng/Dependencies.props
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ and are generated based on the last package release.
<LatestPackageReference Include="Microsoft.Bcl.AsyncInterfaces" />
<LatestPackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" />
<LatestPackageReference Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" />
<LatestPackageReference Include="Microsoft.EntityFrameworkCore.Design" />
<LatestPackageReference Include="Microsoft.EntityFrameworkCore.InMemory" />
<LatestPackageReference Include="Microsoft.EntityFrameworkCore.Relational" />
<LatestPackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" />
Expand Down
4 changes: 4 additions & 0 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@
<Uri>https://github.com/dotnet/efcore</Uri>
<Sha>ede96af3fdf94ae6b149f10451d573c37fe27669</Sha>
</Dependency>
<Dependency Name="Microsoft.EntityFrameworkCore.Design" Version="6.0.0-alpha.1.20417.8">
<Uri>https://github.com/dotnet/efcore</Uri>
<Sha>5099d918192f5df031e1ff5e3beea9cb361c605a</Sha>
</Dependency>
<Dependency Name="Microsoft.Extensions.Caching.Abstractions" Version="5.0.0-rc.1.20417.14">
<Uri>https://github.com/dotnet/runtime</Uri>
<Sha>907f7da59b40c80941b02ac2a46650adf3f606bc</Sha>
Expand Down
11 changes: 6 additions & 5 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@
<MicrosoftEntityFrameworkCoreSqlServerPackageVersion>6.0.0-alpha.1.20417.8</MicrosoftEntityFrameworkCoreSqlServerPackageVersion>
<MicrosoftEntityFrameworkCoreToolsPackageVersion>6.0.0-alpha.1.20417.8</MicrosoftEntityFrameworkCoreToolsPackageVersion>
<MicrosoftEntityFrameworkCorePackageVersion>6.0.0-alpha.1.20417.8</MicrosoftEntityFrameworkCorePackageVersion>
<MicrosoftEntityFrameworkCoreDesignPackageVersion>6.0.0-alpha.1.20417.8</MicrosoftEntityFrameworkCoreDesignPackageVersion>
</PropertyGroup>
<!--

Expand Down Expand Up @@ -250,11 +251,11 @@
<GrpcAuthPackageVersion>2.27.0</GrpcAuthPackageVersion>
<GrpcNetClientPackageVersion>2.27.0</GrpcNetClientPackageVersion>
<GrpcToolsPackageVersion>2.27.0</GrpcToolsPackageVersion>
<IdentityServer4AspNetIdentityPackageVersion>3.0.0</IdentityServer4AspNetIdentityPackageVersion>
<IdentityServer4EntityFrameworkPackageVersion>3.0.0</IdentityServer4EntityFrameworkPackageVersion>
<IdentityServer4PackageVersion>3.0.0</IdentityServer4PackageVersion>
<IdentityServer4StoragePackageVersion>3.0.0</IdentityServer4StoragePackageVersion>
<IdentityServer4EntityFrameworkStoragePackageVersion>3.0.0</IdentityServer4EntityFrameworkStoragePackageVersion>
<IdentityServer4AspNetIdentityPackageVersion>4.0.4</IdentityServer4AspNetIdentityPackageVersion>
<IdentityServer4EntityFrameworkPackageVersion>4.0.4</IdentityServer4EntityFrameworkPackageVersion>
<IdentityServer4PackageVersion>4.0.4</IdentityServer4PackageVersion>
<IdentityServer4StoragePackageVersion>4.0.4</IdentityServer4StoragePackageVersion>
<IdentityServer4EntityFrameworkStoragePackageVersion>4.0.4</IdentityServer4EntityFrameworkStoragePackageVersion>
<MessagePackPackageVersion>2.1.90</MessagePackPackageVersion>
<MicrosoftIdentityWebPackageVersion>0.2.1-preview</MicrosoftIdentityWebPackageVersion>
<MicrosoftIdentityWebUIPackageVersion>0.2.1-preview</MicrosoftIdentityWebUIPackageVersion>
Expand Down
11 changes: 7 additions & 4 deletions src/Components/ComponentsNoDeps.slnf
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
"src\\Components\\WebAssembly\\DebugProxy\\src\\Microsoft.AspNetCore.Components.WebAssembly.DebugProxy.csproj",
"src\\Components\\WebAssembly\\DevServer\\src\\Microsoft.AspNetCore.Components.WebAssembly.DevServer.csproj",
"src\\Components\\WebAssembly\\JSInterop\\src\\Microsoft.JSInterop.WebAssembly.csproj",
"src\\Components\\WebAssembly\\Sdk\\integrationtests\\Microsoft.NET.Sdk.BlazorWebAssembly.IntegrationTests.csproj",
"src\\Components\\WebAssembly\\Sdk\\src\\Microsoft.NET.Sdk.BlazorWebAssembly.csproj",
"src\\Components\\WebAssembly\\Sdk\\test\\Microsoft.NET.Sdk.BlazorWebAssembly.Tests.csproj",
"src\\Components\\WebAssembly\\Sdk\\tools\\Microsoft.NET.Sdk.BlazorWebAssembly.Tools.csproj",
"src\\Components\\WebAssembly\\Server\\src\\Microsoft.AspNetCore.Components.WebAssembly.Server.csproj",
"src\\Components\\WebAssembly\\Server\\test\\Microsoft.AspNetCore.Components.WebAssembly.Server.Tests.csproj",
"src\\Components\\WebAssembly\\WebAssembly.Authentication\\src\\Microsoft.AspNetCore.Components.WebAssembly.Authentication.csproj",
Expand All @@ -31,10 +35,9 @@
"src\\Components\\WebAssembly\\testassets\\HostedInAspNet.Client\\HostedInAspNet.Client.csproj",
"src\\Components\\WebAssembly\\testassets\\HostedInAspNet.Server\\HostedInAspNet.Server.csproj",
"src\\Components\\WebAssembly\\testassets\\StandaloneApp\\StandaloneApp.csproj",
"src\\Components\\WebAssembly\\Sdk\\src\\Microsoft.NET.Sdk.BlazorWebAssembly.csproj",
"src\\Components\\WebAssembly\\Sdk\\test\\Microsoft.NET.Sdk.BlazorWebAssembly.Tests.csproj",
"src\\Components\\WebAssembly\\Sdk\\tools\\Microsoft.NET.Sdk.BlazorWebAssembly.Tools.csproj",
"src\\Components\\WebAssembly\\Sdk\\integrationtests\\Microsoft.NET.Sdk.BlazorWebAssembly.IntegrationTests.csproj",
"src\\Components\\WebAssembly\\testassets\\Wasm.Authentication.Client\\Wasm.Authentication.Client.csproj",
"src\\Components\\WebAssembly\\testassets\\Wasm.Authentication.Server\\Wasm.Authentication.Server.csproj",
"src\\Components\\WebAssembly\\testassets\\Wasm.Authentication.Shared\\Wasm.Authentication.Shared.csproj",
"src\\Components\\Web\\src\\Microsoft.AspNetCore.Components.Web.csproj",
"src\\Components\\Web\\test\\Microsoft.AspNetCore.Components.Web.Tests.csproj",
"src\\Components\\benchmarkapps\\Wasm.Performance\\ConsoleHost\\Wasm.Performance.ConsoleHost.csproj",
Expand Down
8 changes: 4 additions & 4 deletions src/Components/Web.JS/dist/Release/blazor.server.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/Components/Web.JS/dist/Release/blazor.webassembly.js

Large diffs are not rendered by default.

11 changes: 10 additions & 1 deletion src/Components/Web.JS/src/Platform/Mono/MonoDebugger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,17 @@ import { WebAssemblyResourceLoader } from '../WebAssemblyResourceLoader';
const currentBrowserIsChrome = (window as any).chrome
&& navigator.userAgent.indexOf('Edge') < 0; // Edge pretends to be Chrome

let isDebugging = true;

window.addEventListener('load', () => {
const params = new URLSearchParams(window.location.search);
isDebugging = params.get('_blazor_debug') === 'true';
})

let hasReferencedPdbs = false;

export function hasDebuggingEnabled() {
return hasReferencedPdbs && currentBrowserIsChrome;
return isDebugging && hasReferencedPdbs && currentBrowserIsChrome;
}

export function attachDebuggerHotkey(resourceLoader: WebAssemblyResourceLoader) {
Expand All @@ -26,6 +33,8 @@ export function attachDebuggerHotkey(resourceLoader: WebAssemblyResourceLoader)
console.error('Cannot start debugging, because the application was not compiled with debugging enabled.');
} else if (!currentBrowserIsChrome) {
console.error('Currently, only Microsoft Edge (80+), or Google Chrome, are supported for debugging.');
} else if (!isDebugging) {
console.error(`_blazor_debug query parameter must be set to enable debugging. To enable debugging, go to ${location.href}?_blazor_debug=true.`);
} else {
launchDebugger();
}
Expand Down
49 changes: 44 additions & 5 deletions src/Components/Web.JS/src/Platform/Mono/MonoPlatform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import { attachDebuggerHotkey, hasDebuggingEnabled } from './MonoDebugger';
import { showErrorNotification } from '../../BootErrors';
import { WebAssemblyResourceLoader, LoadingResource } from '../WebAssemblyResourceLoader';
import { Platform, System_Array, Pointer, System_Object, System_String, HeapLock } from '../Platform';
import { loadTimezoneData } from './TimezoneDataFile';
import { WebAssemblyBootResourceType } from '../WebAssemblyStartOptions';

let mono_wasm_add_assembly: (name: string, heapAddress: number, length: number) => void;
const appBinDirName = 'appBinDir';
const icuDataResourceName = 'icudt.dat';
const uint64HighOrderShift = Math.pow(2, 32);
const maxSafeNumberHighPart = Math.pow(2, 21) - 1; // The high-order int32 from Number.MAX_SAFE_INTEGER

Expand Down Expand Up @@ -239,14 +239,23 @@ function createEmscriptenModuleInstance(resourceLoader: WebAssemblyResourceLoade
/* hash */ resourceLoader.bootConfig.resources.runtime[dotnetWasmResourceName],
/* type */ 'dotnetwasm');

const dotnetTimeZoneResourceName = 'dotnet.timezones.dat';
const dotnetTimeZoneResourceName = 'dotnet.timezones.blat';
let timeZoneResource: LoadingResource | undefined;
if (resourceLoader.bootConfig.resources.runtime.hasOwnProperty(dotnetTimeZoneResourceName)) {
timeZoneResource = resourceLoader.loadResource(
dotnetTimeZoneResourceName,
`_framework/${dotnetTimeZoneResourceName}`,
resourceLoader.bootConfig.resources.runtime[dotnetTimeZoneResourceName],
'timezonedata');
'globalization');
}

let icuDataResource: LoadingResource | undefined;
if (resourceLoader.bootConfig.resources.runtime.hasOwnProperty(icuDataResourceName)) {
icuDataResource = resourceLoader.loadResource(
icuDataResourceName,
`_framework/${icuDataResourceName}`,
resourceLoader.bootConfig.resources.runtime[icuDataResourceName],
'globalization');
}

// Override the mechanism for fetching the main wasm file so we can connect it to our cache
Expand Down Expand Up @@ -274,6 +283,13 @@ function createEmscriptenModuleInstance(resourceLoader: WebAssemblyResourceLoade
loadTimezone(timeZoneResource);
}

if (icuDataResource) {
loadICUData(icuDataResource);
} else {
// Use invariant culture if the app does not carry icu data.
MONO.mono_wasm_setenv("DOTNET_SYSTEM_GLOBALIZATION_INVARIANT", "1");
}

// Fetch the assemblies and PDBs in the background, telling Mono to wait until they are loaded
// Mono requires the assembly filenames to have a '.dll' extension, so supply such names regardless
// of the extensions in the URLs. This allows loading assemblies with arbitrary filenames.
Expand Down Expand Up @@ -358,7 +374,11 @@ function createEmscriptenModuleInstance(resourceLoader: WebAssemblyResourceLoade
resourceLoader.purgeUnusedCacheEntriesAsync(); // Don't await - it's fine to run in background

MONO.mono_wasm_setenv("MONO_URI_DOTNETRELATIVEORABSOLUTE", "true");
MONO.mono_wasm_setenv("DOTNET_SYSTEM_GLOBALIZATION_INVARIANT", "1");
let timeZone = "UTC";
try {
timeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;
} catch { }
MONO.mono_wasm_setenv("TZ", timeZone);
// Turn off full-gc to prevent browser freezing.
const mono_wasm_enable_on_demand_gc = cwrap('mono_wasm_enable_on_demand_gc', null, ['number']);
mono_wasm_enable_on_demand_gc(0);
Expand Down Expand Up @@ -459,8 +479,27 @@ async function loadTimezone(timeZoneResource: LoadingResource) : Promise<void> {

const request = await timeZoneResource.response;
const arrayBuffer = await request.arrayBuffer();
loadTimezoneData(arrayBuffer)

Module['FS_createPath']('/', 'usr', true, true);
Module['FS_createPath']('/usr/', 'share', true, true);
Module['FS_createPath']('/usr/share/', 'zoneinfo', true, true);
MONO.mono_wasm_load_data_archive(new Uint8Array(arrayBuffer), '/usr/share/zoneinfo/');

removeRunDependency(runDependencyId);
}

async function loadICUData(icuDataResource: LoadingResource) : Promise<void> {
const runDependencyId = `blazor:icudata`;
addRunDependency(runDependencyId);

const request = await icuDataResource.response;
const array = new Uint8Array(await request.arrayBuffer());

const offset = MONO.mono_wasm_load_bytes_into_heap(array);
if (!MONO.mono_wasm_load_icu_data(offset))
{
throw new Error("Error loading ICU asset.");
}
removeRunDependency(runDependencyId);
}

Expand Down
3 changes: 3 additions & 0 deletions src/Components/Web.JS/src/Platform/Mono/MonoTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ declare interface MONO {
loaded_files: string[];
mono_wasm_runtime_ready (): void;
mono_wasm_setenv (name: string, value: string): void;
mono_wasm_load_data_archive(data: Uint8Array, prefix: string): void;
mono_wasm_load_bytes_into_heap (data: Uint8Array): Pointer;
mono_wasm_load_icu_data(heapAddress: Pointer): boolean;
}

// Mono uses this global to hold low-level interop APIs
Expand Down
43 changes: 0 additions & 43 deletions src/Components/Web.JS/src/Platform/Mono/TimezoneDataFile.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ export interface WebAssemblyStartOptions {
// This type doesn't have to align with anything in BootConfig.
// Instead, this represents the public API through which certain aspects
// of boot resource loading can be customized.
export type WebAssemblyBootResourceType = 'assembly' | 'pdb' | 'dotnetjs' | 'dotnetwasm' | 'timezonedata';
export type WebAssemblyBootResourceType = 'assembly' | 'pdb' | 'dotnetjs' | 'dotnetwasm' | 'globalization';
5 changes: 3 additions & 2 deletions src/Components/Web.JS/src/Virtualize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,16 @@ function init(dotNetHelper: any, spacerBefore: HTMLElement, spacerAfter: HTMLEle
return;
}

const spacerSeparation = spacerAfter.offsetTop - (spacerBefore.offsetTop + spacerBefore.offsetHeight);
const containerSize = entry.rootBounds?.height;

if (entry.target === spacerBefore) {
dotNetHelper.invokeMethodAsync('OnSpacerBeforeVisible', entry.intersectionRect.top - entry.boundingClientRect.top, containerSize);
dotNetHelper.invokeMethodAsync('OnSpacerBeforeVisible', entry.intersectionRect.top - entry.boundingClientRect.top, spacerSeparation, containerSize);
} else if (entry.target === spacerAfter && spacerAfter.offsetHeight > 0) {
// When we first start up, both the "before" and "after" spacers will be visible, but it's only relevant to raise a
// single event to load the initial data. To avoid raising two events, skip the one for the "after" spacer if we know
// it's meaningless to talk about any overlap into it.
dotNetHelper.invokeMethodAsync('OnSpacerAfterVisible', entry.boundingClientRect.bottom - entry.intersectionRect.bottom, containerSize);
dotNetHelper.invokeMethodAsync('OnSpacerAfterVisible', entry.boundingClientRect.bottom - entry.intersectionRect.bottom, spacerSeparation, containerSize);
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace Microsoft.AspNetCore.Components.Web.Virtualization
{
internal interface IVirtualizeJsCallbacks
{
void OnBeforeSpacerVisible(float spacerSize, float containerSize);
void OnAfterSpacerVisible(float spacerSize, float containerSize);
void OnBeforeSpacerVisible(float spacerSize, float spacerSeparation, float containerSize);
void OnAfterSpacerVisible(float spacerSize, float spacerSeparation, float containerSize);
}
}
13 changes: 12 additions & 1 deletion src/Components/Web/src/Virtualization/PlaceholderContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,24 @@ public readonly struct PlaceholderContext
/// </summary>
public int Index { get; }

/// <summary>
/// The size of the placeholder in pixels.
/// <para>
/// For virtualized components with vertical scrolling, this would be the height of the placeholder in pixels.
/// For virtualized components with horizontal scrolling, this would be the width of the placeholder in pixels.
/// </para>
/// </summary>
public float Size { get; }

/// <summary>
/// Constructs a new <see cref="PlaceholderContext"/> instance.
/// </summary>
/// <param name="index">The item index of the placeholder.</param>
public PlaceholderContext(int index)
/// <param name="size">The size of the placeholder in pixels.</param>
public PlaceholderContext(int index, float size = 0f)
{
Index = index;
Size = size;
}
}
}
Loading