baseline-browser-mapping 2.5.0-beta → 2.5.0
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 +23 -8
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/package.json +6 -5
package/README.md
CHANGED
|
@@ -2,8 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
By the [W3C WebDX Community Group](https://www.w3.org/community/webdx/) and contributors.
|
|
4
4
|
|
|
5
|
-
`baseline-browser-mapping`
|
|
6
|
-
|
|
5
|
+
`baseline-browser-mapping` provides:
|
|
6
|
+
|
|
7
|
+
- An `Array` of browsers compatible with Baseline Widely available and Baseline year feature sets via the [`getCompatibleVersions()` function](#get-baseline-widely-available-browser-versions-or-baseline-year-browser-versions).
|
|
8
|
+
- An `Array`, `Object` or `CSV` as a string describing the Baseline feature set support of all browser versions included in the module's data set via the [`getAllVersions()` function](#get-data-for-all-browser-versions).
|
|
9
|
+
|
|
10
|
+
You can use `baseline-browser-mapping` to help you determine minimum browser version support for your chosen Baseline feature set; or to analyse the level of support for different Baseline feature sets in your site's traffic by joining the data with your analytics data.
|
|
7
11
|
|
|
8
12
|
## Install for local development
|
|
9
13
|
|
|
@@ -11,7 +15,7 @@ To install the package, run:
|
|
|
11
15
|
|
|
12
16
|
`npm install --save-dev baseline-browser-mapping`
|
|
13
17
|
|
|
14
|
-
`baseline-browser-mapping` depends on `web-features` and `@mdn/browser-compat-data` for version selection. This package checks for updates to those modules and [downstream browsers](#downstream-browsers) on a daily basis and is updated frequently. Consider adding a script to your `package.json` to update `basesline-browser-mapping` and using it as part of your build process to ensure your data is as up to date as possible:
|
|
18
|
+
`baseline-browser-mapping` depends on `web-features` and `@mdn/browser-compat-data` for core browser version selection, but the data is pre-packaged and minified. This package checks for updates to those modules and the supported [downstream browsers](#downstream-browsers) on a daily basis and is updated frequently. Consider adding a script to your `package.json` to update `basesline-browser-mapping` and using it as part of your build process to ensure your data is as up to date as possible:
|
|
15
19
|
|
|
16
20
|
```javascript
|
|
17
21
|
"scripts": [
|
|
@@ -19,26 +23,37 @@ To install the package, run:
|
|
|
19
23
|
]
|
|
20
24
|
```
|
|
21
25
|
|
|
26
|
+
If your installed version of `baseline-browser-mapping` is greater than 2 months old, you will receive a console warning advising you to update to the latest version.
|
|
27
|
+
|
|
22
28
|
## Importing `baseline-browser-mapping`
|
|
23
29
|
|
|
24
30
|
This module exposes two functions: `getCompatibleVersions()` and `getAllVersions()`, both which can be imported directly from `baseline-browser-mapping`:
|
|
25
31
|
|
|
26
32
|
```javascript
|
|
27
|
-
import {
|
|
33
|
+
import {
|
|
34
|
+
getCompatibleVersions,
|
|
35
|
+
getAllVersions,
|
|
36
|
+
} from "baseline-browser-mapping";
|
|
28
37
|
```
|
|
29
38
|
|
|
30
39
|
If you want to load the script and data directly in a web page without hosting it yourself, consider using a CDN:
|
|
31
40
|
|
|
32
41
|
```html
|
|
33
42
|
<script type="module">
|
|
34
|
-
import {
|
|
43
|
+
import {
|
|
44
|
+
getCompatibleVersions,
|
|
45
|
+
getAllVersions,
|
|
46
|
+
} from "https://cdn.jsdelivr.net/npm/baseline-browser-mapping";
|
|
35
47
|
</script>
|
|
36
48
|
```
|
|
37
49
|
|
|
38
|
-
`baseline-browser-mapping`
|
|
50
|
+
`baseline-browser-mapping` is packaged as an ES module by default. If you need to run it in a legacy environment that doesn't support ES modules, use the `/legacy` version:
|
|
39
51
|
|
|
40
52
|
```javascript
|
|
41
|
-
const {
|
|
53
|
+
const {
|
|
54
|
+
getCompatibleVersions,
|
|
55
|
+
getAllVersions,
|
|
56
|
+
} = require("baseline-browser-mapping/legacy");
|
|
42
57
|
```
|
|
43
58
|
|
|
44
59
|
## Get Baseline Widely available browser versions or Baseline year browser versions
|
|
@@ -76,7 +91,7 @@ Executed on 7th March 2025, the above code returns the following browser version
|
|
|
76
91
|
```
|
|
77
92
|
|
|
78
93
|
> [!NOTE]
|
|
79
|
-
> The minimum versions of each browser are not
|
|
94
|
+
> The minimum versions of each browser are not necessarily the final release before the Widely available cutoff date of `TODAY - 30 MONTHS`. Some earlier versions will have supported the full Widely available feature set.
|
|
80
95
|
|
|
81
96
|
### `getCompatibleVersions()` configuration options
|
|
82
97
|
|