Open avaer opened 4 years ago
Note that this implementation would require that any packages to be loaded are placed on the backend first (you couldn't just load a local file without a server).
Some of the CORS issues might be addressable by WebGPU in the future, if it can interoperate with WebGL.
Also, I suspect the way to implement this would be Lambda or Cloudflare, or a usual cached script on our backed -- we would route some something like this to the unpacker:
https://exokit.org/_package/Qmfdssfsdjgkdjghjkg/src/three.js
Right now we use a service worker, mostly for reasons of unpacking and serving local packages. However, this has a lot of downsides associated with it:
However, this code could be moved to the backend. We could, instead of running a local service worker, write a package loading API on the backend, which would pull files from the package based on hash and path:
With proper caching this might end up faster too.