Skip to content

A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.

fix: better jupyter widget warning for unsupported (#5785)

Myles Scolnickfd787b431aee
diff --git a/frontend/src/components/editor/Output.tsx b/frontend/src/components/editor/Output.tsx
index 8f3ec4fb94..ba5c283097 100644
--- a/frontend/src/components/editor/Output.tsx
+++ b/frontend/src/components/editor/Output.tsx
@@ -28,6 +28,7 @@ import {
import { useExpandedOutput } from "@/core/cells/outputs";
import { renderHTML } from "@/plugins/core/RenderHTML";
import { LazyAnyLanguageCodeMirror } from "@/plugins/impl/code/LazyAnyLanguageCodeMirror";
+import { Banner } from "@/plugins/impl/common/error-banner";
import type { TopLevelFacetedUnitSpec } from "@/plugins/impl/data-explorer/queries/types";
import { useTheme } from "@/theme/useTheme";
import { Events } from "@/utils/events";
@@ -185,6 +186,22 @@ export const OutputRenderer: React.FC<{
}
/>
);
+ case "application/vnd.jupyter.widget-view+json":
+ return (
+ <Banner kind="warn">
+ <b>Jupyter widgets are not supported in marimo.</b> <br />
+ Please migrate this widget to{" "}
+ <a
+ href="https://github.com/manzt/anywidget"
+ target="_blank"
+ rel="noopener noreferrer"
+ className="underline hover:text-[var(--amber-12)]"
+ >
+ anywidget
+ </a>
+ .
+ </Banner>
+ );
default:
logNever(mimetype);
return (
diff --git a/marimo/_messaging/mimetypes.py b/marimo/_messaging/mimetypes.py
index 199a4f2b0e..155541db12 100644
--- a/marimo/_messaging/mimetypes.py
+++ b/marimo/_messaging/mimetypes.py
@@ -13,6 +13,7 @@ KnownMimeType = Literal[
"application/vnd.marimo+mimebundle",
"application/vnd.vega.v5+json",
"application/vnd.vegalite.v5+json",
+ "application/vnd.jupyter.widget-view+json",
"image/png",
"image/svg+xml",
"image/tiff",
diff --git a/marimo/_schemas/generated/session.yaml b/marimo/_schemas/generated/session.yaml
index fdfdf5bb9d..c9fc03b6b8 100644
--- a/marimo/_schemas/generated/session.yaml
+++ b/marimo/_schemas/generated/session.yaml
@@ -94,6 +94,7 @@ components:
- application/vnd.marimo+mimebundle
- application/vnd.vega.v5+json
- application/vnd.vegalite.v5+json
+ - application/vnd.jupyter.widget-view+json
- image/png
- image/svg+xml
- image/tiff
diff --git a/packages/openapi/api.yaml b/packages/openapi/api.yaml
index ecc0c0da17..fdc2dee21d 100644
--- a/packages/openapi/api.yaml
+++ b/packages/openapi/api.yaml
@@ -1920,6 +1920,7 @@ components:
- application/vnd.marimo+mimebundle
- application/vnd.vega.v5+json
- application/vnd.vegalite.v5+json
+ - application/vnd.jupyter.widget-view+json
- image/png
- image/svg+xml
- image/tiff
@@ -2740,7 +2741,7 @@ components:
type: object
info:
title: marimo API
- version: 0.14.11
+ version: 0.14.13
openapi: 3.1.0
paths:
/@file/{filename_and_length}:
diff --git a/packages/openapi/src/api.ts b/packages/openapi/src/api.ts
index 44eb60f9e7..0ee3bd9af7 100644
--- a/packages/openapi/src/api.ts
+++ b/packages/openapi/src/api.ts
@@ -3363,6 +3363,7 @@ export interface components {
| "application/vnd.marimo+mimebundle"
| "application/vnd.vega.v5+json"
| "application/vnd.vegalite.v5+json"
+ | "application/vnd.jupyter.widget-view+json"
| "image/png"
| "image/svg+xml"
| "image/tiff"
diff --git a/packages/openapi/src/session.ts b/packages/openapi/src/session.ts
index 88f1c0498a..eff7870e35 100644
--- a/packages/openapi/src/session.ts
+++ b/packages/openapi/src/session.ts
@@ -51,6 +51,7 @@ export interface components {
| "application/vnd.marimo+mimebundle"
| "application/vnd.vega.v5+json"
| "application/vnd.vegalite.v5+json"
+ | "application/vnd.jupyter.widget-view+json"
| "image/png"
| "image/svg+xml"
| "image/tiff"