Support ipywidgets in the kernel work#11444
Conversation
| } else if (message === InteractiveWindowMessages.LoadAllCellsComplete) { | ||
| const notebook = this.getNotebook(); | ||
| if (!notebook) { | ||
| traceError( |
There was a problem hiding this comment.
THis was firing during tests when running the interactive window. #Resolved
| return; | ||
| } | ||
| this.ipyWidgetMessageDispatcher = this.widgetMessageDispatcherFactory.create(this.notebookIdentity); | ||
| if (!this.ipyWidgetMessageDispatcher) { |
There was a problem hiding this comment.
Seemed odd that we'd recreate this object every time we asked for a dispatcher. #Resolved
| // Then create the real kernel. We will remap its serialize/deserialize functions | ||
| // to do nothing so that we can control serialization at our socket layer. | ||
| if (!nonSerializingKernel) { | ||
| nonSerializingKernel = require('@jupyterlab/services/lib/kernel/nonSerializingKernel') as typeof import('@jupyterlab/services/lib/kernel/default'); // NOSONAR |
There was a problem hiding this comment.
A comment pointing to the post install step where we make this would be helpful, especially for something this funky. #Resolved
There was a problem hiding this comment.
| public async asWebviewUri(localResource: Uri): Promise<Uri> { | ||
| // Make a copy of the local file if not already in the correct location | ||
| if (!localResource.fsPath.startsWith(this._rootScriptFolder)) { | ||
| if (!localResource.fsPath.toLocaleLowerCase().startsWith(this._rootScriptFolder.toLocaleLowerCase())) { |
There was a problem hiding this comment.
This isn't true on unix.
Did you come across an instance where you had issues with case on windows?
#Resolved
There was a problem hiding this comment.
There was a problem hiding this comment.
I need an areSubPathsSame or something like it.
In reply to: 416060240 [](ancestors = 416060240,416040444)
| throw new Error('No session available?'); | ||
| public shutdown(): Promise<void> { | ||
| suppressShutdownErrors(this.realKernel); | ||
| return this.realKernel.shutdown().catch((_exc) => { |
There was a problem hiding this comment.
I'd log the errors here, else it will never get logged anywhere. #WontFix
There was a problem hiding this comment.
Don't care about shutdown errors. They're irrelevant.
In reply to: 416047279 [](ancestors = 416047279)
| sendMessage(message: KernelMessage.IMessage): void; | ||
| subscribe(handlerFunc: (message: KernelMessage.IMessage) => void): void; | ||
| // tslint:disable-next-line: no-any | ||
| subscribe(handlerFunc: (message: KernelMessage.IMessage) => void, errorHandler?: (exc: any) => void): void; |
There was a problem hiding this comment.
Please could you add comments.
Is this a subscription for outgoing or incoming messages? #WontFix
There was a problem hiding this comment.
Not sure how error handler works here?
Is this when one of the other handlers for incoming messages bombs or when there's an error in sending messages. #WontFix
There was a problem hiding this comment.
Not going to do that. We're not using this anymore. A future submission will remove this type entirely.
In reply to: 416056786 [](ancestors = 416056786)
Codecov Report
@@ Coverage Diff @@
## master #11444 +/- ##
=======================================
Coverage 0.00% 0.00%
=======================================
Files 11 11
Lines 36 36
Branches 4 4
=======================================
Misses 36 36 Continue to review full report at Codecov.
|
…ing unit tests. Just eliminate them as their functionality is already covered by functional tests.
|
Kudos, SonarCloud Quality Gate passed!
|
For #10771
Rework how we create a kernel for the raw kernel support. Instead of implementing Kernel.IKernel interface ourselves, just derive from the default one but with using a special websocket.
This websocket (called RawSocket) talks directly to the ZMQ channels (which also eliminates our need to use the enchannel stuff).
However to prevent unnecessary serialization (as the default kernel serializes/deserializes messages from the websocket), the default kernel js file is changed to eliminate serialization.
Modified the notebook.functional test and ipywidget functional test to also test with the raw kernel.