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