Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable chunking to prevent importScripts calls in web #155226

Merged
merged 1 commit into from
Jul 14, 2022

Conversation

joyceerhl
Copy link
Contributor

This PR fixes #155225

@joyceerhl joyceerhl enabled auto-merge (squash) July 14, 2022 18:46
@joyceerhl joyceerhl self-assigned this Jul 14, 2022
@VSCodeTriageBot VSCodeTriageBot added this to the July 2022 milestone Jul 14, 2022
@joyceerhl joyceerhl merged commit a0c9ebe into main Jul 14, 2022
@joyceerhl joyceerhl deleted the dev/joyceerhl/limited-clam branch July 14, 2022 18:55
@lramos15
Copy link
Member

@alexdima @jrieken Do you think this is an acceptable fix for avoiding importScripts or is there possibly some perf issues here? By disabling chunks this prevents webPack from possibly placing modules in separate files and then trying to use importScripts. This was happening some reason to the telemetry modules. @joyceerhl and I are not webpack experts so are unsure if you know of any negative side effects here

lramos15 added a commit that referenced this pull request Jul 14, 2022
* Disable chunking to prevent `importScripts` calls in web (#155226)

* Upgrade module + keys

Co-authored-by: Joyce Er <joyce.er@microsoft.com>
@jrieken
Copy link
Member

jrieken commented Jul 15, 2022

It's the trade-off between loading all code at once (and thereby loading too much for getting started) and loading code in chunks as needed (and thereby having the potential for intermittent "pauses"). VS Code itself loads all its code at once, around 10MB, and that's still OK. Extensions are usually much smaller so I don't believe this is an issue. Also, for the web worker extension host it is not possible to lazily fetch more modules - so it is not that you have choice here.

(*) the problem with the extension host is that extension code calls require('vscode') and that in nodejs we have good way to intercept that. The call doesn't return a JS module but an instance of our API. For that we intercept the call (which we could do in the web) but we also need to know the file that's making the call. The latter is only possible with stack inspection in the web and that isn't the best way of doing it

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error: 'importScripts' has been blocked
5 participants