瀏覽代碼

Remove ensure-max-old-space script.

This was a workaround for node 10 that allowed many users to compile JupyterLab without running out of memory (especially if they had lots of extensions installed). It is no longer needed for Node 12 or higher, where memory management is automatic. Node 10 is now in maintenance mode,  (since May 2019) and node 12 is also almost in maintenance mode (starting Nov 2020), so I think we can drop the Node 10 workaround.

Users still on Node 10 will still be able to manually increase their available memory by setting the environment variable NODE_OPTIONS=--max-old-space-size=4096, for example.

This change dropping the workaround for Node 10 was originally done in Dec 2019 in #7677, but then reverted in #8112 (to support node 10 in jlab 2.1).
Jason Grout 4 年之前
父節點
當前提交
56d3d0537b

+ 0 - 3
builder/package.json

@@ -16,7 +16,6 @@
   "types": "lib/index.d.ts",
   "bin": {
     "build-labextension": "./lib/build-labextension.js",
-    "ensure-max-old-space": "./lib/ensure-max-old-space.js"
   },
   "directories": {
     "lib": "lib/"
@@ -67,7 +66,6 @@
     "webpack": "^5.3.1",
     "webpack-cli": "^4.1.0",
     "webpack-merge": "^5.1.2",
-    "which": "^2.0.2",
     "worker-loader": "^3.0.2"
   },
   "devDependencies": {
@@ -75,7 +73,6 @@
     "@types/glob": "^7.1.1",
     "@types/node": "^14.6.1",
     "@types/supports-color": "^5.3.0",
-    "@types/which": "^1.3.2",
     "rimraf": "~3.0.0",
     "typescript": "~4.0.2"
   },

+ 0 - 32
builder/src/ensure-max-old-space.ts

@@ -1,32 +0,0 @@
-#!/usr/bin/env node
-/* -----------------------------------------------------------------------------
-| Copyright (c) Jupyter Development Team.
-| Distributed under the terms of the Modified BSD License.
-|----------------------------------------------------------------------------*/
-
-/**
- * This file is a temporary workaround to ensure that we can set
- * max_old_space by default but allow others to override it.
- *
- * When node 10 support is dropped, we can remove this file as node 12
- * should just grow as required.
- *
- * See: https://github.com/jupyterlab/jupyterlab/issues/7175
- *
- * @example
- * node ensure-max-old-space.js real-cli.js arg1 arg2
- */
-import { execFileSync } from 'child_process';
-import * as which from 'which';
-
-const MAX_OLD_SPACE = '--max_old_space_size=4096';
-
-if (!process.env.NODE_OPTIONS) {
-  process.env.NODE_OPTIONS = MAX_OLD_SPACE;
-} else if (!/--max[_\-]old[_\-]space[_\-]size/.test(process.env.NODE_OPTIONS)) {
-  process.env.NODE_OPTIONS += ` ${MAX_OLD_SPACE}`;
-}
-
-const program = which.sync(process.argv[2]);
-const args = process.argv.slice(3);
-execFileSync(program, args, { env: process.env, stdio: 'inherit' });

+ 0 - 1
buildutils/package.json

@@ -60,7 +60,6 @@
     "@types/inquirer": "^7.3.1",
     "@types/node": "^14.6.1",
     "@types/prettier": "^2.1.0",
-    "@types/which": "^1.3.2",
     "rimraf": "~3.0.0"
   },
   "publishConfig": {

+ 5 - 5
dev_mode/package.json

@@ -6,10 +6,10 @@
     "build": "webpack",
     "build:dev": "jlpm run build",
     "build:dev:minimize": "jlpm run build:dev",
-    "build:prod": "ensure-max-old-space webpack --config webpack.prod.config.js",
-    "build:prod:minimize": "ensure-max-old-space webpack --config webpack.prod.minimize.config.js",
-    "build:prod:release": "ensure-max-old-space webpack --config webpack.prod.release.config.js",
-    "build:prod:stats": "ensure-max-old-space webpack --profile --config webpack.prod.minimize.config.js --json > stats.json",
+    "build:prod": "webpack --config webpack.prod.config.js",
+    "build:prod:minimize": "webpack --config webpack.prod.minimize.config.js",
+    "build:prod:release": "webpack --config webpack.prod.release.config.js",
+    "build:prod:stats": "webpack --profile --config webpack.prod.minimize.config.js --json > stats.json",
     "build:stats": "webpack --profile --json > stats.json",
     "clean": "rimraf build",
     "prepublishOnly": "npm run build",
@@ -194,7 +194,7 @@
     "yarn-deduplicate": "^2.1.1"
   },
   "engines": {
-    "node": ">=10.0.0"
+    "node": ">=12.0.0"
   },
   "jupyterlab": {
     "name": "JupyterLab",

+ 1 - 1
docs/source/developer/contributing.rst

@@ -97,7 +97,7 @@ Installing Node.js and jlpm
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 Building JupyterLab from its GitHub source code requires Node.js. The
-development version requires Node.js version 10+, as defined in the
+development version requires Node.js version 12+, as defined in the
 ``engines`` specification in
 `dev_mode/package.json <https://github.com/jupyterlab/jupyterlab/blob/master/dev_mode/package.json>`__.