-
Notifications
You must be signed in to change notification settings - Fork 295
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
Experiment: move ipywidgets into notebooks #10903
Conversation
Codecov Report
@@ Coverage Diff @@
## main #10903 +/- ##
======================================
- Coverage 63% 63% -1%
======================================
Files 487 482 -5
Lines 33857 33822 -35
Branches 5514 5514
======================================
- Hits 21503 21455 -48
- Misses 10318 10331 +13
Partials 2036 2036
|
Regarding whether a kernel message handling component should be part of the |
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.
be aware of ipywidgets. It looks reasonable to me that we have it in notebooks then both Debugging and IPyWidgets are very similar: handling messages from kernels and convert the messages to data VS Code requires.
I think I disagree with this point. IPyWidgets has nothing to do with VS code notebooks. It should be necessary for all kernels and not just ones talking to VS code.
If there's a class inside the ipywidgets stuff that does know about notebooks, that part should move to the notebooks folder, but otherwise all of these classes are notebook independent.
@rchiodo it does need to know about VS Code Notebooks. The reason we need a For short, IPyWidgets output rendering has nothing to do with VS code notebooks but supporting it in VS Code does (before we support ipywidget talks to the kernel directly) |
I feel like this part could be abstracted. 3rd party kernels might also want to support ipywidgets. They'd have to provide their own message passing but would otherwise load the ipywidget render code into their webview. |
If 3rd party kernels want to support
We only create kernels for them, and they use the kernel with their components. Same as Debugging, we are not making debugging generic and offering debugging support for 3rd party kernels. Note that this PR doesn't move the |
Had offline discussions with @rchiodo
This is referring to ipywidget message handling part, not the ipywidget source loading and notebook editor/controller coordination. 3rd party extensions like Data Wrangler have requests to share this piece of functionality, but to support this, the messaging handling component would need to support 3rd party kernels. Currently the messaging handling only supports first party kernels which are always attached to a As suggested by @rchiodo , we have separated |
@DonJayamanne when we were exploring the separation of
NotebookController
andKernelExecution
, we thought theipywidgets
is also tighted/coupled withNotebookController
or Kernel internals so we can't really move it around. I experimented with moving it tonotebooks
and surprisingly, it is pretty clean:ipywidgets extension side code is only registered/used by
notebookIPyWidgetCoordinator
, which is responsible for transferring messages between kernels andvscode.NotebookEditor
s. IW doesn't depend on this, no other modules need tobe aware of ipywidgets. It looks reasonable to me that we have it in
notebooks
then bothDebugging
andIPyWidgets
are very similar: handling messages from kernels and convert the messages to data VS Code requires.Also after moving it out and looking at the code left in Kernels again, I found it closer to what we imagine what the Kernel component offers
kernels/execution
)kernels/jupyter
,kernels/raw
)kernels/installer
)Rest are common/error/telemetry helpers. The only two that are under discussion are
port
. From my understanding, it tells VS Code whether the port opened for jupyter server can be forwarded. It is integration code with VS Code (mainly for remote) so I wouldn't be surprised if it's moved out and intostandalone
variable
. This seems necessary as execution seems to depend on it. Totally fine if we have to keep it inkernels
.@DonJayamanne let me know what you think and we can sync next week, cheers!
package-lock.json
has been regenerated by runningnpm install
(if dependencies have changed).