Skip to content
This repository was archived by the owner on Dec 14, 2018. It is now read-only.

Commit fe1f9fb

Browse files
committed
More cleanup
1 parent ca8e1a0 commit fe1f9fb

File tree

14 files changed

+15
-383
lines changed

14 files changed

+15
-383
lines changed

build/dependencies.props

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,7 @@
4040
<MicrosoftAspNetCoreJsonPatchPackageVersion>3.0.0-alpha1-10742</MicrosoftAspNetCoreJsonPatchPackageVersion>
4141
<MicrosoftAspNetCoreLocalizationPackageVersion>3.0.0-alpha1-10742</MicrosoftAspNetCoreLocalizationPackageVersion>
4242
<MicrosoftAspNetCoreLocalizationRoutingPackageVersion>3.0.0-alpha1-10742</MicrosoftAspNetCoreLocalizationRoutingPackageVersion>
43-
<MicrosoftAspNetCoreMvcRazorExtensionsPackageVersion>3.0.0-alpha1-10742</MicrosoftAspNetCoreMvcRazorExtensionsPackageVersion>
4443
<MicrosoftAspNetCoreRangeHelperSourcesPackageVersion>3.0.0-alpha1-10742</MicrosoftAspNetCoreRangeHelperSourcesPackageVersion>
45-
<MicrosoftAspNetCoreRazorLanguagePackageVersion>3.0.0-alpha1-10742</MicrosoftAspNetCoreRazorLanguagePackageVersion>
4644
<MicrosoftAspNetCoreRazorRuntimePackageVersion>3.0.0-alpha1-10742</MicrosoftAspNetCoreRazorRuntimePackageVersion>
4745
<MicrosoftAspNetCoreRazorTagHelpersTestingSourcesPackageVersion>3.0.0-alpha1-10742</MicrosoftAspNetCoreRazorTagHelpersTestingSourcesPackageVersion>
4846
<MicrosoftAspNetCoreResponseCachingAbstractionsPackageVersion>3.0.0-alpha1-10742</MicrosoftAspNetCoreResponseCachingAbstractionsPackageVersion>

src/Microsoft.AspNetCore.Mvc.Razor/Compilation/CompiledViewDescriptor.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ public CompiledViewDescriptor(RazorCompiledItem item, RazorViewAttribute attribu
5151
// later.
5252
ExpirationTokens = Array.Empty<IChangeToken>();
5353
RelativePath = ViewPath.NormalizePath(item?.Identifier ?? attribute.Path);
54-
IsPrecompiled = true;
5554
}
5655

