Skip to content

Commit

Permalink
Merge pull request #28 from lucaswerkmeister/no-node-12
Browse files Browse the repository at this point in the history
Drop support for Node 12
  • Loading branch information
lucaswerkmeister committed Jun 10, 2023
2 parents 5e7ef4e + a8d299b commit 94380d4
Show file tree
Hide file tree
Showing 12 changed files with 100 additions and 143 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
8 changes: 4 additions & 4 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 12
node-version: 16
- 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 12needs Node fetch() (see #23)
# don’t run test:readme in Node 12 – needs --harmony-top-level-await
- run: npm run test:readme
# don’t run test:lint in Node 16no point running it twice
# don’t run test:browser in Node 16 – needs Node fetch() (see #23)
test-package-lock:
runs-on: ubuntu-latest
steps:
Expand Down
6 changes: 6 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@ 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.
As part of this, `add-performance-global.js` has been removed,
as it is no longer needed.
- Improved `README.md` formatting for npmjs.com.
- Updated dependencies.

## v0.7.3 (2023-04-11)

Expand Down
17 changes: 9 additions & 8 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 Expand Up @@ -443,7 +444,7 @@ The stable, public interface comprises the following items:

The internal interface additionally comprises the following items:

- The paths / existence of the `axios.js`, `fetch.js`, `combine.js` and `add-performance-global.js` files.
- The paths / existence of the `axios.js`, `fetch.js` and `combine.js` files.

- All exports of those files, or of files in the public interface, that have not been marked `@private`.

Expand Down
5 changes: 0 additions & 5 deletions add-performance-global.js

This file was deleted.

4 changes: 2 additions & 2 deletions axios.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import axios from 'axios';
import { HttpCookieAgent, HttpsCookieAgent } from 'http-cookie-agent';
import { HttpCookieAgent, HttpsCookieAgent } from 'http-cookie-agent/http';
import { CookieJar } from 'tough-cookie';
import { Session } from './core.js';

Expand All @@ -19,7 +19,7 @@ class AxiosSession extends Session {
constructor( apiUrl, defaultParams = {}, defaultOptions = {} ) {
super( apiUrl, defaultParams, defaultOptions );
const agentOptions = {
jar: new CookieJar(),
cookies: { jar: new CookieJar() },
keepAlive: true,
};
this.session = axios.create( {
Expand Down
1 change: 0 additions & 1 deletion node.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { AxiosSession } from './axios.js';
import { mixCombiningSessionInto } from './combine.js';
import './add-performance-global.js';

export default class NodeSession extends AxiosSession {
}
Expand Down

0 comments on commit 94380d4

Please sign in to comment.