69 writes to Route
Microsoft.NET.Sdk.BlazorWebAssembly.Tests (2)
StaticWebAssetsBaselineFactory.cs (2)
157endpoint.Route = endpoint.Route.Replace(property.Value, $"__{property.Name}__"); 178endpoint.Route = TemplatizeFilePath(endpoint.Route, null, null, null, null, null).Replace("\\", "/");
Microsoft.NET.Sdk.StaticWebAssets.Tasks (9)
ApplyCompressionNegotiation.cs (1)
275Route = relatedEndpointCandidate.Route,
ComputeEndpointsForReferenceStaticWebAssets.cs (1)
44candidateEndpoint.Route = StaticWebAsset.CombineNormalizedPaths("", asset.BasePath, candidateEndpoint.Route, '/');
Data\StaticWebAssetEndpoint.cs (2)
419string ITaskItem2.EvaluatedIncludeEscaped { get => Route; set => Route = value; } 420string ITaskItem.ItemSpec { get => Route; set => Route = value; }
DefineStaticWebAssetEndpoints.cs (1)
191Route = finalRoute,
GenerateStaticWebAssetEndpointsManifest.cs (1)
117endpoint.Route = route;
ResolveFingerprintedStaticWebAssetEndpointsForAssets.cs (2)
75endpoint.Route = route; 86endpoints[0].Route = asset.ReplaceTokens(endpoints[0].Route, StaticWebAssetTokenResolver.Instance);
ResolveStaticWebAssetEndpointRoutes.cs (1)
31endpoint.Route = route;
Microsoft.NET.Sdk.StaticWebAssets.Tests (58)
StaticWebAssets\ApplyCompressionNegotiationTest.cs (47)
79Route = "candidate.js", 93Route = "candidate.js", 106Route = "candidate.js.gz", 191Route = "candidate.fingerprint.js", 257Route = "candidate.fingerprint.js", 323Route = "candidate.fingerprint.js", 376Route = "candidate.fingerprint.js.br", 434Route = "candidate.fingerprint.js.gz", 492Route = "candidate.js", 548Route = "candidate.js", 604Route = "candidate.js", 647Route = "candidate.js.br", 695Route = "candidate.js.gz", 805Route = "candidate.js", 818Route = "candidate.js", 830Route = "candidate.fingerprint.js", 843Route = "candidate.fingerprint.js", 855Route = "candidate.js.gz", 910Route = "candidate.js", 923Route = "candidate.js", 934Route = "candidate.fingerprint.js", 947Route = "candidate.fingerprint.js", 958Route = "candidate.js.gz", 981Route = "candidate.js", 994Route = "candidate.js", 1006Route = "candidate.fingerprint.js", 1019Route = "candidate.fingerprint.js", 1031Route = "candidate.js.gz", 1102Route = "candidate.js", 1115Route = "candidate.js", 1126Route = "candidate.fingerprint.js", 1139Route = "candidate.fingerprint.js", 1150Route = "candidate.js.gz", 1163Route = "candidate.js.br", 1184Route = "candidate.js", 1197Route = "candidate.js", 1210Route = "candidate.js", 1222Route = "candidate.fingerprint.js", 1235Route = "candidate.fingerprint.js", 1248Route = "candidate.fingerprint.js", 1260Route = "candidate.js.gz", 1273Route = "candidate.js.br", 1368Route = "candidate.js", 1382Route = "candidate.js", 1395Route = "candidate.js.gz", 1409Route = "candidate.js", 1490Route = route,
StaticWebAssets\ComputeEndpointsForReferenceStaticWebAssetsTest.cs (1)
139Route = route,
StaticWebAssets\DefineStaticWebAssetEndpointsTest.cs (1)
646Route = route,
StaticWebAssets\GenerateStaticWebAssetEndpointsManifestTest.cs (4)
22Route = "index.fingerprint.html", 65Route = "index.fingerprint.js", 108Route = "index.html", 141Route = "index.js",
StaticWebAssets\GenerateStaticWebAssetEndpointsPropsFileTest.cs (1)
210Route = route,
StaticWebAssets\GenerateStaticWebAssetsManifestTest.cs (1)
114Route = asset.ComputeTargetPath("", '/'),
StaticWebAssets\UpdateStaticWebAssetEndpointsTest.cs (1)
252Route = fingerprintedEndpoints[0].Route,
StaticWebAssetsBaselineFactory.cs (2)
157endpoint.Route = endpoint.Route.Replace(property.Value, $"__{property.Name}__"); 178endpoint.Route = TemplatizeFilePath(endpoint.Route, null, null, null, null, null).Replace("\\", "/");
151 references to Route
Microsoft.NET.Sdk.BlazorWebAssembly.Tests (16)
StaticWebAssetsBaselineComparer.cs (13)
83.OrderBy(a => a.Route) 97{string.Join($"{Environment.NewLine} ", foundDuplicateEndpoints.Select(a => @$"{a.Key.Route} - {a.Key.AssetFile} - {a.Key.Selectors.Length} - {a.Value.Length}"))}{Environment.NewLine}"); 105.OrderBy(a => a.Route) 121if (endpoint.Route.EndsWith(".gz") || endpoint.Route.EndsWith(".br") || endpoint.Selectors.Length == 1) 405string.Join($"{Environment.NewLine}\t", expectedEndpoints.Select(a => $"{a.Route} - {a.Selectors.Length} - {a.AssetFile}")), 407string.Join($"{Environment.NewLine}\t", manifestEndpoints.Select(a => $"{a.Route} - {a.Selectors.Length} - {a.AssetFile}")) 413{string.Join($"{Environment.NewLine}\t", missingEndpoints.Select(a => $"{a.Route} - {a.AssetFile}"))}"); 419{string.Join($"{Environment.NewLine}\t", unexpectedEndpoints.Select(a => $"{a.Route} - {a.AssetFile}"))}"); 435if (manifestAsset.Route != expectedAsset.Route) 437assetDifferences.Add($"Expected manifest Identity of {expectedAsset.Route} but found {manifestAsset.Route}.");
StaticWebAssetsBaselineFactory.cs (3)
157endpoint.Route = endpoint.Route.Replace(property.Value, $"__{property.Name}__"); 169ReplaceFileName(endpoint.Route); 178endpoint.Route = TemplatizeFilePath(endpoint.Route, null, null, null, null, null).Replace("\\", "/");
Microsoft.NET.Sdk.StaticWebAssets.Tasks (61)
ApplyCompressionNegotiation.cs (17)
52Log.LogMessage(MessageImportance.Low, " Skipping endpoint '{0}' since it already has a Content-Encoding selector", compressedEndpoint.Route); 67Log.LogMessage(MessageImportance.Low, " Updated endpoint '{0}' with Content-Encoding and Vary headers", compressedEndpoint.Route); 85Log.LogMessage(MessageImportance.Low, " Adding Vary response header to related endpoint '{0}'", relatedEndpointCandidate.Route); 119Log.LogMessage(MessageImportance.Low, " Skipping endpoint '{0}' since and endpoint for the same asset was updated.", endpointToSkip.Route); 132var route = updatedEndpoint.Route; 199if (!result.TryGetValue(endpoint.Route, out var routeEndpoints)) 202result[endpoint.Route] = routeEndpoints; 243Log.LogMessage(MessageImportance.Low, "Processing related endpoint '{0}'", relatedEndpointCandidate.Route); 250Log.LogMessage(MessageImportance.Low, " Created Content-Encoding selector for compressed asset '{0}' with size '{1}' is '{2}'", encodingSelector.Value, encodingSelector.Quality, relatedEndpointCandidate.Route); 261Log.LogMessage(MessageImportance.Low, " Adding original-resource endpoint property for related endpoint '{0}'", relatedEndpointCandidate.Route); 275Route = relatedEndpointCandidate.Route, 283ApplyCompressedEndpointHeaders(headers, compressedEndpoint, relatedEndpointCandidate.Route); 288Log.LogMessage(MessageImportance.Low, " Updated related endpoint '{0}' with Content-Encoding selector '{1}={2}'", relatedEndpointCandidate.Route, encodingSelector.Value, encodingSelector.Quality); 394Log.LogMessage(MessageImportance.Low, " Adding header '{0}' to related endpoint '{1}'", header.Name, relatedEndpointCandidate.Route); 406Log.LogMessage(MessageImportance.Low, " Updating ETag header for related endpoint '{0}'", relatedEndpointCandidate.Route); 414Log.LogMessage(MessageImportance.Low, "Adding Content-Type '{1}' header to related endpoint '{0}'", relatedEndpointCandidate.Route, header.Value); 420Log.LogMessage(MessageImportance.Low, " Skipping header '{0}' for related endpoint '{1}'", header.Name, relatedEndpointCandidate.Route);
ComputeEndpointsForReferenceStaticWebAssets.cs (5)
37var oldRoute = candidateEndpoint.Route; 44candidateEndpoint.Route = StaticWebAsset.CombineNormalizedPaths("", asset.BasePath, candidateEndpoint.Route, '/'); 59Log.LogMessage(MessageImportance.Low, "Adding endpoint {0} for asset {1} with updated route {2}.", candidateEndpoint.Route, candidateEndpoint.AssetFile, candidateEndpoint.Route); 66Log.LogMessage(MessageImportance.Low, "Skipping endpoint {0} because the asset {1} was not found.", candidateEndpoint.Route, candidateEndpoint.AssetFile);
Data\StaticWebAssetEndpoint.cs (13)
177Array.Sort(result, (a, b) => (a.Route, b.Route) switch 232public bool Equals(StaticWebAssetEndpoint other) => other is not null && Route == other.Route && 259hashCode.Add(Route); 278$"{nameof(StaticWebAssetEndpoint)}: Route = {Route}, AssetFile = {AssetFile}, Selectors = {StaticWebAssetEndpointSelector.ToMetadataValue(Selectors ?? [])}, ResponseHeaders = {ResponseHeaders?.Length}, EndpointProperties = {StaticWebAssetEndpointProperty.ToMetadataValue(EndpointProperties ?? [])}"; 282var routeComparison = StringComparer.Ordinal.Compare(Route, Route); 400return string.Equals(x.Route, y.Route, StringComparison.Ordinal) && 412return HashCode.Combine(obj.Route, obj.AssetFile); 419string ITaskItem2.EvaluatedIncludeEscaped { get => Route; set => Route = value; } 420string ITaskItem.ItemSpec { get => Route; set => Route = value; }
DefineStaticWebAssetEndpoints.cs (1)
197Log.LogMessage(MessageImportance.Low, $"Adding endpoint {endpoint.Route} for asset {asset.Identity}.");
FilterStaticWebAssetEndpoints.cs (2)
61$"Filtered out endpoint {endpoint.Route} because it did not meet the criteria {failingCriteria.Type} {failingCriteria.Name} {failingCriteria.Value}"); 141var route = asset.ReplaceTokens(endpoint.Route, StaticWebAssetTokenResolver.Instance);
GenerateStaticWebAssetEndpointsManifest.cs (3)
87Log.LogMessage(MessageImportance.Low, "Skipping endpoint '{0}' because the asset '{1}' is not part of the manifest", endpoint.Route, endpoint.AssetFile); 92var route = asset.ResolvedAsset.ReplaceTokens(endpoint.Route, StaticWebAssetTokenResolver.Instance); 119Log.LogMessage(MessageImportance.Low, "Including endpoint '{0}' for asset '{1}' with final location '{2}'", endpoint.Route, endpoint.AssetFile, asset.TargetPath);
GenerateStaticWebAssetEndpointsPropsFile.cs (3)
45var orderedAssets = endpoints.OrderBy(e => e.Route, StringComparer.OrdinalIgnoreCase) 55new XAttribute("Include", element.Route), 129Log.LogError($"The asset file '{endpoint.AssetFile}' specified in the endpoint '{endpoint.Route}' does not exist.");
GenerateStaticWebAssetsManifest.cs (4)
51Array.Sort(endpoints, (l, r) => string.CompareOrdinal(l.Route, r.Route) switch 110Log.LogMessage(MessageImportance.Low, $"Accepted endpoint: Route='{endpoint.Route}', AssetFile='{endpoint.AssetFile}'"); 114Log.LogMessage(MessageImportance.Low, $"Filtered out endpoint: Endpoint='{endpoint.Route}' AssetFile='{endpoint.AssetFile}'");
JSModules\GenerateJSModuleManifest.cs (1)
29var modules = StaticWebAssetEndpoint.FromItemGroup(JsModules).Select(s => s.Route).ToArray();
OverrideHtmlAssetPlaceholders.cs (1)
177var resourceAsset = new ResourceAsset(endpoint.Route);
ResolveFingerprintedStaticWebAssetEndpointsForAssets.cs (7)
73var route = asset.ReplaceTokens(endpoint.Route, StaticWebAssetTokenResolver.Instance); 74Log.LogMessage(MessageImportance.Low, $"Selected endpoint '{endpoint.Route}' for asset '{asset.Identity}' because it has a fingerprinted route '{route}'."); 86endpoints[0].Route = asset.ReplaceTokens(endpoints[0].Route, StaticWebAssetTokenResolver.Instance); 87Log.LogMessage(MessageImportance.Low, $"Selected endpoint '{endpoints[0].Route}' for asset '{asset.Identity}' because no fingerprinted endpoint was found."); 115var route = asset.ReplaceTokens(endpoint.Route, StaticWebAssetTokenResolver.Instance); 118Log.LogMessage(MessageImportance.Low, $"Selected endpoint '{endpoint.Route}' for asset '{asset.Identity}' because '{assetPath}' matches resolved route '{route}'."); 123Log.LogMessage(MessageImportance.Low, $"Skipping endpoint '{endpoint.Route}' for asset '{asset.Identity}' because '{assetPath}' does not match resolved route '{route}'.");
ResolveStaticWebAssetEndpointRoutes.cs (2)
27Log.LogError($"The asset file '{endpoint.AssetFile}' for endpoint '{endpoint.Route}' was not found."); 30var route = asset.ReplaceTokens(endpoint.Route, StaticWebAssetTokenResolver.Instance);
UpdateStaticWebAssetEndpoints.cs (2)
45.GroupBy(e => e.Route) 48.GroupBy(e => e.Route)
Microsoft.NET.Sdk.StaticWebAssets.Tests (74)
StaticWebAssetEndpointsIntegrationTest.cs (33)
49var appJsEndpoints = endpoints.Where(ep => ep.Route.EndsWith("app.js")); 51var appJsGzEndpoints = endpoints.Where(ep => ep.Route.EndsWith("app.js.gz")); 83private bool MatchUncompresedProjectBundlesNoFingerprint(StaticWebAssetEndpoint ep) => ProjectBundleRegex().Match(ep.Route) is 94private bool MatchCompressedProjectBundlesNoFingerprint(StaticWebAssetEndpoint ep) => ProjectBundleRegex().Match(ep.Route) is 105private bool MatchUncompressedProjectBundlesWithFingerprint(StaticWebAssetEndpoint ep) => ProjectBundleRegex().Match(ep.Route) is 116private bool MatchCompressedProjectBundlesWithFingerprint(StaticWebAssetEndpoint ep) => ProjectBundleRegex().Match(ep.Route) is 128private bool MatchUncompressedAppBundleNoFingerprint(StaticWebAssetEndpoint ep) => AppBundleRegex().Match(ep.Route) is 139private bool MatchCompressedAppBundleNoFingerprint(StaticWebAssetEndpoint ep) => AppBundleRegex().Match(ep.Route) is 150private bool MatchUncompressedAppBundleWithFingerprint(StaticWebAssetEndpoint ep) => AppBundleRegex().Match(ep.Route) is 161private bool MatchCompressedAppBundleWithFingerprint(StaticWebAssetEndpoint ep) => AppBundleRegex().Match(ep.Route) is 201file.Length.Should().Be(length, $"because {endpoint.Route} {file.FullName}"); 209var appJsEndpoints = endpoints.Where(ep => ep.Route.EndsWith("app.js")); 211var appJsGzEndpoints = endpoints.Where(ep => ep.Route.EndsWith("app.js.gz")); 213var appJsBrEndpoints = endpoints.Where(ep => ep.Route.EndsWith("app.js.br")); 261var bundleGzEndpoints = endpoints.Where(MatchCompressedProjectBundlesNoFingerprint).Where(ep => ep.Route.EndsWith(".gz")); 263var bundleBrEndpoints = endpoints.Where(MatchCompressedProjectBundlesNoFingerprint).Where(ep => ep.Route.EndsWith(".br")); 265var fingerprintedBundleGzEndpoints = endpoints.Where(MatchCompressedProjectBundlesWithFingerprint).Where(ep => ep.Route.EndsWith(".gz")); 267var fingerprintedBundleBrEndpoints = endpoints.Where(MatchCompressedProjectBundlesWithFingerprint).Where(ep => ep.Route.EndsWith(".br")); 275var appBundleGzEndpoints = endpoints.Where(MatchCompressedAppBundleNoFingerprint).Where(ep => ep.Route.EndsWith(".gz")); 277var appBundleBrEndpoints = endpoints.Where(MatchCompressedAppBundleNoFingerprint).Where(ep => ep.Route.EndsWith(".br")); 279var fingerprintedAppBundleGzEndpoints = endpoints.Where(MatchCompressedAppBundleWithFingerprint).Where(ep => ep.Route.EndsWith(".gz")); 281var fingerprintedAppBundleBrEndpoints = endpoints.Where(MatchCompressedAppBundleWithFingerprint).Where(ep => ep.Route.EndsWith(".br")); 329var appJsEndpoints = endpoints.Where(ep => ep.Route.EndsWith("app.js")); 359var appJsGzEndpoints = endpoints.Where(ep => ep.Route.EndsWith("app.js.gz")); 362var appJsBrEndpoints = endpoints.Where(ep => ep.Route.EndsWith("app.js.br")); 367var bundleGzEndpoints = endpoints.Where(MatchCompressedProjectBundlesNoFingerprint).Where(ep => ep.Route.EndsWith(".gz")); 369var bundleBrEndpoints = endpoints.Where(MatchCompressedProjectBundlesNoFingerprint).Where(ep => ep.Route.EndsWith(".br")); 371var fingerprintedBundleGzEndpoints = endpoints.Where(MatchCompressedProjectBundlesWithFingerprint).Where(ep => ep.Route.EndsWith(".gz")); 373var fingerprintedBundleBrEndpoints = endpoints.Where(MatchCompressedProjectBundlesWithFingerprint).Where(ep => ep.Route.EndsWith(".br")); 381var appBundleGzEndpoints = endpoints.Where(MatchCompressedAppBundleNoFingerprint).Where(ep => ep.Route.EndsWith(".gz")); 383var appBundleBrEndpoints = endpoints.Where(MatchCompressedAppBundleNoFingerprint).Where(ep => ep.Route.EndsWith(".br")); 385var fingerprintedAppBundleGzEndpoints = endpoints.Where(MatchCompressedAppBundleWithFingerprint).Where(ep => ep.Route.EndsWith(".gz")); 387var fingerprintedAppBundleBrEndpoints = endpoints.Where(MatchCompressedAppBundleWithFingerprint).Where(ep => ep.Route.EndsWith(".br"));
StaticWebAssets\ApplyCompressionNegotiationTest.cs (3)
1560var compressedEndpoint = endpoints.FirstOrDefault(e => e.Route == "candidate.js" && e.AssetFile.Contains("candidate.js.gz")); 1627var compressedEndpoint = endpoints.FirstOrDefault(e => e.Route == "candidate.js" && e.AssetFile.Contains("candidate.js.gz")); 1694var compressedEndpoint = endpoints.FirstOrDefault(e => e.Route == "candidate.js" && e.AssetFile.Contains("candidate.js.gz"));
StaticWebAssets\DefineStaticWebAssetEndpointsTest.cs (6)
57endpoint.Route.Should().Be("candidate.js"); 125endpoint.Route.Should().Be("candidate.1234asdf.js"); 174otherEndpoint.Route.Should().Be("candidate.js"); 242endpoint.Route.Should().Be("candidate.yolo.js"); 291otherEndpoint.Route.Should().Be("candidate.js"); 536endpoint.Route.Should().Be("assets/index-C5tBAdQX.css");
StaticWebAssets\FilterStaticWebAssetEndpointsTest.cs (4)
159filteredEndpoints.Where(e => e.Route == "index.html").Should().ContainSingle(); 160filteredEndpoints.Where(e => e.Route == "other.fingerprint.js").Should().ContainSingle(); 198filteredEndpoints[0].Route.Should().Be(endpoints[0].Route);
StaticWebAssets\GenerateStaticWebAssetEndpointsManifestTest.cs (1)
263json.Endpoints[0].Route.Should().Contain("styles.css");
StaticWebAssets\ResolveFingerprintedStaticWebAssetEndpointsForAssetsTest.cs (5)
57endpoint.Route.Should().Be(expectedRoute); 83endpoints = endpoints.Where(e => !e.Route.Contains("asdf1234")).ToArray(); 140endpoint.Route.Should().Be(expectedRoute); 183endpoint.Route.Should().Be("candidate.js"); 209endpoints = endpoints.Where(e => !e.Route.Contains("asdf1234")).ToArray();
StaticWebAssets\UpdateStaticWebAssetEndpointsTest.cs (1)
252Route = fingerprintedEndpoints[0].Route,
StaticWebAssetsBaselineComparer.cs (13)
83.OrderBy(a => a.Route) 97{string.Join($"{Environment.NewLine} ", foundDuplicateEndpoints.Select(a => @$"{a.Key.Route} - {a.Key.AssetFile} - {a.Key.Selectors.Length} - {a.Value.Length}"))}{Environment.NewLine}"); 105.OrderBy(a => a.Route) 121if (endpoint.Route.EndsWith(".gz") || endpoint.Route.EndsWith(".br") || endpoint.Selectors.Length == 1) 405string.Join($"{Environment.NewLine}\t", expectedEndpoints.Select(a => $"{a.Route} - {a.Selectors.Length} - {a.AssetFile}")), 407string.Join($"{Environment.NewLine}\t", manifestEndpoints.Select(a => $"{a.Route} - {a.Selectors.Length} - {a.AssetFile}")) 413{string.Join($"{Environment.NewLine}\t", missingEndpoints.Select(a => $"{a.Route} - {a.AssetFile}"))}"); 419{string.Join($"{Environment.NewLine}\t", unexpectedEndpoints.Select(a => $"{a.Route} - {a.AssetFile}"))}"); 435if (manifestAsset.Route != expectedAsset.Route) 437assetDifferences.Add($"Expected manifest Identity of {expectedAsset.Route} but found {manifestAsset.Route}.");
StaticWebAssetsBaselineFactory.cs (3)
157endpoint.Route = endpoint.Route.Replace(property.Value, $"__{property.Name}__"); 169ReplaceFileName(endpoint.Route); 178endpoint.Route = TemplatizeFilePath(endpoint.Route, null, null, null, null, null).Replace("\\", "/");
StaticWebAssetsCompressionIntegrationTest.cs (4)
78if (endpoint.Route.EndsWith(".gz")) 90if (endpoint.Route.EndsWith(".br")) 190if (endpoint.Route.EndsWith(".gz")) 202if (endpoint.Route.EndsWith(".br"))
StaticWebAssetsFingerprintingTest.cs (1)
176=> endpoints.Endpoints.FirstOrDefault(e => e.Route == route && e.Selectors.Length == 0)?.AssetFile ?? throw new Exception($"Missing endpoint for file '{route}' in '{endpointsManifestPath}'");