Skip to content

Commit 99b98f2

Browse files
committed
Adds static year files and updates README.md
1 parent 7449d5a commit 99b98f2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+714
-21
lines changed

2016.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module.exports = [
2+
"Chrome >= 53",
3+
"ChromeAndroid >= 53",
4+
"Edge >= 14",
5+
"Firefox >= 49",
6+
"FirefoxAndroid >= 49",
7+
"Safari >= 10",
8+
"iOS >= 10"
9+
]

2017.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module.exports = [
2+
"Chrome >= 62",
3+
"ChromeAndroid >= 62",
4+
"Edge >= 16",
5+
"Firefox >= 53",
6+
"FirefoxAndroid >= 57",
7+
"Safari >= 11",
8+
"iOS >= 11"
9+
]

2018.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module.exports = [
2+
"Chrome >= 66",
3+
"ChromeAndroid >= 66",
4+
"Edge >= 18",
5+
"Firefox >= 64",
6+
"FirefoxAndroid >= 64",
7+
"Safari >= 11.1",
8+
"iOS >= 11.3"
9+
]

2019.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module.exports = [
2+
"Chrome >= 66",
3+
"ChromeAndroid >= 66",
4+
"Edge >= 18",
5+
"Firefox >= 65",
6+
"FirefoxAndroid >= 65",
7+
"Safari >= 13",
8+
"iOS >= 13"
9+
]

2020.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module.exports = [
2+
"Chrome >= 87",
3+
"ChromeAndroid >= 87",
4+
"Edge >= 87",
5+
"Firefox >= 83",
6+
"FirefoxAndroid >= 83",
7+
"Safari >= 14",
8+
"iOS >= 14"
9+
]

2021.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module.exports = [
2+
"Chrome >= 96",
3+
"ChromeAndroid >= 96",
4+
"Edge >= 96",
5+
"Firefox >= 95",
6+
"FirefoxAndroid >= 94",
7+
"Safari >= 15.2",
8+
"iOS >= 15.2"
9+
]

2022.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module.exports = [
2+
"Chrome >= 108",
3+
"ChromeAndroid >= 108",
4+
"Edge >= 108",
5+
"Firefox >= 108",
6+
"FirefoxAndroid >= 108",
7+
"Safari >= 16",
8+
"iOS >= 16"
9+
]

2023.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module.exports = [
2+
"Chrome >= 120",
3+
"ChromeAndroid >= 120",
4+
"Edge >= 120",
5+
"Firefox >= 121",
6+
"FirefoxAndroid >= 121",
7+
"Safari >= 17.2",
8+
"iOS >= 17.2"
9+
]

2024.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module.exports = [
2+
"Chrome >= 130",
3+
"ChromeAndroid >= 130",
4+
"Edge >= 130",
5+
"Firefox >= 132",
6+
"FirefoxAndroid >= 132",
7+
"Safari >= 18.2",
8+
"iOS >= 18.2"
9+
]

README.md

Lines changed: 77 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1-
# <img src="https://unpkg.com/[email protected]/assets/icon.svg" height="25"> browserslist-config-baseline
1+
# <img src="https://unpkg.com/[email protected]/assets/icon.svg" height="25" alt="Baseline Widely Available logo"> browserslist-config-baseline
22

