Webview - retainContextWhenHidden #1464
-
Hey there, I noticed in your examples that retainContextWhenHidden is set to true when creating the Webview editor provider and changing it to false breaks the diagram functionality (i.e. if you change tab and then come back the diagram will be blank). The VSCode docs warn against using this setting due to performance overhead unless necessary. We were wondering if you had to turn this on for specific reasons? And whether it would be feasible for us to turn it off and then implement any missing functionality. Cheers |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @jmenzies12, disabling this option means that the diagram editor webview is always disposed when hidden e.g. by switching to another tab.
Some additional work would be required to make this work properly. After an initial evaluation we ended up with the decision that the I agree in the long run a more sophisticated solution without retaining the context would be preferable.
And probably a couple of other issues that we are not even aware of right now. So while its technically feasible the effort to achieve this is rather high. Do you encounter any performance issues related to this? If not I would recommend to keep using the |
Beta Was this translation helpful? Give feedback.
Hi @jmenzies12,
disabling this option means that the diagram editor webview is always disposed when hidden e.g. by switching to another tab.
When the diagram editor tab then is focused again the webview has to be recreated from scratch.
Without any additional improvements for GLSP this would mean that we have to re-initiate the communication to the server and create a new diagram session. This has some severe downsides:
Some additional work would be required to make th…