Make View types in app assembly internal - #30891
Closed
captainsafia wants to merge 4 commits into
Closed
Conversation
captainsafia
force-pushed
the
safia/fix-public-types
branch
from
March 15, 2021 18:09
130d93b to
03a8b1f
Compare
captainsafia
force-pushed
the
safia/fix-public-types
branch
from
March 15, 2021 18:51
03a8b1f to
554c21b
Compare
captainsafia
marked this pull request as ready for review
March 16, 2021 04:49
pranavkm
reviewed
Mar 16, 2021
| _razorLanguageVersion = razorLanguageVersion; | ||
| } | ||
|
|
||
| // ConsolidatedMvcViewDocumentClassifier should not apply for design time |
| // 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; |
Contributor
There was a problem hiding this comment.
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?
Comment on lines
+30
to
+31
|
|
||
|
|
Comment on lines
+60
to
+61
|
|
||
|
|
|
|
||
| @class.BaseType = "global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<TModel>"; | ||
| @class.Modifiers.Clear(); | ||
| @class.Modifiers.Add("internal"); |
Contributor
There was a problem hiding this comment.
Could we also toss in sealed?
| <PublishWindowsPdb>true</PublishWindowsPdb> | ||
| <!-- Need to build this project in source build --> | ||
| <ExcludeFromSourceBuild>false</ExcludeFromSourceBuild> | ||
| <NoWarn>RS0016;RS0017</NoWarn> |
| builder.Features.Add(new RazorPageDocumentClassifierPass()); | ||
| builder.Features.Add(new MvcViewDocumentClassifierPass()); | ||
|
|
||
| builder.Features.Add(new ConsolidatedMvcViewDocumentClassifierPass(builder.Configuration.LanguageVersion)); |
Contributor
There was a problem hiding this comment.
Could we accept an option here? bool generateConsolidatedViews or something like that?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ConsolidatedMvcViewDocumentClassifierPassthat's applied on source generator scenariosinternalApsNetCoreGeneratedDocumentnamespace