3-
[Browserslist][1] config based on [WebDX Baseline][2] (as seen on MDN).
3+
A [browserslist](https://www.npmjs.com/package/browserslist) config based on [Web Platform Baseline](https://developer.mozilla.org/en-US/docs/Glossary/Baseline/Compatibility).
44

5-
Baseline identifies web platform features that work across browsers. Baseline
6-
helps you decide when to use a feature by telling you when it is less likely to
7-
cause compatibility problems for your site's visitors.
5+
Baseline identifies web platform features that work across browsers. Baseline helps you decide when to use a feature by telling you when it is less likely to cause compatibility problems for your site's visitors. There are two ways of targeting a Baseline feature set:
86

9-
[1]: https://www.npmjs.com/package/browserslist
10-
[2]: https://developer.mozilla.org/en-US/docs/Glossary/Baseline/Compatibility
7+
1. [Baseline Widely Available](#baseline-widely-available) - includes all features that were fully supported in Chrome, Edge, Firefox and Safari **30 months before the current data**.
8+
2. [Baseline year feature sets](#baseline-year-feature-sets) - includes all features that were fully supported in Chrome, Edge, Firefox and Safari **at the end of a given calendar year**.
9+
10+
You should check your analytics to see which browser versions are prevalent in your userbase before selecting a Baseline target.
11+
12+
## Baseline Widely Available
1113

1214
<!-- prettier-ignore -->
1315
```json
@@ -18,21 +20,78 @@ cause compatibility problems for your site's visitors.
1820
}
1921
```
2022

21-
## Browsers
23+
> **WARNING:**
24+
> The default configuration of this module approximates Baseline Widely Available by taking all versions of the core browser set released in the last 2.5 years. However, there will be discrepancies between the real Baseline Widely Available feature set and the minimum browser versions this module returns. The real Baseline Widely Available feature set is supported by one or more versions of the core browser set prior to the 2.5 year cut off. As a result, this module may cause your packager to skip polyfills that you need or fail to highlight improper usage of newer web features. To provide a fully accurate list of browsers compatible with Baseline Widely Available, consider using [`bl2bl`](https://npmjs.org/bl2bl).
25+
26+
## Baseline year feature sets
2227

23-
This config includes versions of
28+
Baseline year feature sets include all the web platform features that were fully supported in the core browser set at the end of a given calendar year. To use a Baseline year feature set, add the year in the format `/YYYY` to the end of your `extends` statement:
29+
30+
<!-- prettier-ignore -->
31+
```json
32+
{
33+
"browserslist": [
34+
"extends browserslist-config-baseline/2020"
35+
]
36+
}
37+
```
38+
39+
This equates to the following `browserslist` config:
40+
41+
```json
42+
{
43+
"browserslist": [
44+
"Chrome >= 87",
45+
"ChromeAndroid >= 87",
46+
"Edge >= 87",
47+
"Firefox >= 83",
48+
"FirefoxAndroid >= 83",
49+
"Safari >= 14",
50+
"iOS >= 14"
51+
]
52+
}
53+
```
2454

25-
- Apple Safari (iOS)
26-
- Apple Safari (macOS)
27-
- Google Chrome (Android)
28-
- Google Chrome (desktop)
29-
- Microsoft Edge (desktop)
30-
- Mozilla Firefox (Android)
31-
- Mozilla Firefox (desktop)
55+
The minimum browser versions that support these feature sets are usually the last version released in that year or a few versions earlier. The feature set > browser version mappings in this module were determined using [`baseline-browser-mapping`](https://npmjs.org/baseline-browser-mapping).
56+
57+
## Include Chromium downstream browsers
58+
59+
To include browsers that implement Chromium where possible, insert `/with-downstream` into your statement between the root directory and the year:
60+
61+
<!-- prettier-ignore -->
62+
```json
63+
{
64+
"browserslist": [
65+
"extends browserslist-config-baseline/with-downstream/2020"
66+
]
67+
}
68+
```
69+
70+
This equates to the following `browserslist` config:
71+
72+
```json
73+
{
74+
"browserslist": [
75+
"Chrome >= 87",
76+
"ChromeAndroid >= 87",
77+
"Edge >= 87",
78+
"Firefox >= 83",
79+
"FirefoxAndroid >= 83",
80+
"Safari >= 14",
81+
"iOS >= 14",
82+
"Opera >= 73",
83+
"op_mob >= 62",
84+
"Samsung >= 14.0",
85+
"Android >= 87",
86+
"and_uc >= 15.3",
87+
"and_qq >= 11.7"
88+
]
89+
}
90+
```
3291

33-
released within the last 30 months. This means that all features tagged as
34-
**widely available** on MDN should be safe to use without any polyfills.
92+
The minimum browser versions of non-core browsers are provided by `baseline-browser-mapping` based on two sources: [`@mdn/browser-compat-data`](https://npmjs.org/@mdn/browsers-compat-data) where those engine version mappings exist, and parsed user agents from [`useragents.io`](https://useragents.io) where necessary. For more information on these mappings, please see [`baseline-browser-mapping`'s README](https://www.npmjs.com/package/baseline-browser-mapping#downstream-browsers).
3593

3694
## See also
3795

96+
- [bl2bl](https://github.com/web-platform-dx/bl2bl) - a command line tool for generating Baseline compliant `browserslist` configurations that are readable in `package.json` and/or `.browserslistrc` files.
3897
- [WebDX Baseline specification](https://github.com/web-platform-dx/web-features/blob/main/docs/baseline.md)

0 commit comments

Comments
 (0)