Skip to content

Conversation

@connor4312
Copy link
Member

This serializes code in the webview so that we make sure preloads load
before rending output. Since the rendering of HTML can be deferred,
we also potentially need to defer other actions like clearing and
focusing.

This PR fixes #101151

/cc @JacksonKearl

This serializes code in the webview so that we make sure preloads load
before rending output. Since the rendering of HTML can be deferred,
we also potentially need to defer other actions like clearing and
focusing.
@connor4312 connor4312 added this to the June 2020 milestone Jun 26, 2020
@connor4312 connor4312 requested a review from rebornix June 26, 2020 23:09
@connor4312 connor4312 self-assigned this Jun 26, 2020
type: 'clear';
}

export interface IFocusOutputMessage {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(this was duplicated, likely a copy-paste error)

}

createInset(cell: CodeCellViewModel, output: IProcessedOutput, cellTop: number, offset: number, shadowContent: string, preloads: Set<string>) {
async createInset(cell: CodeCellViewModel, output: IProcessedOutput, cellTop: number, offset: number, shadowContent: string, preloads: Set<string>) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think making this async is safe, since the display of content was already asynchronous behind the postMessage being sent.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's safe. Can we also make the call hierarchy explicit async then others won't use it incorrectly later on?

Copy link
Member

@rebornix rebornix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Tested with setTimeout and it works fine.

@connor4312 connor4312 merged commit b26cde7 into master Jun 30, 2020
@connor4312 connor4312 deleted the connor4312/serialize-webview-loading branch June 30, 2020 00:19
@github-actions github-actions bot locked and limited conversation to collaborators Aug 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NotebookRendererApi#onDidCreateOutput not called on reload

4 participants