-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Add feature-switch for invariant TimeZone support #37973
Comments
... This is implying that we'd be distributing our own copy of timezone data? Or is this something else? Traditionally, we've pulled from the OS for desktop/server deployments, which would mean the size of the timezone data with an app is Note that the full tzdb is < 400kb, and is trivially amenable to CDN delivery/caching. Perhaps Blazor should also add the ability to specify a web resource for this, so it can be delivered out-of-band from the app itself? |
@eerhardt at least the setting seems to already be present in the SDK so isn't this one done already? https://github.com/dotnet/sdk/blob/408fe82020f979ec65862add4d5b1dd85fef5d80/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.targets#L396-L399 What am I missing? @Clockwork-Muse The point here is to have a switch so that consumers can choose to always treat the Timezone as Invariant with the intent of reducing the application final size once it gets linked since all of the code in the framework that takes Timezones and compares them will be optimized out. |
The
In Blazor WASM 3.2, we shipped an MSBuild property named This work item is to introduce a new feature switch in the BCL which will disable Time Zone support altogether (even without the app being linked, as feature switches can be configured by AppContext). The feature switch will also be used to trim the TimeZoneInfo code in Blazor WASM, when enabled. Since this is net-new functionality that changes behavior, and .NET 5 is closing down, I don't believe this is strictly necessary to ship .NET 5. The behavior from 3.2 is not regressed with the current bits. In 6.0, we can introduce a new feature switch in this area. cc @pranavkm |
I don't believe this will fit into 6.0. Moving to |
After #82250 the |
Tagging subscribers to 'arch-wasm': @lewing Issue DetailsFor size sensitive apps it'd be very helpful to have an option (feature switch) to exclude full time-zones support. This is something that is supported by Blazor 3.2 as an opt-in feature which we should not regress on.
|
Is this potentially helpful for current AOT work @eerhardt .. or is it a subset of invariant globalization flag? |
See #37973 (comment)
It is minorly helpful. TimeZoneInfo has some code in it that can be trimmed, but it won't move the needle on a web app. TimeZoneInfo is already trimmed in a "Hello, World" app. Using version Console.WriteLine("Hello, World!"): So TimeZoneInfo adds about 145 KB. For linux-x64 it is slightly larger at 180 KB. The real savings here is when we can exclude the tzdata information. The only place I know of where this is helpful is browser-wasm apps. Everywhere else we get the tzdata information already on the OS. |
On wasm tzdata is now bundled into .wasm file, about 220KB. Previously it was separate file which |
... given JS (and thus presumably wasm) has the Obviously not out yet, also obviously you need an implementing browser. But it could mean you don't need to ship the timezones to clients (unless you really want to, to potentially ensure certain data, but that should normally be an edge case). |
That's still ~2% of stage 1, right? Or it's already out of stage 1? |
TimeZoneInfo is in stage 1. That's why I said it is "minorly helpful", but it won't move the needle. Stage 1 is rather small compared to a real world web app. I don't believe we would turn this switch on by default. |
For size sensitive apps it'd be very helpful to have an option (feature switch) to exclude full time-zones support. This is something that is supported by Blazor 3.2 as an opt-in feature which we should not regress on.
@eerhardt
The text was updated successfully, but these errors were encountered: