Skip to content

Commit b9ceeb7

Browse files
committed
Merge remote-tracking branch 'upstream/main' into BlazorWriteImportMapToHtml
2 parents 864a2e7 + d75d9b3 commit b9ceeb7

File tree

72 files changed

+2638
-364
lines changed

Some content is hidden

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

72 files changed

+2638
-364
lines changed

eng/Signing.props

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@
1515
<FileSignInfo Include="Mono.Cecil.Mdb.dll" CertificateName="3PartySHA2" />
1616
<FileSignInfo Include="Mono.Cecil.Pdb.dll" CertificateName="3PartySHA2" />
1717
<FileSignInfo Include="Mono.Cecil.Rocks.dll" CertificateName="3PartySHA2" />
18-
19-
<!-- Ensure that azl files get the mariner cert -->
20-
<AzureLinuxRPM Include="$(ArtifactsPackagesDir)**/*-azl-*.rpm" />
21-
<FileSignInfo Include="@(AzureLinuxRPM->'%(Filename)%(Extension)')" CertificateName="LinuxSignMariner" />
2218
</ItemGroup>
2319

2420
<PropertyGroup>

eng/Version.Details.xml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -396,39 +396,39 @@
396396
<Uri>https://github.com/dotnet/runtime</Uri>
397397
<Sha>367e0a8a23e444a94c029fcb72dcb4ac66bd6717</Sha>
398398
</Dependency>
399-
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="10.0.0-beta.25178.2">
399+
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="10.0.0-beta.25206.1">
400400
<Uri>https://github.com/dotnet/arcade</Uri>
401-
<Sha>7d1967403f5b12406763c666f41e3358bb542ced</Sha>
401+
<Sha>37f732fbfa006386f89a16be417278ea4fee375e</Sha>
402402
</Dependency>
403403
<!-- Intermediate is necessary for source build. -->
404-
<Dependency Name="Microsoft.SourceBuild.Intermediate.arcade" Version="10.0.0-beta.25178.2">
404+
<Dependency Name="Microsoft.SourceBuild.Intermediate.arcade" Version="10.0.0-beta.25206.1">
405405
<Uri>https://github.com/dotnet/arcade</Uri>
406-
<Sha>7d1967403f5b12406763c666f41e3358bb542ced</Sha>
406+
<Sha>37f732fbfa006386f89a16be417278ea4fee375e</Sha>
407407
<SourceBuild RepoName="arcade" ManagedOnly="true" />
408408
</Dependency>
409-
<Dependency Name="Microsoft.DotNet.Build.Tasks.Archives" Version="10.0.0-beta.25178.2">
409+
<Dependency Name="Microsoft.DotNet.Build.Tasks.Archives" Version="10.0.0-beta.25206.1">
410410
<Uri>https://github.com/dotnet/arcade</Uri>
411-
<Sha>7d1967403f5b12406763c666f41e3358bb542ced</Sha>
411+
<Sha>37f732fbfa006386f89a16be417278ea4fee375e</Sha>
412412
</Dependency>
413-
<Dependency Name="Microsoft.DotNet.Build.Tasks.Installers" Version="10.0.0-beta.25178.2">
413+
<Dependency Name="Microsoft.DotNet.Build.Tasks.Installers" Version="10.0.0-beta.25206.1">
414414
<Uri>https://github.com/dotnet/arcade</Uri>
415-
<Sha>7d1967403f5b12406763c666f41e3358bb542ced</Sha>
415+
<Sha>37f732fbfa006386f89a16be417278ea4fee375e</Sha>
416416
</Dependency>
417-
<Dependency Name="Microsoft.DotNet.Build.Tasks.Templating" Version="10.0.0-beta.25178.2">
417+
<Dependency Name="Microsoft.DotNet.Build.Tasks.Templating" Version="10.0.0-beta.25206.1">
418418
<Uri>https://github.com/dotnet/arcade</Uri>
419-
<Sha>7d1967403f5b12406763c666f41e3358bb542ced</Sha>
419+
<Sha>37f732fbfa006386f89a16be417278ea4fee375e</Sha>
420420
</Dependency>
421-
<Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="10.0.0-beta.25178.2">
421+
<Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="10.0.0-beta.25206.1">
422422
<Uri>https://github.com/dotnet/arcade</Uri>
423-
<Sha>7d1967403f5b12406763c666f41e3358bb542ced</Sha>
423+
<Sha>37f732fbfa006386f89a16be417278ea4fee375e</Sha>
424424
</Dependency>
425-
<Dependency Name="Microsoft.DotNet.RemoteExecutor" Version="10.0.0-beta.25178.2">
425+
<Dependency Name="Microsoft.DotNet.RemoteExecutor" Version="10.0.0-beta.25206.1">
426426
<Uri>https://github.com/dotnet/arcade</Uri>
427-
<Sha>7d1967403f5b12406763c666f41e3358bb542ced</Sha>
427+
<Sha>37f732fbfa006386f89a16be417278ea4fee375e</Sha>
428428
</Dependency>
429-
<Dependency Name="Microsoft.DotNet.SharedFramework.Sdk" Version="10.0.0-beta.25178.2">
429+
<Dependency Name="Microsoft.DotNet.SharedFramework.Sdk" Version="10.0.0-beta.25206.1">
430430
<Uri>https://github.com/dotnet/arcade</Uri>
431-
<Sha>7d1967403f5b12406763c666f41e3358bb542ced</Sha>
431+
<Sha>37f732fbfa006386f89a16be417278ea4fee375e</Sha>
432432
</Dependency>
433433
<Dependency Name="Microsoft.Extensions.Diagnostics.Testing" Version="9.5.0-preview.1.25204.8">
434434
<Uri>https://github.com/dotnet/extensions</Uri>

