Azure / Azure/vscode-aks-tools

Better state management for all webviews

Open
#267 0 comments 0 reactions 0 assignees View on GitHub
enhancement 🚀
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.