baseline-browser-mapping 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +185 -0
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
# [`baseline-browser-mapping`](https://github.com/web-platform-dx/web-features/packages/baseline-browser-mapping)
|
|
2
|
+
|
|
3
|
+
By the [W3C WebDX Community Group](https://www.w3.org/community/webdx/) and contributors.
|
|
4
|
+
|
|
5
|
+
`baseline-browser-mapping` exposes arrays of browsers compatible with Baseline Widely Available and specified Baseline year feature sets.
|
|
6
|
+
You can use `baseline-browser-mapping` to help you determine minimum browser version support for your chosen Baseline feature set.
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
## Limitations
|
|
11
|
+
|
|
12
|
+
The browser versions in this module come from two different sources:
|
|
13
|
+
|
|
14
|
+
* MDN's `browser-compat-data` module.
|
|
15
|
+
* Parsed user agent strings provided by [useragents.io](https://useragents.io/)
|
|
16
|
+
|
|
17
|
+
MDN `browser-compat-data` is an authoritative source of information for the browsers it contains. The release dates for the Baseline core browser set and the mapping of downstream browsers to Chromium versions should be considered accurate.
|
|
18
|
+
|
|
19
|
+
Browser mappings from useragents.io are provided on a best effort basis. They assume that browser vendors are accurately stating the Chromium version they have implemented.
|
|
20
|
+
|
|
21
|
+
> **TODO** Add details on how downstream mappings were created and are updated once script and action are in place and tested in @tonypconway 's fork.
|
|
22
|
+
|
|
23
|
+
Unfortunately, useragents.io does not have "first seen" dates prior to June 2020. However, these browsers' Baseline compatibility is determined by their Chromium version, so their release dates are more informative than critical.
|
|
24
|
+
|
|
25
|
+
> **Note**
|
|
26
|
+
> At present, the selection criteria for core browser versions compatible with a given feature set is: the final version of each browser prior to the cut off date for that feature set. In the case of Widely Available, this is 30 months in the past and in the case of Baseline years, this is the end of the year specified. In future, when the `web-features` repository is data complete, it should be possible to determine if earlier browser versions support the specified feature set.
|
|
27
|
+
|
|
28
|
+
## Prerequisites
|
|
29
|
+
|
|
30
|
+
To use this package, you'll need:
|
|
31
|
+
|
|
32
|
+
* Node.js (a supported [current, active LTS, or maintenance LTS release](https://nodejs.org/en/about/previous-releases))
|
|
33
|
+
|
|
34
|
+
## Install
|
|
35
|
+
|
|
36
|
+
To install the package, run:
|
|
37
|
+
|
|
38
|
+
`npm install --save baseline-browser-mapping`
|
|
39
|
+
|
|
40
|
+
If you wish to specify which version of `@mdn/browser-compat-data` (or manage its upgrades explicitly, such as with Dependabot), then install the latest `@mdn/browser-compat-data` too.
|
|
41
|
+
Run:
|
|
42
|
+
|
|
43
|
+
`npm install --save @mdn/browser-compat-data@latest`
|
|
44
|
+
|
|
45
|
+
Updating this module and `@mdn/browser-compat-data` regularly is recommended to ensure you have the most up to date downstream browsers.
|
|
46
|
+
|
|
47
|
+
## Usage
|
|
48
|
+
|
|
49
|
+
### Import the module
|
|
50
|
+
|
|
51
|
+
First, import the module:
|
|
52
|
+
|
|
53
|
+
```javascript
|
|
54
|
+
import baselineBrowserMapping from "baseline-browser-mapping";
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Get Baseline Widely Available browser versions
|
|
58
|
+
|
|
59
|
+
To get the current list of minimum browser versions compatible with Baseline Widely Available features from the core browser set, call the `getMinimumWidelyAvailable` method:
|
|
60
|
+
|
|
61
|
+
```javascript
|
|
62
|
+
baselineBrowserMapping.getMinimumWidelyAvailable()
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Executed on 29th November 2024, the above code returns the final version of each core browser released on or before 24th May 2022 i.e. 30 months before the date of execution:
|
|
66
|
+
|
|
67
|
+
```javascript
|
|
68
|
+
[
|
|
69
|
+
{
|
|
70
|
+
browser: 'chrome',
|
|
71
|
+
version: '102',
|
|
72
|
+
release_date: '2022-05-24',
|
|
73
|
+
engine: null,
|
|
74
|
+
engine_version: null
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
browser: 'chrome_android',
|
|
78
|
+
version: '102',
|
|
79
|
+
release_date: '2022-05-24',
|
|
80
|
+
engine: null,
|
|
81
|
+
engine_version: null
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
browser: 'edge',
|
|
85
|
+
version: '101',
|
|
86
|
+
release_date: '2022-04-28',
|
|
87
|
+
engine: null,
|
|
88
|
+
engine_version: null
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
browser: 'firefox',
|
|
92
|
+
version: '100',
|
|
93
|
+
release_date: '2022-05-03',
|
|
94
|
+
engine: null,
|
|
95
|
+
engine_version: null
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
browser: 'firefox_android',
|
|
99
|
+
version: '100',
|
|
100
|
+
release_date: '2022-05-03',
|
|
101
|
+
engine: null,
|
|
102
|
+
engine_version: null
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
browser: 'safari',
|
|
106
|
+
version: '15.5',
|
|
107
|
+
release_date: '2022-05-16',
|
|
108
|
+
engine: null,
|
|
109
|
+
engine_version: null
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
browser: 'safari_ios',
|
|
113
|
+
version: '15.5',
|
|
114
|
+
release_date: '2022-05-16',
|
|
115
|
+
engine: null,
|
|
116
|
+
engine_version: null
|
|
117
|
+
}
|
|
118
|
+
]
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
If you need a list of _all_ compatible versions, you can call:
|
|
122
|
+
|
|
123
|
+
```javascript
|
|
124
|
+
baselineBrowserMapping.getAllWidelyAvailable()
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### Get Baseline Widely Available compatible browser versions as of a specific date
|
|
128
|
+
|
|
129
|
+
To get the minimum browser versions that supported Baseline Widely Available on a specific date, call `getMinimumWidelyAvailableOnDate` or `geAllWidelyAvailableOnDate`, passing the desired date in the format `YYYY-MM-DD`:
|
|
130
|
+
|
|
131
|
+
```javascript
|
|
132
|
+
baselineBrowserMapping.getMinimumWidelyAvailableOnDate('2021-03-19')
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
This would return the final version of each core browser released on or before 19th September 2018 i.e. 30 months before 19th March 2021.
|
|
136
|
+
|
|
137
|
+
### Get Baseline year compatible browser versions
|
|
138
|
+
|
|
139
|
+
To get the list of browser versions that support a particular year's Baseline feature set, call `getMinimumByYear` or `getAllByYear` passing the desired year in the format YYYY:
|
|
140
|
+
|
|
141
|
+
```javascript
|
|
142
|
+
baselineBrowserMapping.getMinimumByYear('2020')
|
|
143
|
+
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
### Including downstreambrowsers
|
|
147
|
+
|
|
148
|
+
Each of the methods above can take an optional final boolean parameter `includeDownstream`. The default for this in all functions is `false`. To include downstream browsers, pass `true` as the final parameter when you call the function:
|
|
149
|
+
|
|
150
|
+
```javascript
|
|
151
|
+
baselineBrowserMapping.getAllWidelyAvailable(true)
|
|
152
|
+
|
|
153
|
+
baselineBrowserMapping.getMinimumWidelyAvailableOnDate('2021-03-19' true)
|
|
154
|
+
|
|
155
|
+
baselineBrowserMapping.getMinimumByYear('2020', true)
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
Passing `true` will include the appropriate versions of the browsers listed as "Core" = `false` below.
|
|
159
|
+
|
|
160
|
+
## Currently included browsers
|
|
161
|
+
|
|
162
|
+
| Browser | ID | Core | Source |
|
|
163
|
+
| --------------------- | ------------------------- | ------- | ------------------------- |
|
|
164
|
+
| Chrome | `chrome` | `true` | MDN `browser-compat-data` |
|
|
165
|
+
| Chrome for Android | `chrome_android` | `true` | MDN `browser-compat-data` |
|
|
166
|
+
| Edge | `edge` | `true` | MDN `browser-compat-data` |
|
|
167
|
+
| Firefox | `firefox` | `true` | MDN `browser-compat-data` |
|
|
168
|
+
| Firefox for Android | `firefox_android` | `true` | MDN `browser-compat-data` |
|
|
169
|
+
| Safari | `safari` | `true` | MDN `browser-compat-data` |
|
|
170
|
+
| Safari on iOS | `safari_ios` | `true` | MDN `browser-compat-data` |
|
|
171
|
+
| Opera | `opera` | `false` | MDN `browser-compat-data` |
|
|
172
|
+
| Opera Android | `opera_android` | `false` | MDN `browser-compat-data` |
|
|
173
|
+
| Samsung Internet | `samsunginternet_android` | `false` | MDN `browser-compat-data` |
|
|
174
|
+
| WebView Android | `webview_android` | `false` | MDN `browser-compat-data` |
|
|
175
|
+
| QQ Browser Mobile | `qq_android` | `false` | useragents.io |
|
|
176
|
+
| UC Browser Mobile | `UC_android` | `false` | useragents.io |
|
|
177
|
+
| Yandex Browser Mobile | `ya_android` | `false` | useragents.io |
|
|
178
|
+
|
|
179
|
+
> **Note**
|
|
180
|
+
> All the non-core browsers currently included implement Chromium. Their inclusion in any of the above functions is based on the Baseline feature set supported by the Chromium version they implement, not their release date.
|
|
181
|
+
|
|
182
|
+
## Helping out and getting help
|
|
183
|
+
|
|
184
|
+
`baseline-browser-mapping` is part of the W3C WebDX Community Group's web-features project.
|
|
185
|
+
Go to [web-platform-dx/web-features](https://github.com/web-platform-dx/web-features/) for more information on contributing or getting help.
|
package/package.json
CHANGED