absolutely insane. seems like its installing pip packages and running localhost in the browser? I don't 100% grasp what is happening underneath the hood. But usually you would launch the local server, browse over to http://localhost to view it in your browser. This is running the web server inside Web Assembly inside your browser? Is it then possible to expose that local web server inside web assembly to the internet? Crazy stuff! looks like its possible to speed up the initial load time by using web workers, very much eager to see that in action.
It runs everything in a web worker at the moment, not sure if there are optimizations I could make by running more of them in parallel?
It doesn't exactly run a localhost server. It uses a mechanism from Datasette's internals that lets you simulate an HTTP request through the Datasette application and get back the result. Then it sends that result back as a message from the worker to the parent page.