microsoft / microsoft/vscode

feature: webview without service workers

Open
#326,331 0 comments 0 reactions 1 assignee Claimed by @amunger View on GitHub
Dominant language
TypeScript
Stars
193k
Forks
42.4k
PR merge metrics
PR metrics pending

Description

Currently, in VSCode, webviews are implemented via two iframes and a service worker.

It seems it could be possible to improve webview loading performance and fix errors by using a single iframe, instead a service workers and two iframes.

Note: The change would only affect VS Code electron, not VS Code in the browser.

### Benchmarks

Benchmarks from a prototype PR using a single iframe indicate ~25% percent load time improvement for webviews. For example for the Codex webview:

codex-webview-load-time

codex-webview-load-time

### Other Benefits

Another benefit would be that it avoids a lot of weird webview service workers errors like:

- https://github.com/microsoft/vscode/issues/326092
- https://github.com/microsoft/vscode/issues/125993

### Breaking changes

It seems there shouldn't be any breaking changes. The feature would be opt in for extensions.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.