Skip to content

Commit 578d956

Browse files
Version Packages (#596)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent c324005 commit 578d956

File tree

6 files changed

+50
-48
lines changed

6 files changed

+50
-48
lines changed

.changeset/serious-months-study.md

Lines changed: 0 additions & 41 deletions
This file was deleted.

.changeset/three-poems-agree.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

packages/anywidget/CHANGELOG.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,47 @@
11
# anywidget
22

3+
## 0.9.12
4+
5+
### Patch Changes
6+
7+
- Add IPython Cell Magic for HMR ([#594](https://github.com/manzt/anywidget/pull/594))
8+
9+
New `%%vfile` cell magic for prototyping widgets in notebooks. Enables syntax highlighting and anywidget's Hot Module Replacement (HMR) directly within the notebook.
10+
11+
Previously, front-end code had to be inline strings or file paths, causing loss of widget state when editing inline-strings in notebooks. The new `%%vfile` cell magic allows editing front-end code within the notebook with live reloading on cell re-execution.
12+
13+
Use `%%vfile <filename>` to create a virtual file for either JavaScript or CSS, and use `vfile:<filename>` in `_esm` or `_css` attributes of an `AnyWidget` subclass to reference the virtual file. Anywidget applies HMR updates automatically on cell re-execution.
14+
15+
`In[1]`:
16+
17+
```python
18+
%load_ext anywidget
19+
```
20+
21+
`In[2]`:
22+
23+
```js
24+
%%vfile index.js
25+
export default {
26+
render({ model, el }) {
27+
el.innerHTML = `<h1>Hello, ${model.get("name")}!</h1>`;
28+
}
29+
}
30+
```
31+
32+
`In[3]`:
33+
34+
```py
35+
import anywidget
36+
import traitlets
37+
38+
class Widget(anywidget.AnyWidget):
39+
_esm = "vfile:index.js"
40+
name = traitlets.Unicode("world").tag(sync=True)
41+
42+
Widget()
43+
```
44+
345
## 0.9.11
446

547
### Patch Changes

packages/anywidget/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "anywidget",
33
"type": "module",
4-
"version": "0.9.11",
4+
"version": "0.9.12",
55
"author": "Trevor Manz",
66
"license": "MIT",
77
"main": "dist/index.js",

packages/create-anywidget/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# create-anywidget
22

3+
## 0.6.3
4+
5+
### Patch Changes
6+
7+
- Bump esbuild to 0.21.4 ([#599](https://github.com/manzt/anywidget/pull/599))
8+
39
## 0.6.2
410

511
### Patch Changes

packages/create-anywidget/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "create-anywidget",
3-
"version": "0.6.2",
3+
"version": "0.6.3",
44
"type": "module",
55
"author": "Trevor Manz",
66
"bin": {

0 commit comments

Comments
 (0)