Skip to content

Commit 4ad522e

Browse files
committed
Move to includes.min files
And remove the non-minified from the package (this halves the size of .Shared)
1 parent 603352a commit 4ad522e

File tree

7 files changed

+12
-12
lines changed

7 files changed

+12
-12
lines changed

src/MiniProfiler.AspNetCore/MiniProfilerMiddleware.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ private async Task HandleRequest(HttpContext context, PathString subPath)
170170
string result = null;
171171

172172
// File embed
173-
if (subPath.Value.StartsWith("/includes", StringComparison.Ordinal))
173+
if (subPath.Value.StartsWith("/includes.min", StringComparison.Ordinal))
174174
{
175175
result = Embedded.GetFile(context, subPath);
176176
}

src/MiniProfiler.AspNetCore/MiniProfilerOptions.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public class MiniProfilerOptions : MiniProfilerBaseOptions
1111
{
1212
/// <summary>
1313
/// The path under which ALL routes are registered in, defaults to the application root. For example, "/myDirectory/" would yield
14-
/// "/myDirectory/includes.js" rather than "/mini-profiler-resources/includes.js"
14+
/// "/myDirectory/includes.min.js" rather than "/mini-profiler-resources/includes.min.js"
1515
/// Any setting here should be absolute for the application, e.g. "/myDirectory/"
1616
/// </summary>
1717
public PathString RouteBasePath { get; set; } = "/mini-profiler-resources";

src/MiniProfiler.Shared/Internal/Render.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public static string Includes(
4040

4141
sb.Append("<script async=\"async\" id=\"mini-profiler\" src=\"");
4242
sb.Append(path);
43-
sb.Append("includes.js?v=");
43+
sb.Append("includes.min.js?v=");
4444
sb.Append(options.VersionHash);
4545
sb.Append("\" data-version=\"");
4646
sb.Append(options.VersionHash);
@@ -151,8 +151,8 @@ public static string ResultListHtml(MiniProfilerBaseOptions options, string path
151151
return $@"<html>
152152
<head>
153153
<title>List of profiling sessions</title>
154-
<script id=""mini-profiler"" data-ids="""" src=""{path}includes.js?v={version}""></script>
155-
<link href=""{path}includes.css?v={version}"" rel=""stylesheet"" />
154+
<script id=""mini-profiler"" data-ids="""" src=""{path}includes.min.js?v={version}""></script>
155+
<link href=""{path}includes.min.css?v={version}"" rel=""stylesheet"" />
156156
<script>MiniProfiler.listInit({{path: '{path}', version: '{version}'}});</script>
157157
</head>
158158
<body>

src/MiniProfiler.Shared/MiniProfiler.Shared.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,13 @@
4141
</ItemGroup>
4242
<ItemGroup>
4343
<None Include="ui\includes.less" />
44-
<EmbeddedResource Include="ui\includes.css" DependentUpon="includes.less" />
44+
<None Include="ui\includes.css" DependentUpon="includes.less" />
4545
<EmbeddedResource Include="ui\includes.min.css" DependentUpon="includes.css" />
4646

4747
<Include Include="ui\lib\MiniProfiler.js" DependentUpon="MiniProfiler.ts" />
4848
<Include Include="ui\lib\MiniProfiler.js.map" DependentUpon="MiniProfiler.js" />
4949

50-
<EmbeddedResource Include="ui\includes.js" />
50+
<None Include="ui\includes.js" />
5151
<EmbeddedResource Include="ui\includes.min.js" DependentUpon="includes.js" />
5252
</ItemGroup>
5353
</Project>

src/MiniProfiler.Shared/ui/lib/MiniProfiler.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ namespace StackExchange.Profiling {
345345
} else {
346346
alreadyDone = true;
347347
if (mp.options.authorized) {
348-
$('head').append(`<link rel="stylesheet" type="text/css" href="${mp.options.path}includes.css?v=${mp.options.version}" />`);
348+
$('head').append(`<link rel="stylesheet" type="text/css" href="${mp.options.path}includes.min.css?v=${mp.options.version}" />`);
349349
}
350350
doInit();
351351
}

src/MiniProfiler/MiniProfilerHandler.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public void ProcessRequest(HttpContext context)
8989

9090
switch (Path.GetFileNameWithoutExtension(path).ToLowerInvariant())
9191
{
92-
case "includes":
92+
case "includes.min":
9393
output = Includes(context, path);
9494
break;
9595

tests/MiniProfiler.Tests.AspNet/MiniProfileHandlerTests.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ public class MiniProfilerHandlerTests
1414
[InlineData("BRILLANT", 404)]
1515
[InlineData("underscore.js", 404)]
1616
[InlineData("results-list", 200)]
17-
[InlineData("includes.js", 200)]
18-
[InlineData("includes.css", 200)]
17+
[InlineData("includes.min.js", 200)]
18+
[InlineData("includes.min.css", 200)]
1919
public void GivenContext_WhenAResourceIsRequested_ThenTheCorrectHttpStatusCodeIsReturned(string resourceName, int expectedHttpStatus)
2020
{
2121
var sut = new MiniProfilerHandler(new MiniProfilerOptions()
@@ -52,7 +52,7 @@ public void GivenContext_WhenIndexIsRequested_ThenTheCorrectHttpStatusCodeIsRetu
5252
var sut = new MiniProfilerHandler(new MiniProfilerOptions());
5353

5454
// Act
55-
var res = GetRequestResponseEncoding(sut, "includes.js", acceptEncoding);
55+
var res = GetRequestResponseEncoding(sut, "includes.min.js", acceptEncoding);
5656

5757
// Assert
5858
// due the limitations of the HttpSimulator, we can't access the header values because it needs iis integrated pipeline mode.

0 commit comments

Comments
 (0)