cubing / cubing.js

🛠 A library for displaying and working with twisty puzzles. Also currently home to the code for Twizzle.
https://js.cubing.net/cubing/
GNU General Public License v3.0
232 stars 42 forks source link

Reduce round trips for workers by using `modulepreload` #291

Open lgarron opened 9 months ago

lgarron commented 9 months ago

https://developer.chrome.com/blog/modulepreload/

We can't set this in HTML, but we could try creating <link rel="modulepreload" href="path/to/worker/entry"> from JavaScript when cubing/search is loaded, so that the worker instantiation is primed sooner.

This requires https://github.com/evanw/esbuild/issues/2866 for us to implement.