Skip to content

Commit 2654bc4

Browse files
TagHelperCollection Part 2: Mechanical Updates (#12505)
| [Prelude](#12503) | [Part 1](#12504) | Part 2 | [Part 3](#12506) | [Part 4](#12507) | [Part 5](#12509) | > [!WARNING] > This pull request contains breaking changes for the RazorSdk. Once this is merged and flows to the VMR, dotnet/dotnet@9a7e708 will need to be cherry-picked to resolve build breaks in `src/sdk/src/RazorSdk`. These commits represent the (mostly) mechanical changes needed to integrate `TagHelperCollection` across the Razor code base. Most references to `ImmutableArrary<TagHelperDescriptor>`, `IReadOnlyList<TagHelperDescriptor>`, `IEnumerable<TagHelperDescriptor>`, and `TagHelperDescriptor[]` have been replaced with `TagHelperCollection`. This is **by far** the largest of the `TagHelperCollection` pull requests. While most of the commits contain mechanical changes across the code base, there are few that include more substantial work that require a bit more scrutiny: - **Update `RenameService` to remove `ImmutableArray<TagHelperDescriptor>`** (fa3ad2b) This includes a fair amount of refactoring in `RenameService` to fix bugs found when moving to `TagHelperCollection`. - **Update `TagHelperFacts` to use `TagHelperCollection`** Extra work was done in `DirectiveAttributeComplationItemProvider` to clean up a bit following #12473. ---- CI Build: https://dev.azure.com/dnceng/internal/_build/results?buildId=2842165&view=results Toolset Run: https://dev.azure.com/dnceng/internal/_build/results?buildId=2842237&view=results
2 parents d964cd9 + fe38743 commit 2654bc4

File tree

148 files changed

+3538
-3954
lines changed

Some content is hidden

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

148 files changed

+3538
-3954
lines changed

src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/IntegrationTests/InstrumentationPassIntegrationTest.cs

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -31,36 +31,36 @@ public InstrumentationPassIntegrationTest()
3131
public void BasicTest()
3232
{
3333
// Arrange
34-
var descriptors = new[]
35-
{
36-
CreateTagHelperDescriptor(
37-
tagName: "p",
38-
typeName: "PTagHelper",
39-
assemblyName: "TestAssembly"),
40-
CreateTagHelperDescriptor(
41-
tagName: "form",
42-
typeName: "FormTagHelper",
43-
assemblyName: "TestAssembly"),
44-
CreateTagHelperDescriptor(
45-
tagName: "input",
46-
typeName: "InputTagHelper",
47-
assemblyName: "TestAssembly",
48-
attributes: new Action<BoundAttributeDescriptorBuilder>[]
49-
{
50-
builder => builder
51-
.Name("value")
52-
.PropertyName("FooProp")
53-
.TypeName("System.String"), // Gets preallocated
54-
builder => builder
55-
.Name("date")
56-
.PropertyName("BarProp")
57-
.TypeName("System.DateTime"), // Doesn't get preallocated
58-
})
59-
};
34+
TagHelperCollection tagHelpers =
35+
[
36+
CreateTagHelperDescriptor(
37+
tagName: "p",
38+
typeName: "PTagHelper",
39+
assemblyName: "TestAssembly"),
40+
CreateTagHelperDescriptor(
41+
tagName: "form",
42+
typeName: "FormTagHelper",
43+
assemblyName: "TestAssembly"),
44+
CreateTagHelperDescriptor(
45+
tagName: "input",
46+
typeName: "InputTagHelper",
47+
assemblyName: "TestAssembly",
48+
attributes:
49+
[
50+
builder => builder
51+
.Name("value")
52+
.PropertyName("FooProp")
53+
.TypeName("System.String"), // Gets preallocated
54+
builder => builder
55+
.Name("date")
56+
.PropertyName("BarProp")
57+
.TypeName("System.DateTime"), // Doesn't get preallocated
58+
])
59+
];
6060

6161
var engine = CreateProjectEngine(b =>
6262
{
63-
b.AddTagHelpers(descriptors);
63+
b.SetTagHelpers(tagHelpers);
6464
b.Features.Add(new InstrumentationPass());
6565

6666
// This test includes templates

0 commit comments

Comments
 (0)