-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Make View types in app assembly internal #30891
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
Conversation
130d93b
to
03a8b1f
Compare
03a8b1f
to
554c21b
Compare
_razorLanguageVersion = razorLanguageVersion; | ||
} | ||
|
||
// ConsolidatedMvcViewDocumentClassifier should not apply for design time |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is that?
// intended to be used alongside source generator support in the Razor compiler. | ||
protected override bool IsMatch(RazorCodeDocument codeDocument, DocumentIntermediateNode documentNode) | ||
{ | ||
return documentNode.Options.DesignTime != true && _razorLanguageVersion == RazorLanguageVersion.Latest; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right now RazorLangVersion.Latest = 5.0 which would mean this applies to .net5.0 apps. I think you would need to invent a new version. Alternatively, could we add an option in RazorExtensions.Register
that causes this type to be used?
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
@class.BaseType = "global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<TModel>"; | ||
@class.Modifiers.Clear(); | ||
@class.Modifiers.Add("internal"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we also toss in sealed
?
@@ -7,6 +7,7 @@ | |||
<PublishWindowsPdb>true</PublishWindowsPdb> | |||
<!-- Need to build this project in source build --> | |||
<ExcludeFromSourceBuild>false</ExcludeFromSourceBuild> | |||
<NoWarn>RS0016;RS0017</NoWarn> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's this for?
@@ -37,7 +37,9 @@ public static void Register(RazorProjectEngineBuilder builder) | |||
builder.Features.Add(new PagesPropertyInjectionPass()); | |||
builder.Features.Add(new ViewComponentTagHelperPass()); | |||
builder.Features.Add(new RazorPageDocumentClassifierPass()); | |||
builder.Features.Add(new MvcViewDocumentClassifierPass()); | |||
|
|||
builder.Features.Add(new ConsolidatedMvcViewDocumentClassifierPass(builder.Configuration.LanguageVersion)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we accept an option here? bool generateConsolidatedViews
or something like that?
ConsolidatedMvcViewDocumentClassifierPass
that's applied on source generator scenariosinternal
ApsNetCoreGeneratedDocument
namespace