Skip to content

Commit ad5130e

Browse files
Merge branch 'main' into gh-60628
2 parents ede0719 + 1efded6 commit ad5130e

File tree

150 files changed

+1654
-843
lines changed

Some content is hidden

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

150 files changed

+1654
-843
lines changed

eng/Version.Details.xml

Lines changed: 215 additions & 211 deletions
Large diffs are not rendered by default.

eng/Versions.props

Lines changed: 103 additions & 104 deletions
Large diffs are not rendered by default.

eng/scripts/CodeCheck.ps1

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,11 @@ try {
124124
foreach ($dep in $versionDetails.SelectNodes('//Dependency')) {
125125
Write-Verbose "Found $dep"
126126

127+
if ($dep.Label -eq 'Manual') {
128+
# skip dependencies that are manually updated
129+
continue
130+
}
131+
127132
$expectedVersion = $dep.Version
128133

129134
if ($dep.Name -in $globalJson.'msbuild-sdks'.PSObject.Properties.Name) {

eng/targets/Helix.Common.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
<ItemGroup>
3232
<HelixAvailableTargetQueue Include="Ubuntu.2004.Amd64.Open" Platform="Linux" />
3333
<HelixAvailableTargetQueue Include="OSX.15.Amd64.Open" Platform="OSX" />
34-
<HelixAvailableTargetQueue Include="Windows.11.Amd64.Client.Open" Platform="Windows" />
34+
<HelixAvailableTargetQueue Include="Windows.Amd64.VS2022.Pre.Open" Platform="Windows" />
3535
</ItemGroup>
3636
</When>
3737
<Otherwise>
@@ -54,7 +54,7 @@
5454

5555
<!-- Windows -->
5656
<HelixAvailableTargetQueue Include="Windows.Amd64.Server2022.Open" Platform="Windows" />
57-
<HelixAvailableTargetQueue Include="Windows.Amd64.VS2022.Pre.Open" Platform="Windows" />
57+
<HelixAvailableTargetQueue Include="Windows.11.Amd64.Client.Open" Platform="Windows" />
5858

5959
<!-- IIS Express isn't supported on arm64 and most of the IsWindowsOnlyTests depend on its setup scripts. -->
6060
<HelixAvailableTargetQueue Include="windows.11.arm64.open" Platform="Windows"

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.25358.102",
31-
"Microsoft.DotNet.Helix.Sdk": "10.0.0-beta.25358.102",
32-
"Microsoft.DotNet.SharedFramework.Sdk": "10.0.0-beta.25358.102",
30+
"Microsoft.DotNet.Arcade.Sdk": "10.0.0-beta.25367.101",
31+
"Microsoft.DotNet.Helix.Sdk": "10.0.0-beta.25367.101",
32+
"Microsoft.DotNet.SharedFramework.Sdk": "10.0.0-beta.25367.101",
3333
"Microsoft.Build.NoTargets": "3.7.0",
3434
"Microsoft.Build.Traversal": "3.4.0"
3535
}

src/Components/Components/src/ComponentsActivitySource.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ namespace Microsoft.AspNetCore.Components;
1212
internal class ComponentsActivitySource
1313
{
1414
internal const string Name = "Microsoft.AspNetCore.Components";
15-
internal const string OnRouteName = $"{Name}.RouteChange";
15+
internal const string OnRouteName = $"{Name}.Navigate";
1616
internal const string OnEventName = $"{Name}.HandleEvent";
1717

1818
private static ActivitySource ActivitySource { get; } = new ActivitySource(Name);
@@ -23,7 +23,7 @@ public void Init(ComponentsActivityLinkStore store)
2323
_componentsActivityLinkStore = store;
2424
}
2525

26-
public ComponentsActivityHandle StartRouteActivity(string componentType, string route)
26+
public ComponentsActivityHandle StartNavigateActivity(string componentType, string route)
2727
{
2828
var activity = ActivitySource.CreateActivity(OnRouteName, ActivityKind.Internal, parentId: null, null, null);
2929
if (activity is not null)
@@ -54,12 +54,12 @@ public ComponentsActivityHandle StartRouteActivity(string componentType, string
5454
return default;
5555
}
5656

57-
public void StopRouteActivity(ComponentsActivityHandle activityHandle, Exception? ex)
57+
public void StopNavigateActivity(ComponentsActivityHandle activityHandle, Exception? ex)
5858
{
5959
StopComponentActivity(ComponentsActivityLinkStore.Route, activityHandle, ex);
6060
}
6161

62-
public static ComponentsActivityHandle StartEventActivity(string? componentType, string? methodName, string? attributeName)
62+
public static ComponentsActivityHandle StartHandleEventActivity(string? componentType, string? methodName, string? attributeName)
6363
{
6464
var activity = ActivitySource.CreateActivity(OnEventName, ActivityKind.Internal, parentId: null, null, null);
6565

@@ -91,21 +91,21 @@ public static ComponentsActivityHandle StartEventActivity(string? componentType,
9191
return default;
9292
}
9393

94-
public void StopEventActivity(ComponentsActivityHandle activityHandle, Exception? ex)
94+
public void StopHandleEventActivity(ComponentsActivityHandle activityHandle, Exception? ex)
9595
{
9696
StopComponentActivity(ComponentsActivityLinkStore.Event, activityHandle, ex);
9797
}
9898

99-
public async Task CaptureEventStopAsync(Task task, ComponentsActivityHandle activityHandle)
99+
public async Task CaptureHandleEventStopAsync(Task task, ComponentsActivityHandle activityHandle)
100100
{
101101
try
102102
{
103103
await task;
104-
StopEventActivity(activityHandle, null);
104+
StopHandleEventActivity(activityHandle, null);
105105
}
106106
catch (Exception ex)
107107
{
108-
StopEventActivity(activityHandle, ex);
108+
StopHandleEventActivity(activityHandle, ex);
109109
}
110110
}
111111

src/Components/Components/src/ComponentsMetrics.cs

Lines changed: 13 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ internal sealed class ComponentsMetrics : IDisposable
2020
private readonly Histogram<double> _eventDuration;
2121
private readonly Histogram<double> _parametersDuration;
2222
private readonly Histogram<double> _batchDuration;
23+
private readonly Histogram<int> _batchSize;
2324

2425
public bool IsNavigationEnabled => _navigationCount.Enabled;
2526

@@ -37,27 +38,33 @@ public ComponentsMetrics(IMeterFactory meterFactory)
3738
_lifeCycleMeter = meterFactory.Create(LifecycleMeterName);
3839

3940
_navigationCount = _meter.CreateCounter<long>(
40-
"aspnetcore.components.navigation",
41+
"aspnetcore.components.navigate",
4142
unit: "{route}",
4243
description: "Total number of route changes.");
4344

4445
_eventDuration = _meter.CreateHistogram(
45-
"aspnetcore.components.event_handler",
46+
"aspnetcore.components.handle_event.duration",
4647
unit: "s",
4748
description: "Duration of processing browser event. It includes business logic of the component but not affected child components.",
4849
advice: new InstrumentAdvice<double> { HistogramBucketBoundaries = MetricsConstants.ShortSecondsBucketBoundaries });
4950

5051
_parametersDuration = _lifeCycleMeter.CreateHistogram(
51-
"aspnetcore.components.update_parameters",
52+
"aspnetcore.components.update_parameters.duration",
5253
unit: "s",
5354
description: "Duration of processing component parameters. It includes business logic of the component.",
5455
advice: new InstrumentAdvice<double> { HistogramBucketBoundaries = MetricsConstants.BlazorRenderingSecondsBucketBoundaries });
5556

5657
_batchDuration = _lifeCycleMeter.CreateHistogram(
57-
"aspnetcore.components.render_diff",
58+
"aspnetcore.components.render_diff.duration",
5859
unit: "s",
5960
description: "Duration of rendering component tree and producing HTML diff. It includes business logic of the changed components.",
6061
advice: new InstrumentAdvice<double> { HistogramBucketBoundaries = MetricsConstants.BlazorRenderingSecondsBucketBoundaries });
62+
63+
_batchSize = _lifeCycleMeter.CreateHistogram(
64+
"aspnetcore.components.render_diff.size",
65+
unit: "{elements}",
66+
description: "Number of HTML elements modified during a rendering batch.",
67+
advice: new InstrumentAdvice<int> { HistogramBucketBoundaries = MetricsConstants.BlazorRenderingDiffLengthBucketBoundaries });
6168
}
6269

6370
public void Navigation(string componentType, string route)
@@ -137,10 +144,7 @@ public void FailParametersSync(Exception ex, long startTimestamp, string? compon
137144

138145
public async Task CaptureBatchDuration(Task task, long startTimestamp, int diffLength)
139146
{
140-
var tags = new TagList
141-
{
142-
{ "aspnetcore.components.diff.length", BucketDiffLength(diffLength) }
143-
};
147+
var tags = new TagList();
144148

145149
try
146150
{
@@ -152,37 +156,19 @@ public async Task CaptureBatchDuration(Task task, long startTimestamp, int diffL
152156
}
153157
var duration = Stopwatch.GetElapsedTime(startTimestamp);
154158
_batchDuration.Record(duration.TotalSeconds, tags);
159+
_batchSize.Record(diffLength, tags);
155160
}
156161

157162
public void FailBatchSync(Exception ex, long startTimestamp)
158163
{
159164
var duration = Stopwatch.GetElapsedTime(startTimestamp);
160165
var tags = new TagList
161166
{
162-
{ "aspnetcore.components.diff.length", 0 },
163167
{ "error.type", ex.GetType().FullName ?? "unknown" }
164168
};
165169
_batchDuration.Record(duration.TotalSeconds, tags);
166170
}
167171

168-
private static int BucketDiffLength(int diffLength)
169-
{
170-
return diffLength switch
171-
{
172-
<= 1 => 1,
173-
<= 2 => 2,
174-
<= 5 => 5,
175-
<= 10 => 10,
176-
<= 20 => 20,
177-
<= 50 => 50,
178-
<= 100 => 100,
179-
<= 500 => 500,
180-
<= 1000 => 1000,
181-
<= 10000 => 10000,
182-
_ => 10001,
183-
};
184-
}
185-
186172
public void Dispose()
187173
{
188174
_meter.Dispose();

src/Components/Components/src/NavigationManager.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ public event EventHandler<NotFoundEventArgs> OnNotFound
6161
// The URI. Always represented an absolute URI.
6262
private string? _uri;
6363
private bool _isInitialized;
64-
internal string NotFoundPageRoute { get; set; } = string.Empty;
6564

6665
/// <summary>
6766
/// Gets or sets the current base URI. The <see cref="BaseUri" /> is always represented as an absolute URI in string form with trailing slash.
@@ -211,7 +210,7 @@ private void NotFoundCore()
211210
}
212211
else
213212
{
214-
_notFound.Invoke(this, new NotFoundEventArgs(NotFoundPageRoute));
213+
_notFound.Invoke(this, new NotFoundEventArgs());
215214
}
216215
}
217216

src/Components/Components/src/PublicAPI.Unshipped.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
#nullable enable
22
*REMOVED*Microsoft.AspNetCore.Components.ResourceAsset.ResourceAsset(string! url, System.Collections.Generic.IReadOnlyList<Microsoft.AspNetCore.Components.ResourceAssetProperty!>? properties) -> void
33
Microsoft.AspNetCore.Components.ResourceAsset.ResourceAsset(string! url, System.Collections.Generic.IReadOnlyList<Microsoft.AspNetCore.Components.ResourceAssetProperty!>? properties = null) -> void
4-
Microsoft.AspNetCore.Components.Routing.Router.NotFoundPage.get -> System.Type!
4+
Microsoft.AspNetCore.Components.Routing.Router.NotFoundPage.get -> System.Type?
55
Microsoft.AspNetCore.Components.Routing.Router.NotFoundPage.set -> void
66
Microsoft.AspNetCore.Components.Infrastructure.ComponentsMetricsServiceCollectionExtensions
77
Microsoft.AspNetCore.Components.NavigationManager.OnNotFound -> System.EventHandler<Microsoft.AspNetCore.Components.Routing.NotFoundEventArgs!>!
88
Microsoft.AspNetCore.Components.NavigationManager.NotFound() -> void
99
Microsoft.AspNetCore.Components.Routing.IHostEnvironmentNavigationManager.Initialize(string! baseUri, string! uri, System.Func<string!, System.Threading.Tasks.Task!>! onNavigateTo) -> void
1010
Microsoft.AspNetCore.Components.Routing.NotFoundEventArgs
11-
Microsoft.AspNetCore.Components.Routing.NotFoundEventArgs.NotFoundEventArgs(string! url) -> void
12-
Microsoft.AspNetCore.Components.Routing.NotFoundEventArgs.Path.get -> string!
11+
Microsoft.AspNetCore.Components.Routing.NotFoundEventArgs.NotFoundEventArgs() -> void
12+
Microsoft.AspNetCore.Components.Routing.NotFoundEventArgs.Path.get -> string?
13+
Microsoft.AspNetCore.Components.Routing.NotFoundEventArgs.Path.set -> void
1314
Microsoft.AspNetCore.Components.Infrastructure.ComponentStatePersistenceManager.ComponentStatePersistenceManager(Microsoft.Extensions.Logging.ILogger<Microsoft.AspNetCore.Components.Infrastructure.ComponentStatePersistenceManager!>! logger, System.IServiceProvider! serviceProvider) -> void
1415
Microsoft.AspNetCore.Components.Infrastructure.ComponentStatePersistenceManager.SetPlatformRenderMode(Microsoft.AspNetCore.Components.IComponentRenderMode! renderMode) -> void
1516
Microsoft.AspNetCore.Components.Infrastructure.RegisterPersistentComponentStateServiceCollectionExtensions

src/Components/Components/src/RenderTree/Renderer.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ public virtual Task DispatchEventAsync(ulong eventHandlerId, EventFieldInfo? fie
461461
{
462462
receiverName ??= (callback.Receiver?.GetType() ?? callback.Delegate.Target?.GetType())?.FullName;
463463
methodName ??= callback.Delegate.Method?.Name;
464-
activityHandle = ComponentsActivitySource.StartEventActivity(receiverName, methodName, attributeName);
464+
activityHandle = ComponentsActivitySource.StartHandleEventActivity(receiverName, methodName, attributeName);
465465
}
466466

467467
var eventStartTimestamp = ComponentMetrics != null && ComponentMetrics.IsEventEnabled ? Stopwatch.GetTimestamp() : 0;
@@ -518,7 +518,7 @@ public virtual Task DispatchEventAsync(ulong eventHandlerId, EventFieldInfo? fie
518518
// stop activity/trace
519519
if (ComponentActivitySource != null && activityHandle.Activity != null)
520520
{
521-
_ = ComponentActivitySource.CaptureEventStopAsync(task, activityHandle);
521+
_ = ComponentActivitySource.CaptureHandleEventStopAsync(task, activityHandle);
522522
}
523523
}
524524
catch (Exception e)
@@ -532,7 +532,7 @@ public virtual Task DispatchEventAsync(ulong eventHandlerId, EventFieldInfo? fie
532532

533533
if (ComponentActivitySource != null && activityHandle.Activity != null)
534534
{
535-
ComponentActivitySource.StopEventActivity(activityHandle, e);
535+
ComponentActivitySource.StopHandleEventActivity(activityHandle, e);
536536
}
537537

538538
HandleExceptionViaErrorBoundary(e, receiverComponentState);

0 commit comments

Comments
 (0)