Replies: 2 comments
-
To clarify, ipyreact uses some of anywidget's internals and is not itself an anywidget (i.e., it is not the AFM standard which is required by marimo). marimo's adoption of anywidget is first party, meaning that it does not share any of the underlying jupyter infrastructure that traditional jupyter widgets need. This design decision makes anywidgets more portable than traditional jupyter widgets. Therefore, I would likely not label this issue as a bug with marimo as it is not expected that ipyreact would work. I’m open to improving shared frontend code reuse between widgets, but it’s not a priority. anywidget’s core value is portability, and added complexity risks making widgets harder to share and reuse, as seen with traditional systems. Such decisions also burden new host platforms like marimo or Panel (who have adopted AFM). For now, I’m fine with some redundant JS, given that widgets often handle megabytes of data or "data apps" run Pyodide, as it ensures better platform support and simplicity. This may change, but I'd like to be explicit about the project’s current core values in relation to the ecosystem and community we are building. |
Beta Was this translation helpful? Give feedback.
-
Thanks for clarifying @manzt. I will move this to a discussion since it sounds like marimo would need to support more underlying Jupyter infra that diverges from the anywidget spec (which currently isn't planned) |
Beta Was this translation helpful? Give feedback.
-
Describe the bug
ipyreact is built on top of anywidget. It is setup so that all ipyreact widgets can share the same react-js context through their concept of a module. when trying my simple starter widget, whether defined through an import map (similar to what anywidget does) or using a module, I get JS errors around react-js.
The JS error looks like this
The relevant snippet of javascript
Environment
{
"marimo": "0.9.20",
"OS": "Darwin",
"OS Version": "22.6.0",
"Processor": "arm",
"Python Version": "3.12.7",
"Binaries": {
"Browser": "131.0.6778.71",
"Node": "v18.20.4"
},
"Dependencies": {
"click": "8.1.7",
"docutils": "0.21.2",
"itsdangerous": "2.2.0",
"jedi": "0.19.2",
"markdown": "3.7",
"narwhals": "1.14.1",
"packaging": "24.1",
"psutil": "5.9.0",
"pygments": "2.18.0",
"pymdown-extensions": "10.12",
"pyyaml": "6.0.2",
"ruff": "0.7.4",
"starlette": "0.41.3",
"tomlkit": "0.13.2",
"typing-extensions": "4.12.2",
"uvicorn": "0.32.0",
"websockets": "12.0"
},
"Optional Dependencies": {
"anywidget": "0.9.13",
"pandas": "2.2.2"
}
}
Code to reproduce
I'm currently in the process of publishing the ipyreact_starter package. It really isn't meant to be on package repositories. I mostly use it for local testing of ipyreact.
In marimo run:
This uses the version of
ipyreact-tsxlib
defined via a moduleBeta Was this translation helpful? Give feedback.
All reactions