@docusaurus/core 3.7.0-canary-6305 → 3.7.0-canary-6307

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,3 +7,4 @@
7
7
  export declare const SSGConcurrency: number;
8
8
  export declare const SSGWorkerThreadCount: number | undefined;
9
9
  export declare const SSGWorkerThreadTaskSize: number;
10
+ export declare const SSGWorkerThreadRecyclerMaxMemory: number | undefined;
package/lib/ssg/ssgEnv.js CHANGED
@@ -6,7 +6,7 @@
6
6
  * LICENSE file in the root directory of this source tree.
7
7
  */
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.SSGWorkerThreadTaskSize = exports.SSGWorkerThreadCount = exports.SSGConcurrency = void 0;
9
+ exports.SSGWorkerThreadRecyclerMaxMemory = exports.SSGWorkerThreadTaskSize = exports.SSGWorkerThreadCount = exports.SSGConcurrency = void 0;
10
10
  // Secret way to set SSR plugin async concurrency option
11
11
  // Waiting for feedback before documenting this officially?
12
12
  // TODO Docusaurus v4, rename SSR => SSG
@@ -27,3 +27,13 @@ exports.SSGWorkerThreadTaskSize = process.env
27
27
  .DOCUSAURUS_SSG_WORKER_THREAD_TASK_SIZE
28
28
  ? parseInt(process.env.DOCUSAURUS_SSG_WORKER_THREAD_TASK_SIZE, 10)
29
29
  : 10; // TODO need fine-tuning
30
+ // Controls worker thread recycling behavior (maxMemoryLimitBeforeRecycle)
31
+ // See https://github.com/facebook/docusaurus/pull/11166
32
+ // See https://github.com/facebook/docusaurus/issues/11161
33
+ exports.SSGWorkerThreadRecyclerMaxMemory = process.env
34
+ .DOCUSAURUS_SSG_WORKER_THREAD_RECYCLER_MAX_MEMORY
35
+ ? parseInt(process.env.DOCUSAURUS_SSG_WORKER_THREAD_RECYCLER_MAX_MEMORY, 10)
36
+ : // TODO we should probably provide a default value here
37
+ // 2gb is a quite reasonable max that should work well even for large sites
38
+ // we'd rather ask community feedback first
39
+ undefined;
@@ -84,6 +84,15 @@ const createPooledSSGExecutor = async ({ params, pathnames, }) => {
84
84
  runtime: 'worker_threads',
85
85
  isolateWorkers: false,
86
86
  workerData: { params },
87
+ // WORKER MEMORY MANAGEMENT
88
+ // Allows containing SSG memory leaks with a thread recycling workaround
89
+ // See https://github.com/facebook/docusaurus/pull/11166
90
+ // See https://github.com/facebook/docusaurus/issues/11161
91
+ maxMemoryLimitBeforeRecycle: ssgEnv_1.SSGWorkerThreadRecyclerMaxMemory,
92
+ resourceLimits: {
93
+ // For some reason I can't figure out how to limit memory on a worker
94
+ // See https://x.com/sebastienlorber/status/1920781195618513143
95
+ },
87
96
  });
88
97
  });
89
98
  const pathnamesChunks = lodash_1.default.chunk(pathnames, ssgEnv_1.SSGWorkerThreadTaskSize);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@docusaurus/core",
3
3
  "description": "Easy to Maintain Open Source Documentation Websites",
4
- "version": "3.7.0-canary-6305",
4
+ "version": "3.7.0-canary-6307",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
7
7
  "access": "public"
@@ -33,13 +33,13 @@
33
33
  "url": "https://github.com/facebook/docusaurus/issues"
34
34
  },
35
35
  "dependencies": {
36
- "@docusaurus/babel": "3.7.0-canary-6305",
37
- "@docusaurus/bundler": "3.7.0-canary-6305",
38
- "@docusaurus/logger": "3.7.0-canary-6305",
39
- "@docusaurus/mdx-loader": "3.7.0-canary-6305",
40
- "@docusaurus/utils": "3.7.0-canary-6305",
41
- "@docusaurus/utils-common": "3.7.0-canary-6305",
42
- "@docusaurus/utils-validation": "3.7.0-canary-6305",
36
+ "@docusaurus/babel": "3.7.0-canary-6307",
37
+ "@docusaurus/bundler": "3.7.0-canary-6307",
38
+ "@docusaurus/logger": "3.7.0-canary-6307",
39
+ "@docusaurus/mdx-loader": "3.7.0-canary-6307",
40
+ "@docusaurus/utils": "3.7.0-canary-6307",
41
+ "@docusaurus/utils-common": "3.7.0-canary-6307",
42
+ "@docusaurus/utils-validation": "3.7.0-canary-6307",
43
43
  "boxen": "^6.2.1",
44
44
  "chalk": "^4.1.2",
45
45
  "chokidar": "^3.5.3",
@@ -77,8 +77,8 @@
77
77
  "webpack-merge": "^6.0.1"
78
78
  },
79
79
  "devDependencies": {
80
- "@docusaurus/module-type-aliases": "3.7.0-canary-6305",
81
- "@docusaurus/types": "3.7.0-canary-6305",
80
+ "@docusaurus/module-type-aliases": "3.7.0-canary-6307",
81
+ "@docusaurus/types": "3.7.0-canary-6307",
82
82
  "@total-typescript/shoehorn": "^0.1.2",
83
83
  "@types/detect-port": "^1.3.3",
84
84
  "@types/react-dom": "^18.2.7",
@@ -98,5 +98,5 @@
98
98
  "engines": {
99
99
  "node": ">=18.0"
100
100
  },
101
- "gitHead": "23671c5708319ffafb2b94e29eb850e4d6c4fa1b"
101
+ "gitHead": "0e2754e95723df81393508b9014db164f2ab7f34"
102
102
  }