Open TanayParikh opened 3 years ago
Tried this out via https://github.com/dotnet/aspnetcore/pull/42268, this doesn't seem to be immediately feasible just by mangling alone as it causes issues with Blazor._internal
which is an internal
type for Blazor, but we cannot let it get mangled as it's called into from .NET via JS interop.
This issue breaks down into two parts. Mangling the blazor source code, and ensuring the SignalR code we take is/becomes mangled.
The former will likely be a larger undertaking and with fairly low benefit. For instance take a look at the WASM/WebView size improvements below.
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 |
The blazor.server.js
improvement is relatively larger than WASM/WebView, on account of mangling the SignalR code.
Next steps for this issue would be to figure out how we can either take the existing mangled SignalR code instead of the source code we're taking now, or how we can mangle just the SignalR code without touching the Blazor code.
I'm pushing this back into backlog at this point in time.
We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.
If _internal
is the only thing that shouldn't be mangled, you can exclude it https://github.com/terser/terser#cli-mangle-options
Not seeing any other Blazor._*
usage other than Blazor._internal
.
So tried that out, but still ran into other issues:
We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.
@BrennanConroy mentioned:
This issue tracks this effort to ensure we're minifying the SignalR bits. Not sure if we'll be able to take this for 6.0 given the current stage of the release, but will dig into it once I have some time available.