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.
Motivation / Background
The new AllowBrowser feature was added in #50505 . It permits setting minimum browser versions for an application, defines and documents a
:modern
version-set as requiring a list of certain features, and adds that option to the default config for new apps.This PR has been created to make two minor corrections to
:modern
, one to its versions, one to its documentation.Detail
:modern
browser versions to match the description of required features. Specifically, CSS nesting isn't supported by Chrome until 120, Opera until 106 (1, 2).Additional information
Personally I'm not convinced this feature will be a good default for new apps, but if it's going to be offered, it should be correct for its stated purpose.
For fun, I benchmarked
UserAgent.parse.browser
on my laptop and it runs in about 40 microseconds, which is faster than I'd expected. But the runtimerequire "useragent"
added 30 milliseconds to the first request.The
useragent
gem was last updated five years ago, and its browser recognition code is all 7 to 9 years old. It seems inappropriate to have a:modern
default that doesn't recognize Edge (2015). There's a fork by art19 that recognizes Edge, but it adds 54 other browsers too, so it has 4x the LoC, and itsrequire
is 90 milliseconds. Something in-between might be nice.I made a google spreadsheet listing browser versions that support each of the
:modern
features listed. The tl;dr is that badges and css nesting are the most-restrictive requirement for every major browser except Firefox (which was late to support css :has).