eng/Versions.props

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -168,11 +168,11 @@
168168
<NuGetVersioningVersion>6.2.4</NuGetVersioningVersion>
169169
<NuGetFrameworksVersion>6.2.4</NuGetFrameworksVersion>
170170
<!-- Packages from dotnet/arcade -->
171-
<MicrosoftDotNetBuildTasksArchivesVersion>10.0.0-beta.25178.2</MicrosoftDotNetBuildTasksArchivesVersion>
172-
<MicrosoftDotNetBuildTasksInstallersVersion>10.0.0-beta.25178.2</MicrosoftDotNetBuildTasksInstallersVersion>
173-
<MicrosoftDotNetBuildTasksTemplatingVersion>10.0.0-beta.25178.2</MicrosoftDotNetBuildTasksTemplatingVersion>
174-
<MicrosoftDotNetRemoteExecutorVersion>10.0.0-beta.25178.2</MicrosoftDotNetRemoteExecutorVersion>
175-
<MicrosoftSourceBuildIntermediatearcadeVersion>10.0.0-beta.25178.2</MicrosoftSourceBuildIntermediatearcadeVersion>
171+
<MicrosoftDotNetBuildTasksArchivesVersion>10.0.0-beta.25206.1</MicrosoftDotNetBuildTasksArchivesVersion>
172+
<MicrosoftDotNetBuildTasksInstallersVersion>10.0.0-beta.25206.1</MicrosoftDotNetBuildTasksInstallersVersion>
173+
<MicrosoftDotNetBuildTasksTemplatingVersion>10.0.0-beta.25206.1</MicrosoftDotNetBuildTasksTemplatingVersion>
174+
<MicrosoftDotNetRemoteExecutorVersion>10.0.0-beta.25206.1</MicrosoftDotNetRemoteExecutorVersion>
175+
<MicrosoftSourceBuildIntermediatearcadeVersion>10.0.0-beta.25206.1</MicrosoftSourceBuildIntermediatearcadeVersion>
176176
<!-- Packages from dotnet/source-build-externals -->
177177
<MicrosoftSourceBuildIntermediatesourcebuildexternalsVersion>10.0.617501</MicrosoftSourceBuildIntermediatesourcebuildexternalsVersion>
178178
<!-- Packages from dotnet/source-build-reference-packages -->

