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

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

lauriii created an issue. See original summary.

lauriii’s picture

Status: Active » Needs review
FileSize
1.04 KB

Here's an updated browserslist. I ran yarn run build:js to ensure this didn't result in any changes in the production code.

Wim Leers’s picture

Wim Leers’s picture

+++ b/core/package.json
@@ -71,12 +71,18 @@
-                  "ie >= 9",
-                  "edge >= 13",
-                  "firefox >= 5",
-                  "opera >= 12",
-                  "safari >= 5",
-                  "chrome >= 56"
+                  "last 2 Chrome major versions",
+                  "last 2 Firefox major versions",
+                  "last 2 Safari major versions",
+                  "last 2 Edge major versions",
+                  "last 2 Opera versions",
+                  "last 2 iOS major versions",
+                  "last 1 Explorer major version",
+                  "last 1 ChromeAndroid version",
+                  "last 1 UCAndroid version",
+                  "last 1 Samsung version",
+                  "last 1 OperaMini version",
+                  "Firefox ESR"

This matches https://www.drupal.org/node/3079238 exactly.

With two exceptions:

  1. Chrome for iOS is absent from this list.
  2. Why Firefox ESR and not last 1 Firefox ESR version?
zrpnr’s picture

#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-list

This 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 to npx 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:

8.8.x #2
chrome 75 and_chr 75
chrome 74 and_uc 12.12
chrome 73 chrome 75
chrome 72 chrome 74
chrome 71 edge 18
chrome 70 edge 17
chrome 69 firefox 68
chrome 68 firefox 67
chrome 67 firefox 60
chrome 66 ie 11
chrome 65 ios_saf 12.2-12.3
chrome 64 ios_saf 12.0-12.1
chrome 63 ios_saf 11.3-11.4
chrome 62 ios_saf 11.0-11.2
chrome 61 op_mini all
chrome 60 opera 62
chrome 59 opera 60
chrome 58 safari 12.1
chrome 57 safari 12
chrome 56 safari 11.1
edge 18 safari 11
edge 17 samsung 9.2
edge 16
edge 15
edge 14
edge 13
firefox 68
firefox 67
firefox 66
firefox 65
firefox 64
firefox 63
firefox 62
firefox 61
firefox 60
firefox 59
firefox 58
firefox 57
firefox 56
firefox 55
firefox 54
firefox 53
firefox 52
firefox 51
firefox 50
firefox 49
firefox 48
firefox 47
firefox 46
firefox 45
firefox 44
firefox 43
firefox 42
firefox 41
firefox 40
firefox 39
firefox 38
firefox 37
firefox 36
firefox 35
firefox 34
firefox 33
firefox 32
firefox 31
firefox 30
firefox 29
firefox 28
firefox 27
firefox 26
firefox 25
firefox 24
firefox 23
firefox 22
firefox 21
firefox 20
firefox 19
firefox 18
firefox 17
firefox 16
firefox 15
firefox 14
firefox 13
firefox 12
firefox 11
firefox 10
firefox 9
firefox 8
firefox 7
firefox 6
firefox 5
ie 11
ie 10
ie 9
opera 62
opera 60
opera 58
opera 57
opera 56
opera 55
opera 54
opera 53
opera 52
opera 51
opera 50
opera 49
opera 48
opera 47
opera 46
opera 45
opera 44
opera 43
opera 42
opera 41
opera 40
opera 39
opera 38
opera 37
opera 36
opera 35
opera 34
opera 33
opera 32
opera 31
opera 30
opera 29
opera 28
opera 27
opera 26
opera 25
opera 24
opera 23
opera 22
opera 21
opera 20
opera 19
opera 18
opera 17
opera 16
opera 15
opera 12.1
opera 12
safari 12.1
safari 12
safari 11.1
safari 11
safari 10.1
safari 10
safari 9.1
safari 9
safari 8
safari 7.1
safari 7
safari 6.1
safari 6
safari 5.1
safari 5

This is a huge improvement, and besides trimming down the list now specifically supports opera mini which it didn't seem to before.

Wim Leers’s picture

Status: Needs review » Reviewed & tested by the community

Thanks, @zrpnr!

It's super weird that Firefox ESR is this special snowflake :O Apparently ESR is short for Extended 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 does npx 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 the browserslist 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.

lauriii’s picture

According 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.

Wim Leers’s picture

Yep, I should've mentioned that 🤦‍♂️👍

droplet’s picture

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.

Let'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.

Wim Leers’s picture

Let's add FF 68?

That's already included in Firefox ESR:

$ npx browserslist 'Firefox ESR'
npx: installed 5 in 1.71s
firefox 68
firefox 60

😊

Wim Leers’s picture

Hrm, 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:

browserslist@^4.6.3:
  …

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:

      return ['firefox 60']

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:

      return ['firefox 68', 'firefox 60']

How is this happening? Well, my yarn.lock actually contains:

browserslist@^4.6.3:
  version "4.6.6"
  …

So everyone who does yarn install locally is already guaranteed to get the same results.

👍

xjm’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs change record

Neat!

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:

Here's an updated browserslist. I ran yarn run build:js to ensure this didn't result in any changes in the production code.

...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.

xjm’s picture

Also, 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.)

droplet’s picture

#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

- When to drop the older supports? At release date or beginning of a new branch?

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.

justafish’s picture

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

This 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.

Wim Leers’s picture

Issue tags: +Needs reroll

#3060153: Use PostCSS in core, initially only for Claro just landed, this now needs to be rebased.

zrpnr’s picture

The "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 running npx browserslist in the core directory.

zrpnr’s picture

Status: Needs work » Needs review
Wim Leers’s picture

Issue tags: -Needs reroll

That sounds right! Thanks for the reroll 🙏

Wim Leers’s picture

Issue tags: -Needs change record

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?)

https://www.drupal.org/node/3079238 already sort of covered it, but now it does explicitly. Yes, transpilation is what it does.

Wim Leers’s picture

Status: Needs review » Reviewed & tested by the community

Now that there are no tags indicating further work, let's look at the comments since RTBC that still need addressing.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

  • lauriii committed 9e1768c on 9.0.x
    Issue #3084843 by lauriii, zrpnr, Wim Leers, droplet, xjm, justafish:...

  • lauriii committed afe51d1 on 8.9.x
    Issue #3084843 by lauriii, zrpnr, Wim Leers, droplet, xjm, justafish:...

  • lauriii committed 3211423 on 8.8.x
    Issue #3084843 by lauriii, zrpnr, Wim Leers, droplet, xjm, justafish:...
lauriii’s picture

Version: 8.9.x-dev » 8.8.x-dev
Status: Reviewed & tested by the community » Fixed

Committed 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!

shaal’s picture

  • lauriii committed 2e4f104 on 9.0.x
    Issue #3094696 by huzooka, fhaeberle: Follow-up to #3084843: Re-generate...

  • lauriii committed 180b20f on 8.9.x
    Issue #3094696 by huzooka, fhaeberle: Follow-up to #3084843: Re-generate...

  • lauriii committed 0362d34 on 8.8.x
    Issue #3094696 by huzooka, fhaeberle: Follow-up to #3084843: Re-generate...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.