Skip to content

enhancement: anywidget dynamic imports in static notebooks#8110

Merged
mscolnick merged 1 commit intomainfrom
ms/anywidget-import
Feb 4, 2026
Merged

enhancement: anywidget dynamic imports in static notebooks#8110
mscolnick merged 1 commit intomainfrom
ms/anywidget-import

Conversation

@mscolnick
Copy link
Contributor

Adds support for import() of virtual files in static notebooks by resolving /@file/ URLs to blob URLs.

Unlike fetch(), dynamic import() cannot be patched globally. This change enables anywidget JS modules embedded in exported HTML notebooks to load correctly.

Adds support for import() of virtual files in static notebooks by resolving /@file/ URLs to blob URLs.

Unlike fetch(), dynamic import() cannot be patched globally. This change enables anywidget JS modules embedded in exported HTML notebooks to load correctly.
@vercel
Copy link

vercel bot commented Feb 3, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
marimo-docs Ready Ready Preview, Comment Feb 3, 2026 10:03pm

Request Review

@mscolnick mscolnick added the enhancement New feature or request label Feb 3, 2026
@mscolnick mscolnick changed the title fix: fix anywidget dynamic imports in static notebooks enhancement: anywidget dynamic imports in static notebooks Feb 3, 2026
Comment on lines +20 to 28
const mimeType = /^data:(.+);base64$/.exec(prefix)?.[1];
// Decode the base64 string
const binaryString = atob(base64Data);
// Convert the binary string to an array buffer
const len = binaryString.length;
const bytes = new Uint8Array(len);
for (let i = 0; i < len; i++) {
bytes[i] = binaryString.charCodeAt(i);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could maybe use our base64 utilities here.

@mscolnick mscolnick merged commit 8a51f2b into main Feb 4, 2026
33 of 34 checks passed
@mscolnick mscolnick deleted the ms/anywidget-import branch February 4, 2026 16:07
@github-actions
Copy link

github-actions bot commented Feb 4, 2026

🚀 Development release published. You may be able to view the changes at https://marimo.app?v=0.19.8-dev24

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants