From 585ae480ed51e0306cf4031915fbaec56c4be523 Mon Sep 17 00:00:00 2001 From: vince-fugnitto Date: Thu, 9 Feb 2023 15:20:48 -0500 Subject: [PATCH 1/2] repo: drop support for `Node 14` The commit drops support for `Node 14` in the framework, and updates documentation, CI, and typings. Signed-off-by: vince-fugnitto --- .github/workflows/ci-cd.yml | 6 +++--- .gitpod.dockerfile | 2 +- CHANGELOG.md | 6 ++++++ doc/Developing.md | 3 +-- doc/Migration.md | 7 +++++++ doc/runtime-policy.md | 4 ++-- package.json | 6 +++--- yarn.lock | 8 ++++---- 8 files changed, 27 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 2130e4f4f7126..75d9bbef0fca6 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -53,7 +53,7 @@ jobs: fail-fast: false matrix: os: [windows-2019, ubuntu-latest, macos-11] - node: [14.x, 16.x] + node: [16.x] runs-on: ${{ matrix.os }} timeout-minutes: 60 @@ -128,10 +128,10 @@ jobs: with: fetch-depth: 0 # To fetch all history for all branches and tags. (Will be required for caching with lerna: https://github.com/markuplint/markuplint/pull/111) - - name: Use Node.js 14.x + - name: Use Node.js 16.x uses: actions/setup-node@v3 with: - node-version: '14.x' + node-version: '16.x' registry-url: 'https://registry.npmjs.org' - name: Use Python 3.x diff --git a/.gitpod.dockerfile b/.gitpod.dockerfile index b8701646a143e..156d7aa676e31 100644 --- a/.gitpod.dockerfile +++ b/.gitpod.dockerfile @@ -17,7 +17,7 @@ RUN sudo apt-get update \ ENV SHELL=/bin/bash -ENV NODE_VERSION="14.19.0" +ENV NODE_VERSION="16.14.0" RUN bash -c ". .nvm/nvm.sh \ && nvm install $NODE_VERSION \ && nvm use $NODE_VERSION \ diff --git a/CHANGELOG.md b/CHANGELOG.md index 64f618db91df5..7b18e93574172 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ - [Previous Changelogs](https://github.com/eclipse-theia/theia/tree/master/doc/changelogs/) +## v1.35.0 - 02/23/2023 + +[Breaking Changes:](#breaking_changes_1.35.0) + +- [repo] drop support for `Node 14` [#12169](https://github.com/eclipse-theia/theia/pull/12169) + ## v1.34.0 - 01/26/2023 - [application-package] bumped the default supported API version from `1.55.2` to `1.66.2` [#12104](https://github.com/eclipse-theia/theia/pull/12104) diff --git a/doc/Developing.md b/doc/Developing.md index 2f0e472892c0f..be4fc0c7f422a 100644 --- a/doc/Developing.md +++ b/doc/Developing.md @@ -52,8 +52,7 @@ For Windows instructions [click here](#building-on-windows). ## Prerequisites - - Node.js `>= 14.18.0`. - - We recommend using Node's LTS: currently 16.x + - Node.js `>= 16.14.0` and `< 17`. - If you are interested in Theia's VS Code Extension support then you should use a Node version at least compatible with the one included in the version of Electron used by [VS Code](https://github.com/microsoft/vscode). - [Yarn package manager](https://yarnpkg.com/en/docs/install) `>= 1.7.0` **AND** `< 2.x.x`. - git (If you would like to use the Git-extension too, you will need to have git version 2.11.0 or higher.) diff --git a/doc/Migration.md b/doc/Migration.md index c0585fcc46747..ef28721041134 100644 --- a/doc/Migration.md +++ b/doc/Migration.md @@ -20,6 +20,13 @@ For example: } ``` +### v1.35.0 + +#### Drop support for `Node 14` + +The framework no longer supports `Node 14` in order to better support plugins targeting the default supported VS Code API of `1.68.1`. +It is always possible to build using the `yarn --ignore-engines` workaround, but we advise against it. + ### v1.32.0 #### Removal of `CircularDependencyPlugin` diff --git a/doc/runtime-policy.md b/doc/runtime-policy.md index 8f2bb44f23f17..2357b262486fe 100644 --- a/doc/runtime-policy.md +++ b/doc/runtime-policy.md @@ -45,5 +45,5 @@ with VS Code's Node runtime, which depends on the Electron version that they end You should look for this information in the [VS Code repository](https://github.com/microsoft/vscode). VS Code Extensions being meant to run in VS Code, developers may use any API available in the runtime in which their -extension runs. So if they expect to run in Node 14, then they may use Node 14 APIs. Running your Theia application -on Node 12 then means that some plugin features might not work because of missing APIs from the Node runtime. +extension runs. So if they expect to run in Node 16, then they may use Node 16 APIs. Running your Theia application +on Node 14 then means that some plugin features might not work because of missing APIs from the Node runtime. diff --git a/package.json b/package.json index 1fb44e49b83be..ec43fca57f048 100644 --- a/package.json +++ b/package.json @@ -4,17 +4,17 @@ "version": "0.0.0", "engines": { "yarn": ">=1.7.0 <2", - "node": ">=14.18.0" + "node": ">=16.14.0 <17" }, "resolutions": { - "**/@types/node": "14" + "**/@types/node": "16" }, "devDependencies": { "@types/chai": "4.3.0", "@types/chai-spies": "1.0.3", "@types/chai-string": "^1.4.0", "@types/jsdom": "^11.0.4", - "@types/node": "14", + "@types/node": "16", "@types/puppeteer": "^2.0.0", "@types/sinon": "^10.0.6", "@types/temp": "^0.8.29", diff --git a/yarn.lock b/yarn.lock index 914de9f9c7c52..045bb14259dbd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2639,10 +2639,10 @@ "@types/node" "*" form-data "^3.0.0" -"@types/node@*", "@types/node@14", "@types/node@>=10.0.0", "@types/node@^10.14.22", "@types/node@^14.6.2": - version "14.18.36" - resolved "https://registry.yarnpkg.com/@types/node/-/node-14.18.36.tgz#c414052cb9d43fab67d679d5f3c641be911f5835" - integrity sha512-FXKWbsJ6a1hIrRxv+FoukuHnGTgEzKYGi7kilfMae96AL9UNkPFNWJEEYWzdRI9ooIkbr4AKldyuSTLql06vLQ== +"@types/node@*", "@types/node@16", "@types/node@>=10.0.0", "@types/node@^10.14.22", "@types/node@^14.6.2": + version "16.18.12" + resolved "https://registry.yarnpkg.com/@types/node/-/node-16.18.12.tgz#e3bfea80e31523fde4292a6118f19ffa24fd6f65" + integrity sha512-vzLe5NaNMjIE3mcddFVGlAXN1LEWueUsMsOJWaT6wWMJGyljHAWHznqfnKUQWGzu7TLPrGvWdNAsvQYW+C0xtw== "@types/normalize-package-data@^2.4.0": version "2.4.1" From d5f84c15a5b38588ce6dac0a75f672168224eafe Mon Sep 17 00:00:00 2001 From: vince-fugnitto Date: Thu, 9 Feb 2023 15:57:11 -0500 Subject: [PATCH 2/2] fix `pid` typings Signed-off-by: vince-fugnitto --- packages/core/src/electron-main/electron-main-application.ts | 4 +++- packages/plugin-dev/src/node/hosted-instance-manager.ts | 2 +- packages/plugin-dev/src/node/hosted-plugins-manager.ts | 2 +- packages/plugin-ext/src/hosted/node/hosted-plugin-process.ts | 4 ++-- packages/process/src/node/raw-process.ts | 2 +- 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/packages/core/src/electron-main/electron-main-application.ts b/packages/core/src/electron-main/electron-main-application.ts index bcb213a46d07a..1a4d6d560fb92 100644 --- a/packages/core/src/electron-main/electron-main-application.ts +++ b/packages/core/src/electron-main/electron-main-application.ts @@ -496,7 +496,9 @@ export class ElectronMainApplication { try { // If we forked the process for the clusters, we need to manually terminate it. // See: https://github.com/eclipse-theia/theia/issues/835 - process.kill(backendProcess.pid); + if (backendProcess.pid) { + process.kill(backendProcess.pid); + } } catch (error) { // See https://man7.org/linux/man-pages/man2/kill.2.html#ERRORS if (error.code === 'ESRCH') { diff --git a/packages/plugin-dev/src/node/hosted-instance-manager.ts b/packages/plugin-dev/src/node/hosted-instance-manager.ts index c86deb06d9aa2..0429f075d8644 100644 --- a/packages/plugin-dev/src/node/hosted-instance-manager.ts +++ b/packages/plugin-dev/src/node/hosted-instance-manager.ts @@ -157,7 +157,7 @@ export abstract class AbstractHostedInstanceManager implements HostedInstanceMan } terminate(): void { - if (this.isPluginRunning) { + if (this.isPluginRunning && !!this.hostedInstanceProcess.pid) { this.hostedPluginProcess.killProcessTree(this.hostedInstanceProcess.pid); this.hostedPluginSupport.sendLog({ data: 'Hosted instance has been terminated', type: LogType.Info }); this.isPluginRunning = false; diff --git a/packages/plugin-dev/src/node/hosted-plugins-manager.ts b/packages/plugin-dev/src/node/hosted-plugins-manager.ts index 400c26c0a47d8..fe726a3db8e7f 100644 --- a/packages/plugin-dev/src/node/hosted-plugins-manager.ts +++ b/packages/plugin-dev/src/node/hosted-plugins-manager.ts @@ -96,7 +96,7 @@ export class HostedPluginsManagerImpl implements HostedPluginsManager { throw new Error('Watcher is not running in ' + pluginPath); } - this.killProcessTree(watchProcess.pid); + this.killProcessTree(watchProcess.pid!); return Promise.resolve(); } diff --git a/packages/plugin-ext/src/hosted/node/hosted-plugin-process.ts b/packages/plugin-ext/src/hosted/node/hosted-plugin-process.ts index 85df499084cae..c336fedd4045f 100644 --- a/packages/plugin-ext/src/hosted/node/hosted-plugin-process.ts +++ b/packages/plugin-ext/src/hosted/node/hosted-plugin-process.ts @@ -126,7 +126,7 @@ export class HostedPluginProcess implements ServerPluginRunner { await waitForTerminated.promise; } - this.killProcessTree(cp.pid); + this.killProcessTree(cp.pid!); } killProcessTree(parentPid: number): void { @@ -206,7 +206,7 @@ export class HostedPluginProcess implements ServerPluginRunner { childProcess.stderr!.on('data', data => this.logger.error(`[${options.serverName}: ${childProcess.pid}] ${data.toString().trim()}`)); this.logger.debug(`[${options.serverName}: ${childProcess.pid}] IPC started`); - childProcess.once('exit', (code: number, signal: string) => this.onChildProcessExit(options.serverName, childProcess.pid, code, signal)); + childProcess.once('exit', (code: number, signal: string) => this.onChildProcessExit(options.serverName, childProcess.pid!, code, signal)); childProcess.on('error', err => this.onChildProcessError(err)); return childProcess; } diff --git a/packages/process/src/node/raw-process.ts b/packages/process/src/node/raw-process.ts index 60cf5e22727d3..586917cd928d4 100644 --- a/packages/process/src/node/raw-process.ts +++ b/packages/process/src/node/raw-process.ts @@ -141,7 +141,7 @@ export class RawProcess extends Process { } get pid(): number { - if (!this.process) { + if (!this.process || !this.process.pid) { throw new Error('process did not start correctly'); } return this.process.pid;