feat!: drop support for node16 (#10912)

This commit is contained in:
Nikolay Vitkov 2024-02-02 13:12:28 +01:00 committed by GitHub
parent e04016a4a0
commit 953f4207b1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 9 additions and 26 deletions

8
package-lock.json generated
View File

@ -10893,7 +10893,7 @@
"@types/yargs": "17.0.32"
},
"engines": {
"node": ">=16.3.0"
"node": ">=18.17.1"
}
},
"packages/browsers/node_modules/cliui": {
@ -10945,7 +10945,7 @@
"@schematics/angular": "^17.0.7"
},
"engines": {
"node": ">=16.13.2"
"node": ">=18.17.1"
}
},
"packages/ng-schematics/node_modules/@angular-devkit/architect": {
@ -11382,7 +11382,7 @@
"@types/node": "18.17.15"
},
"engines": {
"node": ">=16.13.2"
"node": ">=18.17.1"
}
},
"packages/puppeteer-core": {
@ -11405,7 +11405,7 @@
"rxjs": "7.8.1"
},
"engines": {
"node": ">=16.13.2"
"node": ">=18.17.1"
}
},
"packages/puppeteer-core/node_modules/@types/node": {

View File

@ -87,7 +87,7 @@
"author": "The Chromium Authors",
"license": "Apache-2.0",
"engines": {
"node": ">=16.3.0"
"node": ">=18"
},
"files": [
"lib",

View File

@ -48,7 +48,7 @@
"author": "The Chromium Authors",
"license": "Apache-2.0",
"engines": {
"node": ">=16.13.2"
"node": ">=18"
},
"dependencies": {
"@angular-devkit/architect": "^0.1701.1",

View File

@ -31,7 +31,7 @@
"url": "https://github.com/puppeteer/puppeteer/tree/main/packages/puppeteer-core"
},
"engines": {
"node": ">=16.13.2"
"node": ">=18"
},
"scripts": {
"build:docs": "wireit",

View File

@ -14,7 +14,6 @@ import {isErrorLike} from '../util/ErrorLike.js';
import type {ConnectionTransport} from './ConnectionTransport.js';
import type {ConnectOptions} from './ConnectOptions.js';
import type {BrowserConnectOptions} from './ConnectOptions.js';
import {getFetch} from './fetch.js';
const getWebSocketTransportClass = async () => {
return isNode
@ -93,9 +92,8 @@ async function getConnectionTransport(
async function getWSEndpoint(browserURL: string): Promise<string> {
const endpointURL = new URL('/json/version', browserURL);
const fetch = await getFetch();
try {
const result = await fetch(endpointURL.toString(), {
const result = await globalThis.fetch(endpointURL.toString(), {
method: 'GET',
});
if (!result.ok) {

View File

@ -15,7 +15,6 @@ export * from './Debug.js';
export * from './Device.js';
export * from './Errors.js';
export * from './EventEmitter.js';
export * from './fetch.js';
export * from './FileChooser.js';
export * from './GetQueryHandler.js';
export * from './HandleIterator.js';

View File

@ -1,14 +0,0 @@
/**
* @license
* Copyright 2020 Google Inc.
* SPDX-License-Identifier: Apache-2.0
*/
/**
* Gets the global version if we're in the browser, else loads the node-fetch module.
*
* @internal
*/
export const getFetch = async (): Promise<typeof fetch> => {
return (globalThis as any).fetch || (await import('cross-fetch')).fetch;
};

View File

@ -32,7 +32,7 @@
"url": "https://github.com/puppeteer/puppeteer/tree/main/packages/puppeteer"
},
"engines": {
"node": ">=16.13.2"
"node": ">=18"
},
"scripts": {
"build:docs": "wireit",