Skip to content

Commit b703708

Browse files
authored
Merge pull request #51589 from dotnet-maestro-bot/merge/release/8.0-to-main
[automated] Merge branch 'release/8.0' => 'main'
2 parents 645a4ae + 2277ce1 commit b703708

File tree

249 files changed

+5496
-3071
lines changed

Some content is hidden

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

249 files changed

+5496
-3071
lines changed

THIRD-PARTY-NOTICES.txt

Lines changed: 732 additions & 0 deletions
Large diffs are not rendered by default.

eng/Version.Details.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -339,20 +339,20 @@
339339
<SourceBuild RepoName="source-build-reference-packages" ManagedOnly="true" />
340340
</Dependency>
341341
<!-- Not updated automatically -->
342-
<Dependency Name="Microsoft.CodeAnalysis.Common" Version="4.7.0-3.23314.3">
342+
<Dependency Name="Microsoft.CodeAnalysis.Common" Version="4.8.0-3.23518.7">
343343
<Uri>https://github.com/dotnet/roslyn</Uri>
344344
<Sha>1aa759af23d2a29043ea44fcef5bd6823dafa5d0</Sha>
345345
<SourceBuild RepoName="roslyn" ManagedOnly="true" />
346346
</Dependency>
347-
<Dependency Name="Microsoft.CodeAnalysis.ExternalAccess.AspNetCore" Version="4.7.0-3.23314.3">
347+
<Dependency Name="Microsoft.CodeAnalysis.ExternalAccess.AspNetCore" Version="4.8.0-3.23518.7">
348348
<Uri>https://github.com/dotnet/roslyn</Uri>
349349
<Sha>1aa759af23d2a29043ea44fcef5bd6823dafa5d0</Sha>
350350
</Dependency>
351-
<Dependency Name="Microsoft.CodeAnalysis.CSharp" Version="4.7.0-3.23314.3">
351+
<Dependency Name="Microsoft.CodeAnalysis.CSharp" Version="4.8.0-3.23518.7">
352352
<Uri>https://github.com/dotnet/roslyn</Uri>
353353
<Sha>1aa759af23d2a29043ea44fcef5bd6823dafa5d0</Sha>
354354
</Dependency>
355-
<Dependency Name="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.7.0-3.23314.3">
355+
<Dependency Name="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.8.0-3.23518.7">
356356
<Uri>https://github.com/dotnet/roslyn</Uri>
357357
<Sha>1aa759af23d2a29043ea44fcef5bd6823dafa5d0</Sha>
358358
</Dependency>

