[api-minor] Update the minimum supported Node.js version to 18
This patch updates the minimum supported environments as follows: - Node.js 18, which was released on 2022-04-19; see https://en.wikipedia.org/wiki/Node.js#Releases Note also that Node.js 16 will soon reach EOL, and thus no longer receive any security updates.
This commit is contained in:
parent
eca40773b8
commit
ed8be6f882
@ -80,7 +80,7 @@ const ENV_TARGETS = [
|
|||||||
"Chrome >= 88",
|
"Chrome >= 88",
|
||||||
"Firefox ESR",
|
"Firefox ESR",
|
||||||
"Safari >= 14.1",
|
"Safari >= 14.1",
|
||||||
"Node >= 16",
|
"Node >= 18",
|
||||||
"> 1%",
|
"> 1%",
|
||||||
"not IE > 0",
|
"not IE > 0",
|
||||||
"not dead",
|
"not dead",
|
||||||
@ -2168,7 +2168,6 @@ function packageJson() {
|
|||||||
},
|
},
|
||||||
dependencies: {
|
dependencies: {
|
||||||
"path2d-polyfill": "^2.0.1",
|
"path2d-polyfill": "^2.0.1",
|
||||||
"web-streams-polyfill": "^3.2.1",
|
|
||||||
},
|
},
|
||||||
browser: {
|
browser: {
|
||||||
canvas: false,
|
canvas: false,
|
||||||
@ -2184,7 +2183,7 @@ function packageJson() {
|
|||||||
url: DIST_REPO_URL,
|
url: DIST_REPO_URL,
|
||||||
},
|
},
|
||||||
engines: {
|
engines: {
|
||||||
node: ">=16",
|
node: ">=18",
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
18
package-lock.json
generated
18
package-lock.json
generated
@ -62,14 +62,13 @@
|
|||||||
"typogr": "^0.6.8",
|
"typogr": "^0.6.8",
|
||||||
"vinyl": "^3.0.0",
|
"vinyl": "^3.0.0",
|
||||||
"vinyl-fs": "^3.0.3",
|
"vinyl-fs": "^3.0.3",
|
||||||
"web-streams-polyfill": "^3.2.1",
|
|
||||||
"webpack": "^5.80.0",
|
"webpack": "^5.80.0",
|
||||||
"webpack-stream": "^7.0.0",
|
"webpack-stream": "^7.0.0",
|
||||||
"wintersmith": "^2.5.0",
|
"wintersmith": "^2.5.0",
|
||||||
"yargs": "^17.7.1"
|
"yargs": "^17.7.1"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=16"
|
"node": ">=18"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@ampproject/remapping": {
|
"node_modules/@ampproject/remapping": {
|
||||||
@ -18622,15 +18621,6 @@
|
|||||||
"node": ">=10.13.0"
|
"node": ">=10.13.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/web-streams-polyfill": {
|
|
||||||
"version": "3.2.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.2.1.tgz",
|
|
||||||
"integrity": "sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q==",
|
|
||||||
"dev": true,
|
|
||||||
"engines": {
|
|
||||||
"node": ">= 8"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/webidl-conversions": {
|
"node_modules/webidl-conversions": {
|
||||||
"version": "3.0.1",
|
"version": "3.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
|
||||||
@ -33566,12 +33556,6 @@
|
|||||||
"graceful-fs": "^4.1.2"
|
"graceful-fs": "^4.1.2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"web-streams-polyfill": {
|
|
||||||
"version": "3.2.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.2.1.tgz",
|
|
||||||
"integrity": "sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q==",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"webidl-conversions": {
|
"webidl-conversions": {
|
||||||
"version": "3.0.1",
|
"version": "3.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
|
||||||
|
@ -55,7 +55,6 @@
|
|||||||
"typogr": "^0.6.8",
|
"typogr": "^0.6.8",
|
||||||
"vinyl": "^3.0.0",
|
"vinyl": "^3.0.0",
|
||||||
"vinyl-fs": "^3.0.3",
|
"vinyl-fs": "^3.0.3",
|
||||||
"web-streams-polyfill": "^3.2.1",
|
|
||||||
"webpack": "^5.80.0",
|
"webpack": "^5.80.0",
|
||||||
"webpack-stream": "^7.0.0",
|
"webpack-stream": "^7.0.0",
|
||||||
"wintersmith": "^2.5.0",
|
"wintersmith": "^2.5.0",
|
||||||
@ -69,7 +68,7 @@
|
|||||||
"url": "git://github.com/mozilla/pdf.js.git"
|
"url": "git://github.com/mozilla/pdf.js.git"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=16"
|
"node": ">=18"
|
||||||
},
|
},
|
||||||
"license": "Apache-2.0"
|
"license": "Apache-2.0"
|
||||||
}
|
}
|
||||||
|
@ -133,14 +133,10 @@ class WorkerMessageHandler {
|
|||||||
// Ensure that (primarily) Node.js users won't accidentally attempt to use
|
// Ensure that (primarily) Node.js users won't accidentally attempt to use
|
||||||
// a non-translated/non-polyfilled build of the library, since that would
|
// a non-translated/non-polyfilled build of the library, since that would
|
||||||
// quickly fail anyway because of missing functionality.
|
// quickly fail anyway because of missing functionality.
|
||||||
if (
|
if (isNodeJS && typeof Path2D === "undefined") {
|
||||||
(isNodeJS && typeof Path2D === "undefined") ||
|
|
||||||
typeof ReadableStream === "undefined"
|
|
||||||
) {
|
|
||||||
const partialMsg =
|
const partialMsg =
|
||||||
"The browser/environment lacks native support for critical " +
|
"The browser/environment lacks native support for critical " +
|
||||||
"functionality used by the PDF.js library " +
|
"functionality used by the PDF.js library (e.g. `Path2D`); ";
|
||||||
"(e.g. `Path2D` and/or `ReadableStream`); ";
|
|
||||||
|
|
||||||
if (isNodeJS) {
|
if (isNodeJS) {
|
||||||
throw new Error(partialMsg + "please use a `legacy`-build instead.");
|
throw new Error(partialMsg + "please use a `legacy`-build instead.");
|
||||||
|
@ -36,17 +36,7 @@ import { isNodeJS } from "./is_node.js";
|
|||||||
polyfillPath2D(globalThis);
|
polyfillPath2D(globalThis);
|
||||||
})();
|
})();
|
||||||
|
|
||||||
// Support: Node.js<18.0.0
|
// Support: Chrome<92, Safari<15.4
|
||||||
(function checkReadableStream() {
|
|
||||||
if (globalThis.ReadableStream || !isNodeJS) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
globalThis.ReadableStream = __non_webpack_require__(
|
|
||||||
"web-streams-polyfill/dist/ponyfill.js"
|
|
||||||
).ReadableStream;
|
|
||||||
})();
|
|
||||||
|
|
||||||
// Support: Firefox<90, Chrome<92, Safari<15.4, Node.js<16.6.0
|
|
||||||
(function checkArrayAt() {
|
(function checkArrayAt() {
|
||||||
if (Array.prototype.at) {
|
if (Array.prototype.at) {
|
||||||
return;
|
return;
|
||||||
@ -54,7 +44,7 @@ import { isNodeJS } from "./is_node.js";
|
|||||||
require("core-js/es/array/at.js");
|
require("core-js/es/array/at.js");
|
||||||
})();
|
})();
|
||||||
|
|
||||||
// Support: Firefox<90, Chrome<92, Safari<15.4, Node.js<16.6.0
|
// Support: Chrome<92, Safari<15.4
|
||||||
(function checkTypedArrayAt() {
|
(function checkTypedArrayAt() {
|
||||||
if (Uint8Array.prototype.at) {
|
if (Uint8Array.prototype.at) {
|
||||||
return;
|
return;
|
||||||
@ -62,7 +52,7 @@ import { isNodeJS } from "./is_node.js";
|
|||||||
require("core-js/es/typed-array/at.js");
|
require("core-js/es/typed-array/at.js");
|
||||||
})();
|
})();
|
||||||
|
|
||||||
// Support: Firefox<94, Chrome<98, Safari<15.4, Node.js<17.0.0
|
// Support: Chrome<98, Safari<15.4
|
||||||
(function checkStructuredClone() {
|
(function checkStructuredClone() {
|
||||||
if (typeof PDFJSDev !== "undefined" && PDFJSDev.test("IMAGE_DECODERS")) {
|
if (typeof PDFJSDev !== "undefined" && PDFJSDev.test("IMAGE_DECODERS")) {
|
||||||
// The current image decoders are synchronous, hence `structuredClone`
|
// The current image decoders are synchronous, hence `structuredClone`
|
||||||
|
Loading…
Reference in New Issue
Block a user