From 9a6703061c2d23343736f1fcb26789fd6a8731b3 Mon Sep 17 00:00:00 2001 From: Max Schmitt Date: Fri, 30 Apr 2021 13:26:09 +0200 Subject: [PATCH] chore: drop support for Node.js 10 --- .github/ISSUE_TEMPLATE/bug.md | 2 +- .github/workflows/infra.yml | 4 +-- .github/workflows/publish_canary_docker.yml | 2 +- .github/workflows/publish_canary_driver.yml | 2 +- .github/workflows/publish_canary_npm.yml | 2 +- .github/workflows/publish_release.yml | 6 ++--- .github/workflows/tests.yml | 27 ++++++++++----------- docs/src/intro-js.md | 2 +- docs/src/troubleshooting.md | 2 +- package.json | 2 +- packages/build_package.js | 3 +++ tsconfig.json | 2 +- utils/generate_types/test/tsconfig.json | 2 +- 13 files changed, 30 insertions(+), 28 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug.md b/.github/ISSUE_TEMPLATE/bug.md index 6b9c74a255869..3277cf41baf4d 100644 --- a/.github/ISSUE_TEMPLATE/bug.md +++ b/.github/ISSUE_TEMPLATE/bug.md @@ -10,7 +10,7 @@ assignees: '' **Context:** - Playwright Version: [what Playwright version do you use?] - Operating System: [e.g. Windows, Linux or Mac] -- Node.js version: [e.g. 10.12, 10.14] +- Node.js version: [e.g. 12.22, 14.6] - Browser: [e.g. All, Chromium, Firefox, WebKit] - Extra: [any specific details about your environment] diff --git a/.github/workflows/infra.yml b/.github/workflows/infra.yml index 4a082cf6d7863..d9965b3176cf0 100644 --- a/.github/workflows/infra.yml +++ b/.github/workflows/infra.yml @@ -18,7 +18,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-node@v2 with: - node-version: 10 + node-version: 12 - uses: microsoft/playwright-github-action@v1 - run: npm ci - run: npm run build @@ -38,7 +38,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-node@v2 with: - node-version: 10 + node-version: 12 - uses: microsoft/playwright-github-action@v1 - run: npm ci - run: npm run build diff --git a/.github/workflows/publish_canary_docker.yml b/.github/workflows/publish_canary_docker.yml index 1185d8866a542..6c854d03c957e 100644 --- a/.github/workflows/publish_canary_docker.yml +++ b/.github/workflows/publish_canary_docker.yml @@ -25,7 +25,7 @@ jobs: - uses: microsoft/playwright-github-action@v1 - uses: actions/setup-node@v2 with: - node-version: 10.15 + node-version: 12 - run: npm ci - run: npm run build - run: ./utils/docker/build.sh bionic playwright:localbuild-bionic diff --git a/.github/workflows/publish_canary_driver.yml b/.github/workflows/publish_canary_driver.yml index 4342c97ee74dd..934ca6e990640 100644 --- a/.github/workflows/publish_canary_driver.yml +++ b/.github/workflows/publish_canary_driver.yml @@ -15,7 +15,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-node@v2 with: - node-version: 12.x + node-version: 12 registry-url: 'https://registry.npmjs.org' - uses: microsoft/playwright-github-action@v1 - run: npm ci diff --git a/.github/workflows/publish_canary_npm.yml b/.github/workflows/publish_canary_npm.yml index 7a4a5e1551820..4e3a1fa2c1671 100644 --- a/.github/workflows/publish_canary_npm.yml +++ b/.github/workflows/publish_canary_npm.yml @@ -16,7 +16,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-node@v2 with: - node-version: 10 + node-version: 12 registry-url: 'https://registry.npmjs.org' - uses: microsoft/playwright-github-action@v1 - run: npm ci diff --git a/.github/workflows/publish_release.yml b/.github/workflows/publish_release.yml index dc695d0be525d..a6e5132511b7c 100644 --- a/.github/workflows/publish_release.yml +++ b/.github/workflows/publish_release.yml @@ -13,7 +13,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-node@v2 with: - node-version: 10 + node-version: 12 registry-url: 'https://registry.npmjs.org' - uses: microsoft/playwright-github-action@v1 - run: npm ci @@ -30,7 +30,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-node@v2 with: - node-version: 12.x + node-version: 12 registry-url: 'https://registry.npmjs.org' - uses: microsoft/playwright-github-action@v1 - run: npm ci @@ -56,7 +56,7 @@ jobs: - uses: microsoft/playwright-github-action@v1 - uses: actions/setup-node@v2 with: - node-version: 10.15 + node-version: 12 - run: npm ci - run: npm run build - run: ./utils/docker/build.sh bionic playwright:localbuild-bionic diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0f3b333d36aaa..9c4e44f6a90fc 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -28,7 +28,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-node@v2 with: - node-version: 10 + node-version: 12 - run: npm ci - run: npm run build - run: node lib/cli/cli install-deps ${{ matrix.browser }} chromium @@ -56,7 +56,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-node@v2 with: - node-version: 10 + node-version: 12 - run: npm ci - run: npm run build - run: node lib/cli/cli install-deps ${{ matrix.browser }} chromium @@ -104,7 +104,6 @@ jobs: fail-fast: false matrix: node_version: - - "^10.17.0" # pre 10.17, --unhandled-rejections=strict was not an option (https://github.com/nodejs/node/pull/26599) which we need in our tests - "^12.0.0" - "^14.1.0" # pre 14.1, zip extraction was broken (https://github.com/microsoft/playwright/issues/1988) timeout-minutes: 20 @@ -129,7 +128,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-node@v2 with: - node-version: 10 + node-version: 12 - run: npm ci - run: npm run build - run: node lib/cli/cli install-deps ${{ matrix.browser }} chromium @@ -158,7 +157,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-node@v2 with: - node-version: 10 + node-version: 12 - run: npm ci - run: npm run build - run: node lib/cli/cli install-deps chromium @@ -186,7 +185,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-node@v2 with: - node-version: 10 + node-version: 12 - run: npm ci - run: npm run build - run: node lib/cli/cli install-deps ${{ matrix.browser }} chromium @@ -239,7 +238,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-node@v2 with: - node-version: 10 + node-version: 12 - name: Install Chrome Stable run: sudo apt install google-chrome-stable - run: npm ci @@ -272,7 +271,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-node@v2 with: - node-version: 10 + node-version: 12 - run: npm ci env: PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 @@ -299,7 +298,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-node@v2 with: - node-version: 10 + node-version: 12 - run: npm ci env: PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 @@ -324,7 +323,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-node@v2 with: - node-version: 10 + node-version: 12 - run: npm ci env: PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 @@ -354,7 +353,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-node@v2 with: - node-version: 10 + node-version: 12 - run: npm ci env: PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 @@ -380,7 +379,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-node@v2 with: - node-version: 10 + node-version: 12 - run: npm ci env: PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 @@ -407,7 +406,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-node@v2 with: - node-version: 10 + node-version: 12 - run: npm ci env: PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 @@ -431,7 +430,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-node@v2 with: - node-version: 10 + node-version: 12 - run: npm ci - run: npm run build - run: node lib/cli/cli install-deps chromium diff --git a/docs/src/intro-js.md b/docs/src/intro-js.md index 33d8d0cb4954f..73d4ef42aa683 100644 --- a/docs/src/intro-js.md +++ b/docs/src/intro-js.md @@ -97,7 +97,7 @@ let page: import('playwright').Page; ## System requirements -Playwright requires Node.js version 10.17 or above. The browser binaries for Chromium, +Playwright requires Node.js version 12 or above. The browser binaries for Chromium, Firefox and WebKit work across the 3 platforms (Windows, macOS, Linux): * **Windows**: Works with Windows and Windows Subsystem for Linux (WSL). diff --git a/docs/src/troubleshooting.md b/docs/src/troubleshooting.md index 0a6360bedc13d..fd48a6e63c987 100644 --- a/docs/src/troubleshooting.md +++ b/docs/src/troubleshooting.md @@ -28,7 +28,7 @@ await page.evaluate(`(async() => { ### ReferenceError: URL is not defined -Playwright requires Node.js 10 or higher. Node.js 8 is not supported, and will cause you to receive this error. +Playwright requires Node.js 12 or higher. Node.js 8 is not supported, and will cause you to receive this error. # Please file an issue diff --git a/package.json b/package.json index fa135481a1184..8092e9fc11bc6 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "repository": "github:Microsoft/playwright", "homepage": "https://playwright.dev", "engines": { - "node": ">=10.17.0" + "node": ">=12" }, "scripts": { "ctest": "folio --config=tests/config/default.config.ts --tag=chromium", diff --git a/packages/build_package.js b/packages/build_package.js index e3d04532e0a82..e6a10fb82299f 100755 --- a/packages/build_package.js +++ b/packages/build_package.js @@ -141,6 +141,9 @@ if (!args.some(arg => arg === '--no-cleanup')) { bin: { playwright: './lib/cli/cli.js', }, + engines: { + node: '>=12', + }, exports: { // Root import: we have a wrapper ES Module to support the following syntax. // const { chromium } = require('playwright'); diff --git a/tsconfig.json b/tsconfig.json index 7bc45b7d90292..1507a055a0f2f 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,6 +1,6 @@ { "compilerOptions": { - "target": "es2018", + "target": "ES2019", "module": "commonjs", "lib": ["esnext", "dom", "DOM.Iterable"], "sourceMap": true, diff --git a/utils/generate_types/test/tsconfig.json b/utils/generate_types/test/tsconfig.json index f042a91379e00..f4caa29cf9330 100644 --- a/utils/generate_types/test/tsconfig.json +++ b/utils/generate_types/test/tsconfig.json @@ -1,7 +1,7 @@ { "compilerOptions": { "strict": true, - "target": "es2015", + "target": "ES2019", "noEmit": true, "moduleResolution": "node" },