-
Notifications
You must be signed in to change notification settings - Fork 38
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
Update for new NotebookCellOutput changes #35
Conversation
Note I have more testing to do here. But wanted to put this up earlier rather than later since I've not worked in this area much. Would rather get feedback if I'm barking up any wrong trees earlier. Main testing is to update the downloaded renderer bits alongside VS Code stable to make sure that the old API path still works. Also there needs to be update changes in the ipywidget code in the jupyter extension. Will file separate issue and handle that separate. |
data: { | ||
[request.mime]: request.value | ||
}, | ||
metadata: request.metadata || {}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly the naming seems odd. metadata.metadata feels vague to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we give VS Code that feedback?
Testing done:
@DonJayamanne Any other particular areas of testing that I should do to verify this? |
try { | ||
console.error('request', request); | ||
console.log('request', request); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure why these were errors, so I converted them.
if (outputMetadata && outputMetadata[request.mimeType] && outputMetadata[request.mimeType].metadata) { | ||
const metadata: Record<string, any> = {}; | ||
|
||
const oldRequest = (request as unknown) as OldNotebookOutputEventParams; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is casting to unknown
better practice?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was what I was reading. (Full confession, I didn't actually know this beforehand, and looked it up after a hint from a TS compiler warning). Here is Anders commenting on the addition of unknown. Basically a typesafe any
so that you can use it safely as an intermediate with casting.
microsoft/TypeScript#24439
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TIL, thanks :)
data: { | ||
[request.mime]: request.value | ||
}, | ||
metadata: request.metadata || {}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we give VS Code that feedback?
@IanMatthewHuff you might want to update the code in Jpuyter extension, we have some code related to ipywidgets as well. src/datascience-ui/ipywidgets/renderer/index.ts |
Squashing as tests are passing on AzDO |
Update per changes here:
microsoft/vscode#117444