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

Clarify WebviewPanelSerializer doc #50747

Closed
octref opened this issue May 29, 2018 · 1 comment
Closed

Clarify WebviewPanelSerializer doc #50747

octref opened this issue May 29, 2018 · 1 comment
Assignees
Labels
Milestone

Comments

@octref
Copy link
Contributor

octref commented May 29, 2018

#50696

interface WebviewPanelSerializer {
  /**
   * Restore a webview panel from its serialized `state`.
   *
   * Called when a serialized webview first becomes visible.
   *
   * @param webviewPanel Webview panel to restore. The serializer should take ownership of this panel.
   * @param state Persisted state. This state comes from the value set inside the webview by `acquireVsCodeApi().setState`.
   *
   * @return Thenable indicating that the webview has been fully restored.
   */
  deserializeWebviewPanel(webviewPanel: WebviewPanel, state: any): Thenable<void>
}

Webview panel to restore.

Well, maybe being too pedantic but the item being stored is the panel's webview, not the panel.

The serializer should take ownership of this panel.

"The serializer should take ownership of this panel" is a bit vague.

Maybe something like "The WebviewPanel whose webview will be restored by the serializer"?

Called when a serialized webview first becomes visible.

I suggest adding some information. It's unclear when this is called. From my testing closing -> opening new WebviewPanel won't get it called, but it'll get called for VS Code reload & restart.

@mjbvz mjbvz added this to the June 2018 milestone Jun 1, 2018
@mjbvz
Copy link
Collaborator

mjbvz commented Jun 21, 2018

Added notes with fae2d73 and will be updating webview example to use persistence APIs

@mjbvz mjbvz closed this as completed Jun 21, 2018
@vscodebot vscodebot bot locked and limited conversation to collaborators Aug 5, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants