Releases: manzt/anywidget
@anywidget/vue@0.1.0
Minor Changes
-
Initial release (
1c5f07a
)Thanks to @aryan02420, we now support Vue with an official framework bridge—similar to our React and Svelte bindings.
Unlike
@anywidget/react
, theuseModelState
hook returns a VueShallowRef
that you can update directly (e.g.value++
), aligning with Vue’s reactivity model.// src/index.js import { createRender } from "@anywidget/vue"; import CounterWidget from "./CounterWidget.vue"; const render = createRender(CounterWidget); export default { render };
<!-- src/CounterWidget.vue --> <script setup> import { useModelState } from "@anywidget/vue"; const value = useModelState("value"); </script> <template> <button :onClick="() => value++">count is {{ value }}</button> </template>
See the README for build tool configuration.
create-anywidget@0.8.2
Patch Changes
- Pin
@anywidget/react
~v0.2 (#837)
@anywidget/react@0.2.0
Minor Changes
-
Use
React.useSyncExternalStore
foruseModelState
hook implementation (34f01a3
)The
React.useSyncExternalStore
hook was introduced in React 18 and is designed for external sources of truth, like the anywidgetmodel
. It ensures a shared source within the component tree, and consistent behavior during concurrent rendering, avoiding subtle bugs present inuseEffect
-based patterns.This is marked as a breaking change to signal the internal shift in behavior, though in practice it should be considered an improvement. Most users should not notice any difference, aside from more consistent updates.
-
Mirror
React.useState
API inuseModelState
hook (34f01a3
)Aligns the
useModelState
hook more closely with theReact.useState
API by allowing a callback function in the state setter.
Patch Changes
- Add generic type parameter to
useModel
hook (34f01a3
)
anywidget@0.9.18
Patch Changes
- experimental Fix descriptor API to send initial state on comm creation (#832)
anywidget@0.9.17
Patch Changes
-
Refactor: Manage front-end HMR runtimes with web
AbortController
(#826) -
Improve robustness of HMR file watching (#831)
Handles cases where atomic saves (e.g. by VS Code) temporarily delete and replace the file. The watcher now ensures the file does not exist on
Change.delete
events, preventing unexpected drops in hot reload behavior.
anywidget@0.9.16
Patch Changes
- Fix: Use temporary polyfill for
Promise.withResolvers
for Safari compat (#824)
create-anywidget@0.8.1
Patch Changes
- Import
RenderProps
instead ofRenderContext
when scaffolding vanilla TS project (#821)
create-anywidget@0.8.0
Minor Changes
- Upgrade TypeScript to v5.8 (#817)
anywidget@0.9.15
Patch Changes
- Move
@anywidget/types
from devDependencies to dependencies (#812)
anywidget@0.9.14
Patch Changes
- Comm messages sent quickly after the creation of a widget could be lost because custom widgets' models were loaded asynchronously (#804)