Skip to content

Mangle blazor.*.js files #42268

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

Conversation

TanayParikh
Copy link
Contributor

@TanayParikh TanayParikh commented Jun 17, 2022

Summary of Improvements

Small decreases in size, but this was some pretty low hanging fruit. 😄

File Current Size Optimized Size
blazor.server.js 130 kb 122 kb
blazor.webassembly.js 60 kb 59 kb
blazor.webview.js 40.5 kb 39.8 kb

Before:

asset blazor.server.js 130 KiB [emitted] [minimized] [big] (name: blazor.server)
asset blazor.webassembly.js 60 KiB [emitted] [minimized] (name: blazor.webassembly)
asset blazor.webview.js 40.5 KiB [emitted] [minimized] (name: blazor.webview)
orphan modules 452 KiB [orphan] 93 modules
runtime modules 221 bytes 1 module
cacheable modules 736 KiB
  ./Boot.Server.ts + 72 modules 390 KiB [built] [code generated]
  ./Boot.WebAssembly.ts + 31 modules 200 KiB [built] [code generated]
  ./Boot.WebView.ts + 28 modules 146 KiB [built] [code generated]

After:

asset blazor.server.js 122 KiB [emitted] [minimized] [big] (name: blazor.server)
asset blazor.webassembly.js 59 KiB [emitted] [minimized] (name: blazor.webassembly)
asset blazor.webview.js 39.8 KiB [emitted] [minimized] (name: blazor.webview)
orphan modules 452 KiB [orphan] 93 modules
runtime modules 221 bytes 1 module
cacheable modules 736 KiB
  ./Boot.Server.ts + 72 modules 390 KiB [built] [code generated]
  ./Boot.WebAssembly.ts + 31 modules 200 KiB [built] [code generated]
  ./Boot.WebView.ts + 28 modules 146 KiB [built] [code generated]

Fixes: #37260

Considering holding off on the merge till Preview 7 so this change has some time to "bake" before (preview) release.

@TanayParikh TanayParikh added area-blazor Includes: Blazor, Razor Components Blazor ♥ SignalR This issue is related to the experience of Signal R and Blazor working together labels Jun 17, 2022
@TanayParikh TanayParikh added this to the 7.0-preview7 milestone Jun 17, 2022
@TanayParikh TanayParikh self-assigned this Jun 17, 2022
@TanayParikh TanayParikh deleted the taparik/mangleBlazorJSFiles branch June 17, 2022 22:31
@BrennanConroy
Copy link
Member

Should go through the classes and use _ on the private variables like

private afterStartedCallbacks: AfterBlazorStartedCallback[] = [];

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-blazor Includes: Blazor, Razor Components Blazor ♥ SignalR This issue is related to the experience of Signal R and Blazor working together Perf
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Shrink blazor.*.js file size, SignalR Minification
2 participants