Some map-layers provider, such as the upcoming ArcGIS feature provider would benefit from using web workers. To use Web worker in type scripts, a web worker needs to be created this way:
this._worker = new Worker(new URL("./PaintWorker.js", **import.meta.url**));
To leverage import.meta.url, modules needs to be flagged as ESM modules in package.json using:
"type": "module"
Doing so, will make existing fails to compile. (i.e. failing import commands)
We would need guidelines on how to have ESM modules in iTwin.js.
Some map-layers provider, such as the upcoming ArcGIS feature provider would benefit from using web workers. To use Web worker in type scripts, a web worker needs to be created this way:
this._worker = new Worker(new URL("./PaintWorker.js", **import.meta.url**));
To leverage import.meta.url, modules needs to be flagged as ESM modules in package.json using:
"type": "module"
Doing so, will make existing fails to compile. (i.e. failing import commands)
We would need guidelines on how to have ESM modules in iTwin.js.