Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Drupal 8.8.0 has a new browser support policy #2390621: [policy, no patch] Update Drupal's browser support policy. According to the policy, Drupal can start using any given browser feature after it's supported by all browsers.
Proposed resolution
Update browserslist with the browsers listed in the new browser support policy.
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
Comment | File | Size | Author |
---|---|---|---|
#27 | new-browserlist.png | 156.62 KB | shaal |
#17 | 3084843-17.patch | 715 bytes | zrpnr |
#2 | 3084843-2.patch | 1.04 KB | lauriii |
Comments
Comment #2
lauriiiHere's an updated browserslist. I ran
yarn run build:js
to ensure this didn't result in any changes in the production code.Comment #3
Wim LeersComment #4
Wim LeersThis matches https://www.drupal.org/node/3079238 exactly.
With two exceptions:
Firefox ESR
and notlast 1 Firefox ESR version
?Comment #5
zrpnr#4.1 It doesn't seem like there is a query for chrome ios, I compared against https://github.com/browserslist/browserslist#browsers
#4.2
Firefox ESR
currently returns versions 68 and 60,last 1 Firefox ESR version
is not a valid query, it's not in https://github.com/browserslist/browserslist#full-listThis can also be verified by:
editing package.json and running
yarn build:js
,by running
npx browserslist 'last 1 Firefox ESR version'
in the console from the core directory compared tonpx browserslist 'Firefox ESR'
or at https://browserl.ist/?q=last+1+Firefox+ESR+version compared to https://browserl.ist/?q=Firefox+ESR
I also saw no changes in production code after running
yarn build:js
which was surprising, however if I removed "last 1 Explorer version" there were big changes so it is clearly working!To get a sense of which browsers are in this list, I copied the entire "browsers" in package.json to a "browserslist" key at the top level, and ran
npx browerslist
from the core directory. This is the output I got:This is a huge improvement, and besides trimming down the list now specifically supports opera mini which it didn't seem to before.
Comment #6
Wim LeersThanks, @zrpnr!
It's super weird that
Firefox ESR
is this special snowflake :O ApparentlyESR
is short forExtended Support Release
. By definition it targets all currently supported "extended support" Firefox release (https://github.com/browserslist/browserslist#full-list says "the latest [Firefox ESR] version"). But https://browserl.ist/?q=Firefox+ESR currently returns both Firefox 60 and 68, and so doesnpx browserslist 'Firefox ESR'
. Meaning: two versions, not one. Okay! 👍 But … https://www.drupal.org/node/3079238 and https://www.drupal.org/docs/8/system-requirements/browser-requirements say we only support the latest version of it. This is confusing. It looks like this is simply a limitation of thebrowserslist
infrastructure.I am not the first to notice this: https://github.com/browserslist/browserslist/issues/148.
It does mean that Drupal core is not quite complying with its own official policy at https://www.drupal.org/docs/8/system-requirements/browser-requirements — it means it will support slightly more. But without extra effort being required for Drupal core maintainers.
That's probably acceptable: we don't officially support it, but due to a tooling limitation there is soft support for the oldest Firefox ESR version that Mozilla still supports.
Comment #7
lauriiiAccording to the Firefox ESR release cycle documentation, there's a few months period when there's multiple supported ESR releases. It seems like we happen to just be in one of those. So in less than a month, there will be only a single Firefox ESR release.
Comment #8
Wim LeersYep, I should've mentioned that 🤦♂️👍
Comment #9
droplet CreditAttribution: droplet commentedLet's add FF 68? One manual update per year, I think that's fine.
Technically, this is required to add browserslist & caniuse-lite to package.json and run `yarn upgrade browserslist caniuse-lite` on each update period (, the time to refresh Drupal support list) to ensure this is running on the latest DB.
Comment #10
Wim LeersThat's already included in
Firefox ESR
:😊
Comment #11
Wim LeersHrm, but @droplet brings up an interesting implied problem: how do we ensure that every single core developer is using the exact same list of browsers?
Our
yarn.lock
specifies:And if you go and look at the code for version 4.6.3, you see that https://github.com/browserslist/browserslist/blob/4.6.3/index.js#L858 contains:
but running
npx browserslist 'Firefox ESR'
returns both 60 and 68 like I showed in #10, and @zrpnr showed in #5 before me.Contrast that with version 4.6.6, where https://github.com/browserslist/browserslist/blob/4.6.6/index.js#L860 contains:
How is this happening? Well, my
yarn.lock
actually contains:So everyone who does
yarn install
locally is already guaranteed to get the same results.👍
Comment #12
xjmNeat!
Will this have any disruptive impacts? E.g., will it cause new versions of dependencies to be packaged, or other disruptions? I think this might be answered by #2:
...but I just want to confirm that that will also be true for sites, modules, etc.
We should add a CR for this, or maybe just add it to the CR for the browser policy. It may or may not be worth adding a release note. (I don't actually know what this package does -- supports JS transpilation I'm guessing?) Could use feedback on whether there's a reason to mention it.
Comment #13
xjmAlso, if this does affect JS transpilation, have we taken into account yet how we will handle this for patch releases? For our allowed changes policy, we wouldn't want to accidentally break transpiled in a patch release. (There could be a scenario where a browser releases a new version, and someone commits an otherwise non-disruptive JS bugfix that results in a new transpilation, and then the patch release breaks someone's site for their users and they file cranky bug reports.)
Comment #14
droplet CreditAttribution: droplet commented#10
drop Firefox ESR and add FF 68 instead
#11
You're running outside the `core` dir I bet.
broswerslist also showing the warning:
https://github.com/browserslist/browserslist/blob/0ae7155a6c7d8f58eaeb3e...
But simply to run `yarn upgrade` without package.json dependencies won't work.
#13
that's one of the reasons why I raised the question: https://www.drupal.org/project/drupal/issues/2390621#comment-13249420
This is not predictable like "Firefox ESR" release cycles.
If this is committed today, iOS 11 still on the list. But I think everyone here is expected to drop it. A week later, the data will catch up.
Comment #15
justafishThis is a common occurrence if you're not specifically pinning your browser versions, which is more suitable for projects that have a build step. If you're worried about it I would go back to being specific about the oldest browser version to transpile to, though I think it's extremely unlikely it would actually cause a breakage given how widely the transpiler is used and the time it takes for a Drupal release to become available.
Comment #16
Wim Leers#3060153: Use PostCSS in core, initially only for Claro just landed, this now needs to be rebased.
Comment #17
zrpnrThe "browsers" key is no longer nested under "babel" but now is in the top level as "browserslist".
Re-rolled the patch moving the list of browsers to the current location in package.json
No change to the minified js when running
yarn build:js
and the list of browsers can now be verified by runningnpx browserslist
in the core directory.Comment #18
zrpnrComment #19
Wim LeersThat sounds right! Thanks for the reroll 🙏
Comment #20
Wim Leershttps://www.drupal.org/node/3079238 already sort of covered it, but now it does explicitly. Yes, transpilation is what it does.
Comment #21
Wim LeersNow that there are no tags indicating further work, let's look at the comments since RTBC that still need addressing.
Comment #26
lauriiiCommitted 9e1768c and pushed to 9.0.x, 8.9.x and 8.8.x because this doesn't lead into changes in the production code. Thanks!
Comment #27
shaalThe supported browsers list according to this change: