@marimo-team/frontend 0.22.1-dev20 → 0.22.1-dev22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.html CHANGED
@@ -66,7 +66,7 @@
66
66
  <marimo-server-token data-token="{{ server_token }}" hidden></marimo-server-token>
67
67
  <!-- /TODO -->
68
68
  <title>{{ title }}</title>
69
- <script type="module" crossorigin src="./assets/index-DjrkoUpB.js"></script>
69
+ <script type="module" crossorigin src="./assets/index-eeNpwqOH.js"></script>
70
70
  <link rel="modulepreload" crossorigin href="./assets/preload-helper-BzqwXe9B.js">
71
71
  <link rel="modulepreload" crossorigin href="./assets/chunk-LvLJmgfZ.js">
72
72
  <link rel="modulepreload" crossorigin href="./assets/react-Bj1aDYRI.js">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marimo-team/frontend",
3
- "version": "0.22.1-dev20",
3
+ "version": "0.22.1-dev22",
4
4
  "main": "dist/main.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",
@@ -4,7 +4,6 @@
4
4
  import type { AnyWidget } from "@anywidget/types";
5
5
  import { useEffect, useRef } from "react";
6
6
  import { z } from "zod";
7
- import { RANDOM_ID_ATTR } from "@/core/dom/ui-element-constants";
8
7
  import { useAsyncData } from "@/hooks/useAsyncData";
9
8
  import type { HTMLElementNotDerivedFromRef } from "@/hooks/useEventListener";
10
9
  import { createPlugin } from "@/plugins/core/builder";
@@ -145,18 +144,10 @@ const AnyWidgetSlot = (props: IPluginProps<ModelIdRef, Data>) => {
145
144
  return <ErrorBanner error={error} />;
146
145
  }
147
146
 
148
- // Find the closest parent element with an attribute of `random-id`
149
- const randomId = props.host
150
- .closest(`[${RANDOM_ID_ATTR}]`)
151
- ?.getAttribute(RANDOM_ID_ATTR);
152
- const key = randomId ?? jsUrl;
153
-
154
147
  return (
155
148
  <LoadedSlot
156
- // Use the a key to force a re-render when the randomId (or jsUrl) changes
157
- // Plugins may be stateful and we cannot make assumptions that we won't be
158
- // so it is safer to just re-render.
159
- key={key}
149
+ // Force remount when the widget module or model changes (cell re-run).
150
+ key={`${jsHash}:${modelId}`}
160
151
  widget={jsModule.default}
161
152
  modelId={modelId}
162
153
  host={host}