Skip to content

Commit 2764f1a

Browse files
Version Packages (#327)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent c3e1260 commit 2764f1a

File tree

7 files changed

+48
-49
lines changed

7 files changed

+48
-49
lines changed

.changeset/hip-pianos-impress.md

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

.changeset/metal-yaks-tickle.md

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

.changeset/serious-panthers-battle.md

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

packages/anywidget/CHANGELOG.md

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

3+
## 0.7.0
4+
5+
### Minor Changes
6+
7+
- feat(experimental)!: Require `include` in `_get_anywidget_state` signature ([#317](https://github.com/manzt/anywidget/pull/317))
8+
9+
Allows implementors to avoid re-serializing fields which aren't needed to send
10+
to the front end. This is a **BREAKING** change because it requires implementors
11+
of `_get_anywidget_state` to account for `include` in the function signature.
12+
13+
```python
14+
from dataclasses import dataclass, asdict
15+
from io import BytesIO
16+
17+
import polars as pl
18+
import psygnal
19+
20+
@psygnal.evented
21+
@dataclass
22+
class Foo:
23+
value: int
24+
df: pl.DataFrame
25+
26+
def _get_anywidget_state(self, include: set[str] | None):
27+
data = asdict(self)
28+
if include and "df" in include:
29+
with BytesIO() as f:
30+
self.df.write_ipc(f)
31+
data["df"] = f.getvalue()
32+
else:
33+
del data["df"] # don't serialize df to bytes
34+
return data
35+
```
36+
337
## 0.6.5
438

539
### 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.6.5",
4+
"version": "0.7.0",
55
"author": "Trevor Manz",
66
"license": "MIT",
77
"main": "src/index.js",

packages/deno/CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# @anywidget/deno
22

3+
## 0.0.3
4+
5+
### Patch Changes
6+
7+
- feat: Try to discover installed anywidget version ([#326](https://github.com/manzt/anywidget/pull/326))
8+
9+
- feat: Add Install/Uninstall scripts for widget front end ([#329](https://github.com/manzt/anywidget/pull/329))
10+
11+
```sh
12+
deno run -A https://deno.land/x/anywidget/install.ts
13+
```
14+
315
## 0.0.2
416

517
### Patch Changes

packages/deno/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"name": "@anywidget/deno",
3-
"version": "0.0.2",
3+
"version": "0.0.3",
44
"description": "A stub-package for making releases of the Deno anywidget mod.ts with changesets"
55
}

0 commit comments

Comments
 (0)