Skip to content

Commit

Permalink
Drop Node 12 / 14 compatibility
Browse files Browse the repository at this point in the history
Require Node 16. (I’m open to even bumping this to Node 18 later, but I
don’t think it’s needed at the moment.) Part of #25.
  • Loading branch information
lucaswerkmeister committed Jun 10, 2023
1 parent 5e7ef4e commit f45b933
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 30 deletions.
3 changes: 1 addition & 2 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
Node 14.17.0
Node 12.22.0
Node 16.0.0
Chrome 63
ChromeAndroid 63
Firefox 60
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 14
node-version: 16
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- run: npm publish
Expand All @@ -30,7 +30,7 @@ jobs:
path: gh-pages
- uses: actions/setup-node@v3
with:
node-version: 14
node-version: 16
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- name: Update old documentation
Expand Down
18 changes: 1 addition & 17 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,12 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
node-version: 16
- run: npm ci
- run: npm test
env:
MEDIAWIKI_USERNAME: ${{ secrets.MEDIAWIKI_USERNAME }}
MEDIAWIKI_PASSWORD: ${{ secrets.MEDIAWIKI_PASSWORD }}
test-most:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 12
- run: npm ci
- run: npm run test:unit
- run: npm run test:node
env:
MEDIAWIKI_USERNAME: ${{ secrets.MEDIAWIKI_USERNAME }}
MEDIAWIKI_PASSWORD: ${{ secrets.MEDIAWIKI_PASSWORD }}
# don’t run test:lint in Node 12 – no point running it twice
# don’t run test:browser in Node 12 – needs Node fetch() (see #23)
# don’t run test:readme in Node 12 – needs --harmony-top-level-await
test-package-lock:
runs-on: ubuntu-latest
steps:
Expand Down
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ but this file may sometimes contain later improvements (e.g. typo fixes).

## next (not yet released)

- BREAKING CHANGE:
m3api now requires at least Node.js version 16,
up from Node 12.22.0 or Node 14.17.0 previously.
- Improved `README.md` formatting for npmjs.com.

## v0.7.3 (2023-04-11)
Expand Down
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -395,22 +395,23 @@ Here are some guidelines or recommendations for creating m3api extension package

## Compatibility

In Node.js, m3api is compatible with Node 14.17.0 or later,
or in the Node 12 line with Node 12.22.0 or later.
In Node.js, m3api is compatible with Node 16 or later.
Among major browsers, m3api is compatible with
Chrome 63, Firefox 60, Edge 79, Opera 50 (46 on Android), Safari 12, and Samsung Internet 8.0.
The relevant requirements of m3api are:
The relevant browser requirements of m3api are:

- Support for ES6 modules (`import`/`export`).
Stable in Node since 12.22.0 or 14.17.0
(available but considered experimental, with or without a feature flag,
in several older Node versions).
Supported in Firefox since version 60.
(Other browsers supported async generators before ES6 modules.)

- Support for async generators (`async function *`, `for await … of`).
Supported since Chrome 63, Edge 79, Opera 50 (46 on Android), Safari 12, Samsung Internet 8.0.
(Firefox and Node supported ES6 modules before async generators.)
(Firefox supported ES6 modules before async generators.)

The Node.js version requirement is based on the `performance` global being defined
(prior to Node 16, it had to be imported from `node:perf_hooks`).
If you need support for earlier Node.js versions,
try using m3api v0.7.3.

Other modern features used by m3api –
destructuring assignment, spread syntax, default arguments, classes, etc. –
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"author": "Lucas Werkmeister <mail@lucaswerkmeister.de>",
"license": "ISC",
"engines": {
"node": "^12.22.0 || >=14.17.0"
"node": "^16.0.0"
},
"dependencies": {
"axios": "^1.3.5",
Expand Down

0 comments on commit f45b933

Please sign in to comment.