5756
/// <summary>
@@ -72,11 +71,6 @@ public CompiledViewDescriptor(RazorCompiledItem item, RazorViewAttribute attribu
7271
/// </summary>
7372
public IList<IChangeToken> ExpirationTokens { get; set; }
7473

75-
/// <summary>
76-
/// Gets a value that determines if the view is precompiled.
77-
/// </summary>
78-
public bool IsPrecompiled { get; set; }
79-
8074
/// <summary>
8175
/// Gets the <see cref="RazorCompiledItem"/> descriptor for this view.
8276
/// </summary>

src/Microsoft.AspNetCore.Mvc.Razor/Compilation/RazorViewCompiler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public RazorViewCompiler(
5151

5252
if (!_compiledViews.ContainsKey(compiledView.RelativePath))
5353
{
54-
// View ordering has precedence semantics, a view with a higher precedence was
54+
// View ordering has precedence semantics, a view with a higher precedence was not
5555
// already added to the list.
5656
_compiledViews.Add(compiledView.RelativePath, Task.FromResult(compiledView));
5757
}

src/Microsoft.AspNetCore.Mvc.Razor/Compilation/ViewsFeatureProvider.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ public void PopulateFeature(IEnumerable<ApplicationPart> parts, ViewsFeature fea
5050
ExpirationTokens = Array.Empty<IChangeToken>(),
5151
RelativePath = relativePath,
5252
ViewAttribute = attribute,
53-
IsPrecompiled = true,
5453
};
5554

5655
feature.ViewDescriptors.Add(viewDescriptor);

src/Microsoft.AspNetCore.Mvc.Razor/Microsoft.AspNetCore.Mvc.Razor.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
repositoryUrl=$(RepositoryUrl);
4242
repositoryCommit=$(RepositoryCommit);
4343
targetframework=$(TargetFramework);
44-
MicrosoftAspNetCoreMvcRazorExtensionsPackageVersion=$(MicrosoftAspNetCoreMvcRazorExtensionsPackageVersion);
4544
MicrosoftAspNetCoreRazorRuntimePackageVersion=$(MicrosoftAspNetCoreRazorRuntimePackageVersion);
4645
MicrosoftCodeAnalysisRazorPackageVersion=$(MicrosoftCodeAnalysisRazorPackageVersion);
4746
MicrosoftCodeAnalysisCSharpPackageVersion=$(MicrosoftCodeAnalysisCSharpPackageVersion);

src/Microsoft.AspNetCore.Mvc.Razor/Microsoft.AspNetCore.Mvc.Razor.nuspec

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
<dependencies>
1717
<group targetFramework=".NETStandard2.0">
1818
<dependency id="Microsoft.AspNetCore.Mvc.ViewFeatures" version="$version$" exclude="Build,Analyzers" />
19-
<dependency id="Microsoft.AspNetCore.Mvc.Razor.Extensions" version="$MicrosoftAspNetCoreMvcRazorExtensionsPackageVersion$" exclude="Build,Analyzers" />
2019
<dependency id="Microsoft.AspNetCore.Razor.Runtime" version="$MicrosoftAspNetCoreRazorRuntimePackageVersion$" exclude="Build,Analyzers" />
2120
<dependency id="Microsoft.CodeAnalysis.CSharp" version="$MicrosoftCodeAnalysisCSharpPackageVersion$" exclude="Build,Analyzers" />
2221
<dependency id="Microsoft.CodeAnalysis.Razor" version="$MicrosoftCodeAnalysisRazorPackageVersion$" exclude="Build,Analyzers" />
@@ -25,7 +24,6 @@
2524
</group>
2625
<group targetFramework=".NETFramework4.6.1">
2726
<dependency id="Microsoft.AspNetCore.Mvc.ViewFeatures" version="$version$" exclude="Build,Analyzers" />
28-
<dependency id="Microsoft.AspNetCore.Mvc.Razor.Extensions" version="$MicrosoftAspNetCoreMvcRazorExtensionsPackageVersion$" exclude="Build,Analyzers" />
2927
<dependency id="Microsoft.AspNetCore.Razor.Runtime" version="$MicrosoftAspNetCoreRazorRuntimePackageVersion$" exclude="Build,Analyzers" />
3028
<dependency id="Microsoft.CodeAnalysis.CSharp" version="$MicrosoftCodeAnalysisCSharpPackageVersion$" exclude="Build,Analyzers" />
3129
<dependency id="Microsoft.CodeAnalysis.Razor" version="$MicrosoftCodeAnalysisRazorPackageVersion$" exclude="Build,Analyzers" />

src/Microsoft.AspNetCore.Mvc.Razor/RazorViewEngine.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -416,10 +416,6 @@ internal ViewLocationCacheResult CreateCacheResult(
416416
var viewStartPages = isMainPage ?
417417
GetViewStartPages(viewDescriptor.RelativePath, expirationTokens) :
418418
Array.Empty<ViewLocationCacheItem>();
419-
if (viewDescriptor.IsPrecompiled)
420-
{
421-
_logger.PrecompiledViewFound(relativePath);
422-
}
423419

424420
return new ViewLocationCacheResult(
425421
new ViewLocationCacheItem(factoryResult.RazorPageFactory, relativePath),

src/Microsoft.AspNetCore.Mvc.Razor/breakingchanges.netcore.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,5 +53,15 @@
5353
"TypeId": "public class Microsoft.AspNetCore.Mvc.Razor.RazorViewEngineOptions",
5454
"MemberId": "public System.Collections.Generic.IList<Microsoft.Extensions.FileProviders.IFileProvider> get_FileProviders()",
5555
"Kind": "Removal"
56+
},
57+
{
58+
"TypeId": "public class Microsoft.AspNetCore.Mvc.Razor.Compilation.CompiledViewDescriptor",
59+
"MemberId": "public System.Boolean get_IsPrecompiled()",
60+
"Kind": "Removal"
61+
},
62+
{
63+
"TypeId": "public class Microsoft.AspNetCore.Mvc.Razor.Compilation.CompiledViewDescriptor",
64+
"MemberId": "public System.Void set_IsPrecompiled(System.Boolean value)",
65+
"Kind": "Removal"
5666
}
5767
]

src/Microsoft.AspNetCore.Mvc.RazorPages/ApplicationModels/CompiledPageRouteModelProvider.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,6 @@ private IEnumerable<CompiledViewDescriptor> GetViewDescriptors(ApplicationPartMa
7070
continue;
7171
}
7272

73-
if (!viewDescriptor.IsPrecompiled)
74-
{
75-
continue;
76-
}
77-
7873
if (IsRazorPage(viewDescriptor))
7974
{
8075
yield return viewDescriptor;

test/Microsoft.AspNetCore.Mvc.Razor.Test/RazorViewEngineTest.cs

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,13 @@
88
using Microsoft.AspNetCore.Hosting;
99
using Microsoft.AspNetCore.Http;
1010
using Microsoft.AspNetCore.Mvc.Abstractions;
11-
using Microsoft.AspNetCore.Mvc.Infrastructure;
1211
using Microsoft.AspNetCore.Mvc.Razor.Compilation;
1312
using Microsoft.AspNetCore.Mvc.Routing;
1413
using Microsoft.AspNetCore.Mvc.ViewEngines;
15-
using Microsoft.AspNetCore.Razor.Language;
1614
using Microsoft.AspNetCore.Routing;
1715
using Microsoft.AspNetCore.Testing;
1816
using Microsoft.Extensions.Caching.Memory;
19-
using Microsoft.Extensions.FileProviders;
2017
using Microsoft.Extensions.Logging.Abstractions;
21-
using Microsoft.Extensions.Logging.Testing;
2218
using Microsoft.Extensions.Options;
2319
using Microsoft.Extensions.Primitives;
2420
using Microsoft.Extensions.WebEncoders.Testing;
@@ -1307,38 +1303,6 @@ public void FindPage_LooksForPages_UsesRouteValuesAsFallback()
13071303
Assert.Equal(expected, result.SearchedLocations);
13081304
}
13091305

1310-
[Fact]
1311-
public void CreateCacheResult_LogsPrecompiledViewFound()
1312-
{
1313-
// Arrange
1314-
var sink = new TestSink();
1315-
var loggerFactory = new TestLoggerFactory(sink, enabled: true);
1316-
1317-
var relativePath = "/Views/Foo/details.cshtml";
1318-
var factoryResult = GetPageFactoryResult(() => Mock.Of<IRazorPage>());
1319-
factoryResult.ViewDescriptor.IsPrecompiled = true;
1320-
var pageFactory = new Mock<IRazorPageFactoryProvider>();
1321-
pageFactory
1322-
.Setup(p => p.CreateFactory(relativePath))
1323-
.Returns(factoryResult)
1324-
.Verifiable();
1325-
1326-
var viewEngine = new RazorViewEngine(
1327-
pageFactory.Object,
1328-
Mock.Of<IRazorPageActivator>(),
1329-
new HtmlTestEncoder(),
1330-
GetOptionsAccessor(expanders: null),
1331-
loggerFactory,
1332-
new DiagnosticListener("Microsoft.AspNetCore.Mvc.Razor"));
1333-
1334-
// Act
1335-
var result = viewEngine.CreateCacheResult(null, relativePath, false);
1336-
1337-
// Assert
1338-
var logMessage = Assert.Single(sink.Writes);
1339-
Assert.Equal($"Using precompiled view for '{relativePath}'.", logMessage.State.ToString());
1340-
}
1341-
13421306
[Theory]
13431307
[InlineData("/Test-View.cshtml")]
13441308
[InlineData("~/Test-View.CSHTML")]

0 commit comments

Comments
 (0)