eng/Versions.props

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -150,10 +150,10 @@
150150
<MicrosoftEntityFrameworkCoreVersion>9.0.0-alpha.1.23524.8</MicrosoftEntityFrameworkCoreVersion>
151151
<MicrosoftEntityFrameworkCoreDesignVersion>9.0.0-alpha.1.23524.8</MicrosoftEntityFrameworkCoreDesignVersion>
152152
<!-- Packages from dotnet/roslyn -->
153-
<MicrosoftCodeAnalysisCommonVersion>4.7.0-3.23314.3</MicrosoftCodeAnalysisCommonVersion>
154-
<MicrosoftCodeAnalysisExternalAccessAspNetCoreVersion>4.7.0-3.23314.3</MicrosoftCodeAnalysisExternalAccessAspNetCoreVersion>
155-
<MicrosoftCodeAnalysisCSharpVersion>4.7.0-3.23314.3</MicrosoftCodeAnalysisCSharpVersion>
156-
<MicrosoftCodeAnalysisCSharpWorkspacesVersion>4.7.0-3.23314.3</MicrosoftCodeAnalysisCSharpWorkspacesVersion>
153+
<MicrosoftCodeAnalysisCommonVersion>4.8.0-3.23518.7</MicrosoftCodeAnalysisCommonVersion>
154+
<MicrosoftCodeAnalysisExternalAccessAspNetCoreVersion>4.8.0-3.23518.7</MicrosoftCodeAnalysisExternalAccessAspNetCoreVersion>
155+
<MicrosoftCodeAnalysisCSharpVersion>4.8.0-3.23518.7</MicrosoftCodeAnalysisCSharpVersion>
156+
<MicrosoftCodeAnalysisCSharpWorkspacesVersion>4.8.0-3.23518.7</MicrosoftCodeAnalysisCSharpWorkspacesVersion>
157157
<!-- Packages from NuGet/Nuget.client -->
158158
<!-- If you update these versions, make sure to also update https://github.com/dotnet/aspnetcore/blob/main/eng/SourceBuildPrebuiltBaseline.xml -->
159159
<NuGetPackagingVersion>6.2.4</NuGetPackagingVersion>
@@ -247,11 +247,11 @@
247247
<Analyzer_MicrosoftCodeAnalysisCSharpWorkspacesVersion>3.3.1</Analyzer_MicrosoftCodeAnalysisCSharpWorkspacesVersion>
248248
<!-- Pin the version of the M.CA dependencies that we utilize with a cutom version property $(MicrosoftCodeAnalysisVersion_LatestVS) to avoid automatically
249249
consuming the newest version of the packages when using the $(MicrosoftCodeAnalysisCSharpVersion) properties in source-build. -->
250-
<MicrosoftCodeAnalysisVersion_LatestVS>4.7.0-3.23314.3</MicrosoftCodeAnalysisVersion_LatestVS>
251-
<MicrosoftCodeAnalysisExternalAccessAspNetCoreVersion>4.7.0-3.23314.3</MicrosoftCodeAnalysisExternalAccessAspNetCoreVersion>
252-
<MicrosoftCodeAnalysisCommonVersion>4.7.0-3.23314.3</MicrosoftCodeAnalysisCommonVersion>
253-
<MicrosoftCodeAnalysisCSharpVersion>4.7.0-3.23314.3</MicrosoftCodeAnalysisCSharpVersion>
254-
<MicrosoftCodeAnalysisCSharpWorkspacesVersion>4.7.0-3.23314.3</MicrosoftCodeAnalysisCSharpWorkspacesVersion>
250+
<MicrosoftCodeAnalysisVersion_LatestVS>4.8.0-3.23518.7</MicrosoftCodeAnalysisVersion_LatestVS>
251+
<MicrosoftCodeAnalysisExternalAccessAspNetCoreVersion>4.8.0-3.23518.7</MicrosoftCodeAnalysisExternalAccessAspNetCoreVersion>
252+
<MicrosoftCodeAnalysisCommonVersion>4.8.0-3.23518.7</MicrosoftCodeAnalysisCommonVersion>
253+
<MicrosoftCodeAnalysisCSharpVersion>4.8.0-3.23518.7</MicrosoftCodeAnalysisCSharpVersion>
254+
<MicrosoftCodeAnalysisCSharpWorkspacesVersion>4.8.0-3.23518.7</MicrosoftCodeAnalysisCSharpWorkspacesVersion>
255255
<MicrosoftCodeAnalysisPublicApiAnalyzersVersion>3.3.3</MicrosoftCodeAnalysisPublicApiAnalyzersVersion>
256256
<MicrosoftCodeAnalysisCSharpAnalyzerTestingXUnitVersion>1.1.2-beta1.23371.1</MicrosoftCodeAnalysisCSharpAnalyzerTestingXUnitVersion>
257257
<MicrosoftCodeAnalysisCSharpCodeFixTestingXUnitVersion>1.1.2-beta1.23371.1</MicrosoftCodeAnalysisCSharpCodeFixTestingXUnitVersion>

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,9 @@ Microsoft.AspNetCore.Components.RenderHandle.DispatchExceptionAsync(System.Excep
2626
*REMOVED*Microsoft.AspNetCore.Components.NavigationManager.ToAbsoluteUri(string! relativeUri) -> System.Uri!
2727
Microsoft.AspNetCore.Components.NavigationManager.ToAbsoluteUri(string? relativeUri) -> System.Uri!
2828
Microsoft.AspNetCore.Components.Rendering.ComponentState.LogicalParentComponentState.get -> Microsoft.AspNetCore.Components.Rendering.ComponentState?
29-
Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder.AddComponentParameter(int sequence, string! name, Microsoft.AspNetCore.Components.IComponentRenderMode! renderMode) -> void
3029
*REMOVED*Microsoft.AspNetCore.Components.RouteData.RouteData(System.Type! pageType, System.Collections.Generic.IReadOnlyDictionary<string!, object!>! routeValues) -> void
3130
*REMOVED*Microsoft.AspNetCore.Components.RouteData.RouteValues.get -> System.Collections.Generic.IReadOnlyDictionary<string!, object!>!
32-
Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder.AddComponentRenderMode(Microsoft.AspNetCore.Components.IComponentRenderMode! renderMode) -> void
31+
Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder.AddComponentRenderMode(Microsoft.AspNetCore.Components.IComponentRenderMode? renderMode) -> void
3332
Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder.AddNamedEvent(string! eventType, string! assignedName) -> void
3433
Microsoft.AspNetCore.Components.RenderTree.ComponentFrameFlags
3534
Microsoft.AspNetCore.Components.RenderTree.ComponentFrameFlags.HasCallerSpecifiedRenderMode = 1 -> Microsoft.AspNetCore.Components.RenderTree.ComponentFrameFlags

src/Components/Components/src/Rendering/RenderTreeBuilder.cs

Lines changed: 6 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ public sealed class RenderTreeBuilder : IDisposable
2727
private RenderTreeFrameType? _lastNonAttributeFrameType;
2828
private bool _hasSeenAddMultipleAttributes;
2929
private Dictionary<string, int>? _seenAttributeNames;
30-
private IComponentRenderMode? _pendingComponentCallSiteRenderMode; // TODO: Remove when Razor compiler supports call-site @rendermode
31-
private string? _pendingNamedSubmitEvent; // TODO: Remove when Razor compiler supports @formname
3230

3331
/// <summary>
3432
/// The reserved parameter name used for supplying child content.
@@ -45,8 +43,6 @@ public sealed class RenderTreeBuilder : IDisposable
4543
/// <param name="elementName">A value representing the type of the element.</param>
4644
public void OpenElement(int sequence, string elementName)
4745
{
48-
CompletePendingNamedSubmitEvent();
49-
5046
// We are entering a new scope, since we track the "duplicate attributes" per
5147
// element/component we might need to clean them up now.
5248
if (_hasSeenAddMultipleAttributes)
@@ -66,8 +62,6 @@ public void OpenElement(int sequence, string elementName)
6662
/// </summary>
6763
public void CloseElement()
6864
{
69-
CompletePendingNamedSubmitEvent();
70-
7165
var indexOfEntryBeingClosed = _openElementIndices.Pop();
7266

7367
// We might be closing an element with only attributes, run the duplicate cleanup pass
@@ -80,16 +74,6 @@ public void CloseElement()
8074
_entries.Buffer[indexOfEntryBeingClosed].ElementSubtreeLengthField = _entries.Count - indexOfEntryBeingClosed;
8175
}
8276

83-
// TODO: Remove this once Razor supports @formname
84-
private void CompletePendingNamedSubmitEvent()
85-
{
86-
if (_pendingNamedSubmitEvent is not null)
87-
{
88-
AddNamedEvent("onsubmit", _pendingNamedSubmitEvent);
89-
_pendingNamedSubmitEvent = default;
90-
}
91-
}
92-
9377
/// <summary>
9478
/// Appends a frame representing markup content.
9579
/// </summary>
@@ -237,16 +221,7 @@ public void AddAttribute(int sequence, string name, string? value)
237221
AssertCanAddAttribute();
238222
if (value != null || _lastNonAttributeFrameType == RenderTreeFrameType.Component)
239223
{
240-
// TODO: Remove this once the Razor compiler is updated to support @formname
241-
// That should compile directly as a call to AddNamedEvent.
242-
if (string.Equals(name, "@formname", StringComparison.Ordinal) && _lastNonAttributeFrameType == RenderTreeFrameType.Element)
243-
{
244-
_pendingNamedSubmitEvent = value!;
245-
}
246-
else
247-
{
248-
_entries.AppendAttribute(sequence, name, value);
249-
}
224+
_entries.AppendAttribute(sequence, name, value);
250225
}
251226
else
252227
{
@@ -530,28 +505,6 @@ public void OpenComponent(int sequence, [DynamicallyAccessedMembers(Component)]
530505
OpenComponentUnchecked(sequence, componentType);
531506
}
532507

533-
/// <summary>
534-
/// Temporary API until Razor compiler is updated. This will be removed before .NET 8 ships.
535-
/// </summary>
536-
public void AddComponentParameter(int sequence, string name, IComponentRenderMode renderMode)
537-
{
538-
if (string.Equals(name, "@rendermode", StringComparison.Ordinal))
539-
{
540-
// When the Razor compiler is updated, <SomeComponent @rendermode="@RenderMode.WebAssembly" /> would compile directly as a call
541-
// to AddComponentRenderMode(RenderMode.WebAssembly), which must appear after all attributes. Until then we'll intercept regular
542-
// parameters with this name and IComponentRenderMode values. Unfortunately we can't guarantee that the parameter will appear after
543-
// all other parameters (e.g., ChildContent would always go later), so use this inefficient trick to defer adding it.
544-
// It won't be needed once the Razor compiler supports @rendermode.
545-
_pendingComponentCallSiteRenderMode = renderMode;
546-
}
547-
else
548-
{
549-
// For other parameter names, the developer is doing something custom so just pass the parameter as normal
550-
// This special case will also not be relevant once we have @rendermode
551-
AddComponentParameter(sequence, name, (object)renderMode);
552-
}
553-
}
554-
555508
/// <summary>
556509
/// Appends a frame representing a component parameter.
557510
/// </summary>
@@ -600,8 +553,6 @@ public void SetKey(object? value)
600553

601554
private void OpenComponentUnchecked(int sequence, [DynamicallyAccessedMembers(Component)] Type componentType)
602555
{
603-
CompletePendingNamedSubmitEvent();
604-
605556
// We are entering a new scope, since we track the "duplicate attributes" per
606557
// element/component we might need to clean them up now.
607558
if (_hasSeenAddMultipleAttributes)
@@ -621,12 +572,6 @@ private void OpenComponentUnchecked(int sequence, [DynamicallyAccessedMembers(Co
621572
/// </summary>
622573
public void CloseComponent()
623574
{
624-
if (_pendingComponentCallSiteRenderMode is not null)
625-
{
626-
AddComponentRenderMode(_pendingComponentCallSiteRenderMode);
627-
_pendingComponentCallSiteRenderMode = null;
628-
}
629-
630575
var indexOfEntryBeingClosed = _openElementIndices.Pop();
631576

632577
// We might be closing a component with only attributes. Run the attribute cleanup pass
@@ -682,9 +627,12 @@ public void AddComponentReferenceCapture(int sequence, Action<object> componentR
682627
/// Adds a frame indicating the render mode on the enclosing component frame.
683628
/// </summary>
684629
/// <param name="renderMode">The <see cref="IComponentRenderMode"/>.</param>
685-
public void AddComponentRenderMode(IComponentRenderMode renderMode)
630+
public void AddComponentRenderMode(IComponentRenderMode? renderMode)
686631
{
687-
ArgumentNullException.ThrowIfNull(renderMode);
632+
if (renderMode is null)
633+
{
634+
return;
635+
}
688636

689637
// Note that a ComponentRenderMode frame is technically a child of the Component frame to which it applies,
690638
// hence the terminology of "adding" it rather than "setting" it. For performance reasons, the diffing system

src/Components/Components/test/Rendering/RenderTreeBuilderTest.cs

Lines changed: 15 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -2141,18 +2141,26 @@ public void CannotAddComponentRenderModeToElement()
21412141
}
21422142

21432143
[Fact]
2144-
public void CannotAddNullComponentRenderMode()
2144+
public void CanAddNullComponentRenderMode()
21452145
{
21462146
// Arrange
21472147
var builder = new RenderTreeBuilder();
2148+
2149+
// Act
21482150
builder.OpenComponent<TestComponent>(0);
2151+
builder.AddComponentParameter(1, "param", 123);
2152+
builder.AddComponentRenderMode(null);
2153+
builder.CloseComponent();
21492154

2150-
// Act/Assert
2151-
var ex = Assert.Throws<ArgumentNullException>(() =>
2152-
{
2153-
builder.AddComponentRenderMode(null);
2154-
});
2155-
Assert.Equal("renderMode", ex.ParamName);
2155+
// Assert
2156+
Assert.Collection(
2157+
builder.GetFrames().AsEnumerable(),
2158+
frame =>
2159+
{
2160+
AssertFrame.Component<TestComponent>(frame, 2, 0);
2161+
Assert.False(frame.ComponentFrameFlags.HasFlag(ComponentFrameFlags.HasCallerSpecifiedRenderMode));
2162+
},
2163+
frame => AssertFrame.Attribute(frame, "param", 123, 1));
21562164
}
21572165

21582166
[Fact]
@@ -2171,39 +2179,6 @@ public void CannotAddParametersAfterComponentRenderMode()
21712179
Assert.Equal($"Component parameters may only be added immediately after frames of type {RenderTreeFrameType.Component}", ex.Message);
21722180
}
21732181

2174-
[Fact]
2175-
public void TemporaryApiForCallSiteComponentRenderModeWorksEvenIfOtherParameterAddedAfter()
2176-
{
2177-
// For the temporary syntax rendermode=@something (as opposed to @rendermode=@something), we can't guarantee
2178-
// the Razor compiler will emit the AddComponentParameter call for rendermode last. For example if there's a
2179-
// ChildContent it will actually emit that last. So for the temporary syntax to be usable it has to support
2180-
// other component parameters being added afterwards, even though that does not need to be supported for
2181-
// AddComponentRenderMode (since the compiler can be sure to add that after all component parameters).
2182-
2183-
// Arrange
2184-
var builder = new RenderTreeBuilder();
2185-
var renderMode = new TestRenderMode();
2186-
2187-
// Act
2188-
builder.OpenComponent<TestComponent>(0);
2189-
builder.AddComponentParameter(1, "param", 123);
2190-
builder.AddComponentParameter(2, "@rendermode", renderMode);
2191-
builder.AddComponentParameter(3, "anotherparam", 456);
2192-
builder.CloseComponent();
2193-
2194-
// Assert
2195-
Assert.Collection(
2196-
builder.GetFrames().AsEnumerable(),
2197-
frame =>
2198-
{
2199-
AssertFrame.Component<TestComponent>(frame, 4, 0);
2200-
Assert.True(frame.ComponentFrameFlags.HasFlag(ComponentFrameFlags.HasCallerSpecifiedRenderMode));
2201-
},
2202-
frame => AssertFrame.Attribute(frame, "param", 123, 1),
2203-
frame => AssertFrame.Attribute(frame, "anotherparam", 456, 3),
2204-
frame => AssertFrame.ComponentRenderMode(frame, renderMode));
2205-
}
2206-
22072182
[Fact]
22082183
public void CanAddNamedEvent()
22092184
{
@@ -2301,34 +2276,6 @@ public void CannotAddAttributesAfterNamedEvent()
23012276
Assert.Equal($"Attributes may only be added immediately after frames of type {RenderTreeFrameType.Element} or {RenderTreeFrameType.Component}", ex.Message);
23022277
}
23032278

2304-
[Fact]
2305-
public void TemporaryApiForFormNameEventsWorksEvenIfAttributesAddedAfter()
2306-
{
2307-
// TODO: Remove this once the Razor compiler is updated to support @formname directly
2308-
2309-
// Arrange
2310-
var builder = new RenderTreeBuilder();
2311-
var renderMode = new TestRenderMode();
2312-
2313-
// Act
2314-
builder.OpenElement(0, "div");
2315-
builder.AddAttribute(1, "attr1", 123);
2316-
builder.AddAttribute(2, "@formname", "some custom name");
2317-
builder.AddAttribute(3, "attr2", 456);
2318-
builder.OpenElement(4, "other");
2319-
builder.CloseElement();
2320-
builder.CloseElement();
2321-
2322-
// Assert
2323-
Assert.Collection(
2324-
builder.GetFrames().AsEnumerable(),
2325-
frame => AssertFrame.Element(frame, "div", 5, 0),
2326-
frame => AssertFrame.Attribute(frame, "attr1", "123", 1),
2327-
frame => AssertFrame.Attribute(frame, "attr2", "456", 3),
2328-
frame => AssertFrame.NamedEvent(frame, "onsubmit", "some custom name"),
2329-
frame => AssertFrame.Element(frame, "other", 1));
2330-
}
2331-
23322279
private class TestComponent : IComponent
23332280
{
23342281
public void Attach(RenderHandle renderHandle) { }

src/Components/ComponentsNoDeps.slnf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"src\\Components\\Components\\perf\\Microsoft.AspNetCore.Components.Performance.csproj",
1010
"src\\Components\\Components\\src\\Microsoft.AspNetCore.Components.csproj",
1111
"src\\Components\\Components\\test\\Microsoft.AspNetCore.Components.Tests.csproj",
12+
"src\\Components\\CustomElements\\src\\Microsoft.AspNetCore.Components.CustomElements.csproj",
1213
"src\\Components\\Endpoints\\src\\Microsoft.AspNetCore.Components.Endpoints.csproj",
1314
"src\\Components\\Endpoints\\test\\Microsoft.AspNetCore.Components.Endpoints.Tests.csproj",
1415
"src\\Components\\Forms\\src\\Microsoft.AspNetCore.Components.Forms.csproj",

0 commit comments

Comments
 (0)