From 59e8c101e4f7d931600ef8e807ffd0d2844c6b36 Mon Sep 17 00:00:00 2001 From: Christophe Winkler Date: Fri, 28 Jun 2024 15:15:13 +0200 Subject: [PATCH] Bump workerpool package in the example and update the readme. --- examples/webpack5/README.md | 30 +++++++++++++++++------------ examples/webpack5/package-lock.json | 8 ++++---- examples/webpack5/package.json | 2 +- 3 files changed, 23 insertions(+), 17 deletions(-) diff --git a/examples/webpack5/README.md b/examples/webpack5/README.md index 06ea832..0e90d8a 100644 --- a/examples/webpack5/README.md +++ b/examples/webpack5/README.md @@ -1,7 +1,13 @@ # Webpack5 Workerpool Example +Warning: this example is based on the published `workerpool` package, and is not updated regularly. +Make sure to use the up-to-date package using `workerpool@latest`. + +The following ensures the example uses latest `workerpool` package: + ```bash $ npm install +$ npm install workerpool@latest $ npm run start $ npm run build ``` @@ -51,18 +57,18 @@ The workerpool needs to be transformed to work properly in a webpack5 project. Y ``` 3. Implement the worker in `worker.ts`: - ```js - // worker.ts + ```js + // worker.ts import workerpool from 'workerpool' - - // a deliberately inefficient implementation of the fibonacci sequence - function fibonacci(n) { - if (n < 2) return n; - return fibonacci(n - 2) + fibonacci(n - 1); - } - // create a worker and register public functions - workerpool.worker({ + // a deliberately inefficient implementation of the fibonacci sequence + function fibonacci(n) { + if (n < 2) return n; + return fibonacci(n - 2) + fibonacci(n - 1); + } + + // create a worker and register public functions + workerpool.worker({ fibonacci: fibonacci - }); - ``` + }); + ``` diff --git a/examples/webpack5/package-lock.json b/examples/webpack5/package-lock.json index 569bcaa..f6688a2 100644 --- a/examples/webpack5/package-lock.json +++ b/examples/webpack5/package-lock.json @@ -9,7 +9,7 @@ "version": "0.0.0", "dependencies": { "solid-js": "^1.8.7", - "workerpool": "^9.1.2" + "workerpool": "^9.1.3" }, "devDependencies": { "@babel/core": "^7.23.5", @@ -6273,9 +6273,9 @@ } }, "node_modules/workerpool": { - "version": "9.1.2", - "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-9.1.2.tgz", - "integrity": "sha512-5wZwyy5lcqrakQQcjaYQgVCbMR3djwIFWXuD2EGk/o/9bL3bd2kRGNwF74Bhcf1CIkAIwoOMG82EVnA5JmVVNw==" + "version": "9.1.3", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-9.1.3.tgz", + "integrity": "sha512-LhUrk4tbxJRDQmRrrFWA9EnboXI79fe0ZNTy3u8m+dqPN1EkVSIsQYAB8OF/fkyhG8Rtup+c/bzj/+bzbG8fqg==" }, "node_modules/wrappy": { "version": "1.0.2", diff --git a/examples/webpack5/package.json b/examples/webpack5/package.json index 45fd542..e1bb1bc 100644 --- a/examples/webpack5/package.json +++ b/examples/webpack5/package.json @@ -9,7 +9,7 @@ }, "dependencies": { "solid-js": "^1.8.7", - "workerpool": "^9.1.2" + "workerpool": "^9.1.3" }, "devDependencies": { "@babel/core": "^7.23.5",