-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Use modern build for ipad os 15 and macos 11 #21695
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
We cannot hard code the versions because they can change with time and/or usage stats. I'm looking into the best solution here.
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.
May be we should also put Safari 16 in browserlist file to have the same target in browserlist. I agree it's not perfect but I didn't find another solution 😢
Let's me know if you find something better!
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.
I've put in many hours researching this now, and the only solid conclusion I've got is that Apple needs to do better. 😞
For iPad, I think home-assistant/iOS#2918 is the best solution (and looks like @bgoncal just merged it as I'm typing so 🥳). There's no reason we need to allow the app to spoof the user agent to pretend it's a Mac because it won't affect the frontend result at all. So the current regex will work now for iPad at least.
For the Mac app, that's a complete mess. I had a discussion with @bgoncal and continued to research, and the only version provided by Apple's API is the OS version (i.e. there's no way to query what WebKit or Safari version gets used by the web view). And it's not provided in the default user agent string either. So the only choice is to map it ourselves. The only question for me becomes: should the MacOS version map to the Safari version it's shipped with, or the latest version it supports? Based on my research, I think the former is correct, but I'm not 100% sure on that.
I started looking into how to automate this similar to the way
browserslist-useragent-regexp
works, and I think I could probably throw that together without too much trouble. It's late here now so I'll do that tomorrow.Regarding putting more Safari versions in the
browserslist
config, I agree. Currently, modern is served to iOS 15.6+ and Safari 17+, which doesn't make much sense from a transpilation/polyfilling perspective. That's just reflecting that iPhones are way more popular than Macs. We can hard code a sync for now and maybe I'll do another PR tobrowserslist
for a nicer solution.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.
I agree! Thank you for the research! 🙂
That was more or less my conclusion too.
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.
Opened browserslist/browserslist#838. I'll work on the change for Mac in a bit.