You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* proof of concept use paralleljs for inline workers
* use Paralleljs and reintroduce workers to SiteMap
* automatic babel polyfill support in worker libs
* document worker deatils in README; SiteMap feature tweak
* workerize parsing of time series data
* comments and commented code cleanup
Copy file name to clipboardExpand all lines: README.md
+44-8Lines changed: 44 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -101,21 +101,57 @@ If you have added or modified third-party dependencies then it is important to v
101
101
102
102
Run `rm -rf node_modules && npm install` and re-run the app to validate a fresh install. This mimics how other apps importing `portal-core-components` will see your changes.
103
103
104
-
### Worker Caveats
104
+
### Using Workers in Components
105
105
106
-
This library does support workers in its current build process using `worker-loader`. To create a worker
107
-
name any worker file `*.worker.js`.
106
+
This library supports parallel processing using web workers for components by using [Parallel.js](https://parallel.js.org/).
108
107
109
-
Note, however, that a bug in `react-app-rewired` can mean lint errors in workers may silently break
110
-
production builds but not development builds. See [here](https://github.com/timarney/react-app-rewired/issues/362) for details.
108
+
To see how workers are currently in use in this library, see `src/lib_components/workers`. Example:
111
109
112
-
If you have added or modified a worker file and are seeing empty production builds then manually look for
113
-
and fix any lint errors using this command (from the root directory):
110
+
```
111
+
import Parallel from 'paralleljs';
112
+
113
+
export default function myWorker(argument) {
114
+
const worker = new Parallel(argument);
115
+
return worker.spawn((inData) => {
116
+
/* do processing to generate outData */
117
+
return outData;
118
+
});
119
+
}
120
+
```
121
+
122
+
A worker like this could then be imported elsewhere and used with promise-stype syntax. Example:
0 commit comments