Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .changeset/pre.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"@fltsci/taurpc": "1.8.1"
},
"changesets": [
"allow-channel-reuse",
"bigint-rewrite-f64-not-opaque",
"bump-specta-rc-25",
"calm-wombats-stand",
Expand Down
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# taurpc

## 2.0.0-canary.8

### Patch Changes

- [#31](https://github.com/fltsci/TauRPC/pull/31) [`e65f48e`](https://github.com/fltsci/TauRPC/commit/e65f48eff5cd8357f8c8232b63cee3827a0e0669) Thanks [@johncarmack1984](https://github.com/johncarmack1984)! - Allow `Channel`s to be reused across multiple TauRPC command invocations.

Previously, when a command argument contained a `Channel<T>` and the runtime ran a transform pass (e.g. semantic-types decoding), the generated TS proxy mutated the original channel's `onmessage` handler in place. Passing the same channel to a second command (or any code path that re-invoked the proxy) would re-wrap the already-wrapped handler, double-decoding payloads.

The proxy now wraps via `new Channel((response) => v.onmessage(transform(response)))` instead of mutating, so the original channel is untouched and safe to reuse.

Generated bindings now import `Channel` from `@tauri-apps/api/core` whenever the affected transform path is reachable.

## 2.0.0-canary.7

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fltsci/taurpc",
"version": "2.0.0-canary.7",
"version": "2.0.0-canary.8",
"description": "Type-safe IPC layer for Tauri commands and events; forked from MatsDK/TauRPC",
"main": "dist/index.cjs",
"repository": {
Expand Down