next-blurhash-previews 0.0.3-beta70 → 0.0.3-beta71

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.
@@ -84,6 +84,26 @@ function updateBlurHashPreview(canvasEl: HTMLCanvasElement, preview: blurhash) {
84
84
 
85
85
  if (true) {
86
86
  const worker = new Worker(window.URL.createObjectURL(workerBlob));
87
+
88
+ const s = +new Date();
89
+
90
+ const emptyCanv = document
91
+ .createElement("canvas")
92
+ // @ts-ignore
93
+ .transferControlToOffscreen();
94
+
95
+ worker.postMessage(
96
+ {
97
+ canvas: emptyCanv,
98
+ width: 50,
99
+ height: 50,
100
+ blurhash: "L05E$[offQofoffQfQfQfQfQfQfQ",
101
+ },
102
+ [emptyCanv]
103
+ );
104
+ const e = +new Date();
105
+ console.log("bootstrap", e - s);
106
+
87
107
  const offscreen = (canvasEl as any).transferControlToOffscreen();
88
108
  worker.postMessage({ canvas: offscreen, width, height, blurhash }, [
89
109
  offscreen,
@@ -289,6 +289,16 @@ function updateBlurHashPreview(canvasEl, preview) {
289
289
  canvasEl.height = height;
290
290
  {
291
291
  const worker = new Worker(window.URL.createObjectURL(workerBlob));
292
+ const s = +new Date();
293
+ const emptyCanv = document.createElement("canvas").transferControlToOffscreen();
294
+ worker.postMessage({
295
+ canvas: emptyCanv,
296
+ width: 50,
297
+ height: 50,
298
+ blurhash: "L05E$[offQofoffQfQfQfQfQfQfQ"
299
+ }, [emptyCanv]);
300
+ const e = +new Date();
301
+ console.log("bootstrap", e - s);
292
302
  const offscreen = canvasEl.transferControlToOffscreen();
293
303
  worker.postMessage({
294
304
  canvas: offscreen,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-blurhash-previews",
3
- "version": "0.0.3-beta70",
3
+ "version": "0.0.3-beta71",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "module": "index.js",