eng/common/core-templates/job/job.yml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,6 @@ jobs:
7373
- ${{ if ne(parameters.enableTelemetry, 'false') }}:
7474
- name: DOTNET_CLI_TELEMETRY_PROFILE
7575
value: '$(Build.Repository.Uri)'
76-
- ${{ if eq(parameters.enableRichCodeNavigation, 'true') }}:
77-
- name: EnableRichCodeNavigation
78-
value: 'true'
7976
# Retry signature validation up to three times, waiting 2 seconds between attempts.
8077
# See https://learn.microsoft.com/en-us/nuget/reference/errors-and-warnings/nu3028#retry-untrusted-root-failures
8178
- name: NUGET_EXPERIMENTAL_CHAIN_BUILD_RETRY_POLICY
@@ -147,16 +144,6 @@ jobs:
147144
- ${{ each step in parameters.steps }}:
148145
- ${{ step }}
149146

150-
- ${{ if eq(parameters.enableRichCodeNavigation, true) }}:
151-
- task: RichCodeNavIndexer@0
152-
displayName: RichCodeNav Upload
153-
inputs:
154-
languages: ${{ coalesce(parameters.richCodeNavigationLanguage, 'csharp') }}
155-
environment: ${{ coalesce(parameters.richCodeNavigationEnvironment, 'internal') }}
156-
richNavLogOutputDirectory: $(Build.SourcesDirectory)/artifacts/bin
157-
uploadRichNavArtifacts: ${{ coalesce(parameters.richCodeNavigationUploadArtifacts, false) }}
158-
continueOnError: true
159-
160147
- ${{ each step in parameters.componentGovernanceSteps }}:
161148
- ${{ step }}
162149

global.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@
2727
"jdk": "latest"
2828
},
2929
"msbuild-sdks": {
30-
"Microsoft.DotNet.Arcade.Sdk": "10.0.0-beta.25178.2",
31-
"Microsoft.DotNet.Helix.Sdk": "10.0.0-beta.25178.2",
32-
"Microsoft.DotNet.SharedFramework.Sdk": "10.0.0-beta.25178.2",
30+
"Microsoft.DotNet.Arcade.Sdk": "10.0.0-beta.25206.1",
31+
"Microsoft.DotNet.Helix.Sdk": "10.0.0-beta.25206.1",
32+
"Microsoft.DotNet.SharedFramework.Sdk": "10.0.0-beta.25206.1",
3333
"Microsoft.Build.NoTargets": "3.7.0",
3434
"Microsoft.Build.Traversal": "3.4.0"
3535
}

package-lock.json

Lines changed: 24 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,37 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4+
using System.Diagnostics.CodeAnalysis;
45
using Microsoft.JSInterop;
6+
using static Microsoft.AspNetCore.Internal.LinkerFlags;
57

68
namespace Microsoft.AspNetCore.Components.Endpoints;
79

