-
Notifications
You must be signed in to change notification settings - Fork 29.7k
[tool][web] Fix flutter.js in Safari 13 #104761
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
[tool][web] Fix flutter.js in Safari 13 #104761
Conversation
…in flutter.js (Safari 13)
|
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat (don't just cc him here, he won't see it! He's on Discord!). If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
mdebbar
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
yjbanov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
A test exemption is reasonable because we don't have infra to test on ancient versions of iOS Safari. |
|
can we test this by scanning the code for patterns known to not work in old Safaris we want to support? if not: |
@Hixie I tried to use eslint + eslint-plugin-compat specifying the browsers we want to support, and it wasn't very trust-worthy. If eslint was adjusted to recognize the syntax (es2022) for the browsers that would support it to pass, the I also looked at For now, I'm going to land this, but it is true that there's more changes coming here that are hard to test (if at all possible) (PS: Another way of handling this is converting flutter.js in a node package, maintained separately from flutter/flutter_tools, but that might be overkill) |

The current version of
flutter.jsis using 'public class fields' (docs) that weren't supported in Safari until v14.1.This PR removes the public class field syntax, and uses instead a 'constructor' method to initialize public fields in the FlutterLoader class, which is more broadly supported (docs), importantly by Safari 13.
Fixes #104646
Testing
Testing needs to be manual, because it's almost impossible to get Safari 13 on any updated device. An iOS simulator (or an old device) are required to use the affected browser.
This PR is now deployed here:
Point Safari on an iOS Simulator on iOS 13 there to see that it loads. Compare with gallery.flutter.dev.
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.