tauri-plugin-pytauri-api¶
Unreleased¶
BREAKING¶
-
#178 - feat(plugin-api)!: remove
rawPyInvoke
andChannel
.Migration
Before
v0.7
, IPC between Python and the frontend always usedbytes
/ArrayBuffer
for data transfer.pyInvoke
andChannel.addJsonListener
would force serialization and deserialization of input and output, whilerawPyInvoke
andChannel.onmessage
would directly send and receive rawArrayBuffer
data. This mechanism has been improved inv0.7
:-
Now,
pyInvoke
automatically chooses whether to serialize based on your input type:ArrayBuffer
/Uint8Array
will be sent directly to the backend.- Other types (
any
) will be converted toArrayBuffer
usingJSON.stringify
andTextEncoder
before being sent to the backend.
Only the backend can decide whether to deserialize or accept the raw bytes data.
-
Only the backend can decide whether to return deserialized JSON data or raw
ArrayBuffer
data:- If
Command
returns abytes
type or Channel.send sends abytes
type, the frontend will receive anArrayBuffer
. - If
Command
returns other types (BaseModel
/Any
) and Channel.send sends astr
type, the frontend will receive automatically deserialized JSON data.
- If
Therefore:
pyInvoke
replacesrawPyInvoke
import { Channel } from "@tauri-apps/api/core"
replacesimport { Channel } from "tauri-plugin-pytauri-api"
.
-
0.6.0¶
0.5.0¶
Added¶
-
#136 - feat(pytauri): accessing the request headers in
Commands
:Added
options?: InvokeOptions
parameter torawPyInvoke
andpyInvoke
.
0.4.0¶
0.3.0¶
0.2.0¶
Added¶
- #50 - feat: add
class Channel extends TauriChannel<ArrayBuffer>
for pytauri channels ipc.
Docs¶
- #50 - add tsdoc for all classes and functions.