810
internal sealed class UnsupportedJavaScriptRuntime : IJSRuntime
911
{
1012
private const string Message = "JavaScript interop calls cannot be issued during server-side static rendering, because the page has not yet loaded in the browser. Statically-rendered components must wrap any JavaScript interop calls in conditional logic to ensure those interop calls are not attempted during static rendering.";
1113

12-
public ValueTask<TValue> InvokeAsync<TValue>(string identifier, CancellationToken cancellationToken, object?[]? args)
14+
public ValueTask<TValue> InvokeAsync<[DynamicallyAccessedMembers(JsonSerialized)] TValue>(string identifier, CancellationToken cancellationToken, object?[]? args)
1315
=> throw new InvalidOperationException(Message);
1416

15-
ValueTask<TValue> IJSRuntime.InvokeAsync<TValue>(string identifier, object?[]? args)
17+
ValueTask<TValue> IJSRuntime.InvokeAsync<[DynamicallyAccessedMembers(JsonSerialized)] TValue>(string identifier, object?[]? args)
18+
=> throw new InvalidOperationException(Message);
19+
20+
public ValueTask<IJSObjectReference> InvokeNewAsync(string identifier, object?[]? args)
21+
=> throw new InvalidOperationException(Message);
22+
23+
public ValueTask<IJSObjectReference> InvokeNewAsync(string identifier, CancellationToken cancellationToken, object?[]? args)
24+
=> throw new InvalidOperationException(Message);
25+
26+
public ValueTask<TValue> GetValueAsync<[DynamicallyAccessedMembers(JsonSerialized)] TValue>(string identifier)
27+
=> throw new InvalidOperationException(Message);
28+
29+
public ValueTask<TValue> GetValueAsync<[DynamicallyAccessedMembers(JsonSerialized)] TValue>(string identifier, CancellationToken cancellationToken)
30+
=> throw new InvalidOperationException(Message);
31+
32+
public ValueTask SetValueAsync<[DynamicallyAccessedMembers(JsonSerialized)] TValue>(string identifier, TValue value)
33+
=> throw new InvalidOperationException(Message);
34+
35+
public ValueTask SetValueAsync<[DynamicallyAccessedMembers(JsonSerialized)] TValue>(string identifier, TValue value, CancellationToken cancellationToken)
1636
=> throw new InvalidOperationException(Message);
1737
}

src/Components/Server/src/Circuits/RemoteJSRuntime.cs

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,21 @@ protected override void SendByteArray(int id, byte[] data)
105105
}
106106

107107
protected override void BeginInvokeJS(long asyncHandle, string identifier, string argsJson, JSCallResultType resultType, long targetInstanceId)
108+
{
109+
var invocationInfo = new JSInvocationInfo
110+
{
111+
AsyncHandle = asyncHandle,
112+
TargetInstanceId = targetInstanceId,
113+
Identifier = identifier,
114+
CallType = JSCallType.FunctionCall,
115+
ResultType = resultType,
116+
ArgsJson = argsJson,
117+
};
118+
119+
BeginInvokeJS(invocationInfo);
120+
}
121+
122+
protected override void BeginInvokeJS(in JSInvocationInfo invocationInfo)
108123
{
109124
if (_clientProxy is null)
110125
{
@@ -123,9 +138,16 @@ protected override void BeginInvokeJS(long asyncHandle, string identifier, strin
123138
}
124139
}
125140

126-
Log.BeginInvokeJS(_logger, asyncHandle, identifier);
141+
Log.BeginInvokeJS(_logger, invocationInfo.AsyncHandle, invocationInfo.Identifier);
127142

128-
_clientProxy.SendAsync("JS.BeginInvokeJS", asyncHandle, identifier, argsJson, (int)resultType, targetInstanceId);
143+
_clientProxy.SendAsync(
144+
"JS.BeginInvokeJS",
145+
invocationInfo.AsyncHandle,
146+
invocationInfo.Identifier,
147+
invocationInfo.ArgsJson,
148+
(int)invocationInfo.ResultType,
149+
invocationInfo.TargetInstanceId,
150+
(int)invocationInfo.CallType);
129151
}
130152

131153
protected override void ReceiveByteArray(int id, byte[] data)

src/Components/Server/test/ProtectedBrowserStorageTest.cs

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -352,19 +352,54 @@ private static string ProtectionPrefix(string purpose)
352352

