Azure / Azure/vscode-aks-tools
Better state management for all webviews
- Dominant language
- TypeScript
- Stars
- 65
- Forks
- 78
- Avg merge
- 2d 16h
- Merged PRs (30d)
- 22
Description
We recently added the `retainContextWhenHidden` property to all our webviews.
First, this has the [documented](https://code.visualstudio.com/api/extension-guides/webview#retaincontextwhenhidden) drawback that it "has high memory overhead and should only be used when other persistence techniques will not work". We should make an informed decision whether to change this, preferably based on measured memory usage.
Second, you apparently "cannot send messages to a hidden webview". This could be a problem for some of our webviews that perform background operations in VS Code and send updates to the UI (e.g. Periscope, ASO installation, and Create Cluster). We need to test what the current behaviour is, and see whether it needs fixing. If it does, we might be able to build some caching/buffering of messages into our state management approach.
Contributor guide
Research direction
Review the webview usage of retainContextWhenHidden and the linked VS Code guidance on memory overhead. Test hidden-webview message behavior for Periscope, ASO installation, and Create Cluster. Done means measured memory findings, a decided state-management approach, and message buffering only if testing shows updates are lost.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript, vscode
- Domain
- developer-experience, frontend
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100