Skip to content

fix(anywidget): preserve virtual ESM URLs - #10687

Merged
Light2Dark merged 2 commits into
mainfrom
codex/fix-anywidget-virtual-esm-url
Sep 2, 2026
Merged

Light2Dark merged 2 commits into
mainfrom
codex/fix-anywidget-virtual-esm-url

Conversation

@Light2Dark

@Light2Dark Light2Dark commented Aug 28, 2026 •

Copy link
Copy Markdown
Member

📝 Summary

Anywidget _esm values may already be importable URLs, including marimo virtual files produced by mo_data.js. EsmSpec.from_esm() previously sent those virtual-file URLs back through JavaScript virtualization, creating a second file whose contents were only the first URL. Importing that file failed with Unexpected token '.'.

Preserve supported virtual-file, HTTP(S), and JavaScript data URLs when minting an EsmSpec. Inline JavaScript still becomes a virtual file, including source that begins with a URL-like JavaScript label. URL recognition mirrors the frontend's trusted virtual-file shape so malformed paths are not passed through.

📋 Pre-Review Checklist

  • For large changes, or changes that affect the public API: this change was discussed or approved through an issue, on Discord, or the community discussions (not applicable: focused bug fix with no public API change).
  • Any AI generated code has been reviewed line-by-line by the human PR author, who stands by it.
  • Video or media evidence is provided for any visual changes (not applicable: backend URL handling only).

✅ Merge Checklist

  • I have read the contributor guidelines.
  • Documentation has been updated where applicable, including docstrings for API changes (not applicable: no public API change).
  • Tests have been added for the changes made.

Written by GPT-5.6 on Codex

@vercel

vercel Bot commented Aug 28, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
marimo-docs Ready Ready Preview Aug 28, 2026 12:33pm

Request Review

@github-actions

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All reported issues were addressed across 2 files

You’re at about 99% of the monthly reviewed-line limit. You may want to disable incremental reviews to conserve quota. Reviews will continue until that limit is exceeded. If you need help avoiding interruptions, please contact contact@cubic.dev.

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread marimo/_messaging/notification.py Outdated

@manzt manzt left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks great!

@Light2Dark
Light2Dark merged commit 0ffeba2 into main Sep 2, 2026
42 checks passed
@Light2Dark
Light2Dark deleted the codex/fix-anywidget-virtual-esm-url branch September 2, 2026 15:43
williambdean pushed a commit to williambdean/marimo that referenced this pull request Sep 6, 2026
## 📝 Summary

Anywidget `_esm` values may already be importable URLs, including marimo
virtual files produced by `mo_data.js`. `EsmSpec.from_esm()` previously
sent those virtual-file URLs back through JavaScript virtualization,
creating a second file whose contents were only the first URL. Importing
that file failed with `Unexpected token '.'`.

Preserve supported virtual-file, HTTP(S), and JavaScript data URLs when
minting an `EsmSpec`. Inline JavaScript still becomes a virtual file,
including source that begins with a URL-like JavaScript label. URL
recognition mirrors the frontend's trusted virtual-file shape so
malformed paths are not passed through.

## 📋 Pre-Review Checklist

- [ ] For large changes, or changes that affect the public API: this
change was discussed or approved through an issue, on
[Discord](https://marimo.io/discord?ref=pr), or the community
[discussions](https://github.com/marimo-team/marimo/discussions) (not
applicable: focused bug fix with no public API change).
- [ ] Any AI generated code has been reviewed line-by-line by the human
PR author, who stands by it.
- [ ] Video or media evidence is provided for any visual changes (not
applicable: backend URL handling only).

## ✅ Merge Checklist

- [x] I have read the [contributor
guidelines](https://github.com/marimo-team/marimo/blob/main/CONTRIBUTING.md).
- [x] Documentation has been updated where applicable, including
docstrings for API changes (not applicable: no public API change).
- [x] Tests have been added for the changes made.

> Written by GPT-5.6 on Codex

This branch was successfully deployed

1 active deployment
Preview — 60146eac Deployed Aug 28, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants