Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calculate SuppressAddComponentParameter in tooling #10763

Merged
merged 30 commits into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
c92386f
Add boolean
ryzngard Aug 19, 2024
45334b8
Calculate the value and plumb it through
ryzngard Aug 19, 2024
7fc2352
Bump serialization version
ryzngard Aug 19, 2024
6794130
Add missing property write for json
ryzngard Aug 19, 2024
e685ca5
PR feedback
ryzngard Aug 20, 2024
5cca44c
Missed some
ryzngard Aug 20, 2024
017a513
Space and bump json version
ryzngard Aug 20, 2024
c77bce3
Fix test
ryzngard Aug 20, 2024
a3bab60
Fix test data and bug in message pack formatter
ryzngard Aug 20, 2024
cc8f604
No need to update this...
ryzngard Aug 21, 2024
d3647a9
Remove existing configurable code generation option and just use it f…
chsienki Aug 26, 2024
eca23cb
Merge branch 'main' into SuppressAddComponentParameter
ryzngard Aug 29, 2024
1f23c67
Remove unused member
ryzngard Aug 29, 2024
353e217
PR feedback
ryzngard Aug 29, 2024
dcc4fe8
Update src/Shared/Microsoft.AspNetCore.Razor.Serialization.Json/Objec…
ryzngard Sep 3, 2024
3d2f246
Undo unrelated changes
ryzngard Sep 3, 2024
b108d41
Fix compilation issue and add debug assert
ryzngard Sep 3, 2024
4750b83
Merge branch 'main' into SuppressAddComponentParameter
ryzngard Sep 5, 2024
66c1790
Update src/Razor/src/Microsoft.AspNetCore.Razor.ProjectEngineHost/Uti…
ryzngard Sep 5, 2024
73cfa13
Update src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/ProjectSyste…
ryzngard Sep 5, 2024
41f69f9
Merge branch 'SuppressAddComponentParameter' of https://github.com/ry…
ryzngard Sep 5, 2024
4cf5339
Merge branch 'main' into SuppressAddComponentParameter
ryzngard Sep 10, 2024
4347cc3
Serialize UseConsolidatedMvcViews
ryzngard Sep 10, 2024
1e2b4b0
Fix compilation. Move server flags to end since they are much more in…
ryzngard Sep 10, 2024
5681389
Update RemoteProjectSnapshot.cs
ryzngard Sep 10, 2024
b28e503
Merge branch 'main' into SuppressAddComponentParameter
ryzngard Sep 18, 2024
15e1635
Set flag based on configuration
ryzngard Sep 18, 2024
72d5e84
Set options builder
ryzngard Sep 18, 2024
2205c2e
PR feedback. Reduce references for compilation
ryzngard Sep 18, 2024
4117df5
Fix tests
ryzngard Sep 18, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ public override RazorConfiguration Deserialize(ref MessagePackReader reader, Ser
var configurationName = CachedStringFormatter.Instance.Deserialize(ref reader, options) ?? string.Empty;
var languageVersionText = CachedStringFormatter.Instance.Deserialize(ref reader, options) ?? string.Empty;
var suppressAddComponentParameter = reader.ReadBoolean();
var useConsolidatedMvcViews = reader.ReadBoolean();

count -= 3;
count -= 4;

using var builder = new PooledArrayBuilder<RazorExtension>();

Expand All @@ -40,14 +41,19 @@ public override RazorConfiguration Deserialize(ref MessagePackReader reader, Ser
? version
: RazorLanguageVersion.Version_2_1;

return new(languageVersion, configurationName, extensions, SuppressAddComponentParameter: suppressAddComponentParameter);
return new(
languageVersion,
configurationName,
extensions,
UseConsolidatedMvcViews: useConsolidatedMvcViews,
SuppressAddComponentParameter: suppressAddComponentParameter);
ryzngard marked this conversation as resolved.
Show resolved Hide resolved
}

public override void Serialize(ref MessagePackWriter writer, RazorConfiguration value, SerializerCachingOptions options)
{
// Write 3 values + 1 value per extension.
// Write 4 values + 1 value per extension.
var extensions = value.Extensions;
var count = extensions.Length + 3;
var count = extensions.Length + 4;

writer.WriteArrayHeader(count);

Expand All @@ -63,8 +69,9 @@ public override void Serialize(ref MessagePackWriter writer, RazorConfiguration
}

writer.Write(value.SuppressAddComponentParameter);
ryzngard marked this conversation as resolved.
Show resolved Hide resolved
writer.Write(value.UseConsolidatedMvcViews);

count -= 3;
count -= 4;

for (var i = 0; i < count; i++)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ private static RazorConfiguration ComputeRazorConfigurationOptions(AnalyzerConfi
configurationName,
Extensions: [],
UseConsolidatedMvcViews: true,
suppressAddComponentParameter);
SuppressAddComponentParameter: suppressAddComponentParameter);
ryzngard marked this conversation as resolved.
Show resolved Hide resolved

defaultNamespace = rootNamespace ?? "ASP"; // TODO: Source generator does this. Do we want it?

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public static RazorConfiguration ReadConfigurationFromProperties(JsonDataReader
var configurationName = reader.ReadNonNullString(nameof(RazorConfiguration.ConfigurationName));
var languageVersionText = reader.ReadNonNullString(nameof(RazorConfiguration.LanguageVersion));
var suppressAddComponentParameter = reader.ReadBooleanOrFalse(nameof(RazorConfiguration.SuppressAddComponentParameter));
ryzngard marked this conversation as resolved.
Show resolved Hide resolved
var useConsolidatedMvcViews = reader.ReadBooleanOrTrue(nameof(RazorConfiguration.UseConsolidatedMvcViews));
var extensions = reader.ReadImmutableArrayOrEmpty(nameof(RazorConfiguration.Extensions),
static r =>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public static void WriteProperties(JsonDataWriter writer, RazorConfiguration val
writer.Write(nameof(value.LanguageVersion), languageVersionText);

writer.WriteIfNotFalse(nameof(value.SuppressAddComponentParameter), value.SuppressAddComponentParameter);
ryzngard marked this conversation as resolved.
Show resolved Hide resolved
writer.WriteIfNotTrue(nameof(value.UseConsolidatedMvcViews), value.UseConsolidatedMvcViews);

writer.WriteArrayIfNotNullOrEmpty(nameof(value.Extensions), value.Extensions, static (w, v) => w.Write(v.ExtensionName));
}
Expand Down
Loading