Commit ff549c8
authored
feat: Bundle notebook renderers (#272)
* feat: integrate notebook renderers and fix ipywidget configuration
Replace external dependency on ms-toolsai.jupyter-renderers with
integrated renderer functionality bundled directly in the extension.
Build system changes:
- Switch renderers build from webpack to esbuild
- Add esbuild entries for notebook-renderer, ipywidgets-renderer,
ipywidgets7, ipywidgets8, and ipywidgetsKernel
- Copy renderer source from vscode-notebook-renderers into src/renderers/
Package.json renderer configuration:
- Add deepnote-ipywidget-renderer with MIME type support
- Add jupyter-notebook preloads for ipywidget scripts
- Update renderer entrypoints to use new bundled paths
IPyWidget fixes:
- Change DefaultCommTarget from 'deepnote.widget' to 'jupyter.widget'
- Change WIDGET_MIMETYPE from deepnote to standard jupyter MIME types
- Update renderer messaging channel IDs to 'deepnote-ipywidget-renderer'
- Fix hardcoded comm target in ipyWidgetMessageDispatcher
Kernel interface updates:
- Add registerCommTarget to IKernelConnection interface
- Add kernelSession property to rawKernelConnection
- Update rawSessionConnection to implement new interface methods
Other improvements:
- Add logging for widget kernel communication
- Update renderer version checker for integrated renderers
- Fix plotView renderer communication imports
- Simplify fixJupyterLabRenderers() in postInstall.js
* fix version
* fix: address CodeRabbit review feedback
- Fix async function returning JSX instead of component in transforms.tsx
- Remove debug "Hello World" message in builtinRendererHooks.ts
- Fix subshellId to delegate to realKernel instead of hardcoded null
- Add error handling for vegaEmbed and fix memory leak in disposeOutputItem
- Update preload.ts comment (remove outdated webpack reference)
- Fix declaration order in type definition files
- Fix typo "them" -> "theme" in vegaRenderer.ts
- Simplify boolean return in isMimeTypeSupported
- Reorder clipboard support check before creating ClipboardItem
* fix: address remaining CodeRabbit review feedback
Accessibility improvements in render.tsx:
- Add alt attribute to img element
- Add type="button" to all button elements
- Remove redundant role="button" attributes
- Add title elements to SVGs for screen readers
- Add aria-hidden="true" to decorative SVGs
- Add onFocus/onBlur keyboard handlers alongside mouse events
Consolidate duplicated type definitions:
- Create src/renderers/shared/types.ts with shared message types
- Update client/constants.ts to re-export from shared types
- Update extension/constants.ts to re-export from shared types
Update dependencies:
- Update path-browserify from ^0.0.1 to ^1.0.1
* fix(security): resolve npm audit vulnerabilities
- Fix vega-functions XSS vulnerability (high severity)
- Fix vega-selections XSS vulnerability (high severity)
- Fix prismjs DOM Clobbering vulnerability (moderate severity)
- Downgrade @nteract/transform-vega from 7.0.10 to 7.0.6
All 7 vulnerabilities resolved, npm audit now passes.
* fix: remove elkjs dependency due to EPL-2.0 license incompatibility
Add npm override to replace @mermaid-js/layout-elk with empty-pkg (MIT).
This removes elkjs from the dependency tree while preserving Mermaid
diagram functionality (uses default dagre layout instead of ELK).
Dependency chain removed:
@mermaid-js/layout-elk → elkjs (EPL-2.0)
* fix: add stub for @nteract/presentational-components to fix esbuild error
The @nteract/transform-vega package imports @nteract/presentational-components
but doesn't declare it as a dependency. Instead of adding the full package
(which has 4 moderate vulnerabilities via prismjs), create a minimal stub
that only exports the Error component actually used.
This resolves the CI build failure:
"Could not resolve @nteract/presentational-components"
* tilde
* cr feedback
* Remove RendererVersionChecker1 parent 6a24088 commit ff549c8
41 files changed
Lines changed: 8187 additions & 542 deletions
File tree
- build
- ci
- esbuild
- src
- kernels
- execution
- raw/session
- notebooks/controllers/ipywidgets
- message
- platform/common
- renderers
- client
- stubs
- types/@nteract
- extension
- test
- datascience/widgets
- webviews
- extension-side
- ipywidgets
- plotView
- webview-side/ipywidgets/kernel
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
94 | | - | |
| 94 | + | |
| 95 | + | |
95 | 96 | | |
96 | 97 | | |
97 | 98 | | |
| |||
101 | 102 | | |
102 | 103 | | |
103 | 104 | | |
104 | | - | |
105 | | - | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
106 | 108 | | |
107 | | - | |
108 | 109 | | |
109 | 110 | | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | 111 | | |
114 | 112 | | |
115 | 113 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
72 | 77 | | |
73 | 78 | | |
74 | 79 | | |
| |||
243 | 248 | | |
244 | 249 | | |
245 | 250 | | |
246 | | - | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
247 | 261 | | |
248 | 262 | | |
249 | 263 | | |
| |||
410 | 424 | | |
411 | 425 | | |
412 | 426 | | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
413 | 448 | | |
414 | 449 | | |
415 | 450 | | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
416 | 454 | | |
417 | 455 | | |
418 | 456 | | |
| |||
528 | 566 | | |
529 | 567 | | |
530 | 568 | | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
531 | 617 | | |
532 | 618 | | |
533 | 619 | | |
| |||
0 commit comments