-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
[Blazor] .NET 9 generated JS uses high version syntax leading to compatibility issues #59090
Comments
Our official support policy is that we only support the latest browser versions. Since most users automatically update their browser, we find this isn't generally an issue. When setting up test devices, we recommend similarly updating the browser/webview to emulate this common user behavior. |
@danroth27 While it's true that most users automatically update their browsers, not all users are accustomed to doing so. Setting the tsconfig target to a version as high as ES2022 can lead to compatibility issues, especially considering that .NET 8 targets ES2019. For a framework with such a large user base, backward compatibility is crucial. Many popular JavaScript libraries set their minimum support to ES2015, and I believe that for Blazor, targeting ES2019 would be a more reasonable approach. This change would help prevent any breaking updates when upgrading to .NET 9. Thank you for your reply! |
The majority of our user base does not have access to the latest mobile devices. |
@nieuwveen That's certainly true, but even older devices can still get browser updates. So even if the user has an older phone, often they will still have an updated browser that can run Blazor apps. Most often we hear about users hitting problems testing with emulated devices for older Android versions that haven't been similarly updated. But if you're instead hitting problems with users using your deployed Blazor app on an actual device, please do let us know!
This is certainly an option for those who are able to take on this additional responsibility. Obviously, we can't make any claims how well this will work because it's not a scenario we test and directly support. |
@danroth27 It's not just the emulator, we have physical testing devices for various Android versions, and we encounter these issues on devices running below Android 12, as I have already pointed out. While I can certainly clone this project and manually compile the Related issues: #57326 dotnet/maui#24278 |
@danroth27 You are right that older phones still receive updates, but not every user installs them. Sometimes there isn’t enough space to install them, or users may not know about the updates. |
Is there an existing issue for this?
Describe the bug
The blazor.*.js files generated by .NET 9 utilize the static initialization block feature introduced in ES2022. This usage causes compatibility issues on lower-end devices and older browsers.
You can find instances of this issue by searching for
static{
in the generated files.related issue: dotnet/maui#24278 dotnet/maui#25862
Expected Behavior
Regenerate using ES2019(.NET 8) as the target, just like before.
Steps To Reproduce
No response
Exceptions (if any)
No response
.NET Version
net9.0
Anything else?
No response
The text was updated successfully, but these errors were encountered: