Open rchiodo opened 7 months ago
I think we may be using the remote file API for the dist.url as well. That would be part of the problem. We should be able to use the old way to read stuff from the dist folder.
Part of the problem here is the bundle is obfuscated. Splitting the bundle is harder than it was in AZNB because VS code rewrites the Worker object to not allow us to pass our own blob.url (where we rewrite the worker import scripts). They're passing their own blob url where they rewrite the importScripts here: https://github.com/microsoft/vscode/blob/1be73b4a517ad5c4b6361b1fdbeedb8fc6d0d3a1/src/vs/workbench/api/worker/extensionHostWorker.ts#L131
Might need to look into computing this at runtime (and overwrite what webpack does in its calls to importScripts). Hard part is getting the distUrl to the webpack script.
This might be a function of writing a placeholder for the worker that actually has its own calls to importScripts?
Something like:
self.onMessage((msg) => {
// At this point here it should be able to rewrite importScripts because we're
// already loaded in to the browser.
importScripts('./browser.async.bundle.js');
});
It makes sense, but it's not really usable.
here's some timings for reading site-packages files:
The parse time is about 10x what we'd get locally.
There's something else that's weird, it seems we rebind/parse builtins over and over again:
This is with no changes.