353353
class TestJSRuntime : IJSRuntime
354354
{
355-
public List<(string Identifier, object[] Args)> Invocations { get; }
356-
= new List<(string Identifier, object[] Args)>();
355+
public List<(string Identifier, object[] Args, JSCallType CallType)> Invocations { get; } = [];
357356

358357
public object NextInvocationResult { get; set; }
359358

360359
public ValueTask<TValue> InvokeAsync<TValue>(string identifier, CancellationToken cancellationToken, object[] args)
361360
{
362-
Invocations.Add((identifier, args));
361+
Invocations.Add((identifier, args, JSCallType.FunctionCall));
363362
return (ValueTask<TValue>)NextInvocationResult;
364363
}
365364

366365
public ValueTask<TValue> InvokeAsync<TValue>(string identifier, object[] args)
367366
=> InvokeAsync<TValue>(identifier, cancellationToken: CancellationToken.None, args: args);
367+
368+
public ValueTask<IJSObjectReference> InvokeNewAsync(string identifier, object[] args)
369+
{
370+
Invocations.Add((identifier, args, JSCallType.NewCall));
371+
return (ValueTask<IJSObjectReference>)NextInvocationResult;
372+
}
373+
374+
public ValueTask<IJSObjectReference> InvokeNewAsync(string identifier, CancellationToken cancellationToken, object[] args)
375+
{
376+
Invocations.Add((identifier, args, JSCallType.NewCall));
377+
return (ValueTask<IJSObjectReference>)NextInvocationResult;
378+
}
379+
380+
public ValueTask<TValue> GetValueAsync<TValue>(string identifier)
381+
{
382+
Invocations.Add((identifier, [], JSCallType.GetValue));
383+
return (ValueTask<TValue>)NextInvocationResult;
384+
}
385+
386+
public ValueTask<TValue> GetValueAsync<TValue>(string identifier, CancellationToken cancellationToken)
387+
{
388+
Invocations.Add((identifier, [], JSCallType.GetValue));
389+
return (ValueTask<TValue>)NextInvocationResult;
390+
}
391+
392+
public ValueTask SetValueAsync<TValue>(string identifier, TValue value)
393+
{
394+
Invocations.Add((identifier, [value], JSCallType.SetValue));
395+
return ValueTask.CompletedTask;
396+
}
397+
398+
public ValueTask SetValueAsync<TValue>(string identifier, TValue value, CancellationToken cancellationToken)
399+
{
400+
Invocations.Add((identifier, [value], JSCallType.SetValue));
401+
return ValueTask.CompletedTask;
402+
}
368403
}
369404

370405
class TestProtectedBrowserStorage : ProtectedBrowserStorage

src/Components/Web.JS/src/Boot.WebAssembly.Common.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { addDispatchEventMiddleware } from './Rendering/WebRendererInteropMethod
1414
import { WebAssemblyComponentDescriptor, WebAssemblyServerOptions, discoverWebAssemblyPersistedState } from './Services/ComponentDescriptorDiscovery';
1515
import { receiveDotNetDataStream } from './StreamingInterop';
1616
import { WebAssemblyComponentAttacher } from './Platform/WebAssemblyComponentAttacher';
17+
import { DotNet } from '@microsoft/dotnet-js-interop';
1718
import { MonoConfig } from '@microsoft/dotnet-runtime';
1819
import { RootComponentManager } from './Services/RootComponentManager';
1920
import { WebRendererId } from './Rendering/WebRendererId';
@@ -263,12 +264,12 @@ async function scheduleAfterStarted(operations: string): Promise<void> {
263264
Blazor._internal.updateRootComponents(operations);
264265
}
265266

266-
function invokeJSJson(identifier: string, targetInstanceId: number, resultType: number, argsJson: string, asyncHandle: number): string | null {
267+
function invokeJSJson(identifier: string, targetInstanceId: number, resultType: number, argsJson: string, asyncHandle: number, callType: number): string | null {
267268
if (asyncHandle !== 0) {
268-
dispatcher.beginInvokeJSFromDotNet(asyncHandle, identifier, argsJson, resultType, targetInstanceId);
269+
dispatcher.beginInvokeJSFromDotNet(asyncHandle, identifier, argsJson, resultType, targetInstanceId, callType);
269270
return null;
270271
} else {
271-
return dispatcher.invokeJSFromDotNet(identifier, argsJson, resultType, targetInstanceId);
272+
return dispatcher.invokeJSFromDotNet(identifier, argsJson, resultType, targetInstanceId, callType);
272273
}
273274
}
274275

0 commit comments

Comments
 (0)