Skip to content

Conversation

lucasfernog
Copy link
Member

leverages the IPC to send raw data through the event system (similar approach to how channels send raw data through - associate data with an ID, and eval a script that fetches the actual data using the IPC to avoid serialization).

The JS API automatically uses the optimized interface, but Rust emitters should use Emitter::emit_raw and Emitter::emit_raw_to to emit raw payloads, and read Event::payload_raw instead of Event::payload.
Ideally we would change types a bit to support both JSON and raw payloads, but we're introducing new methods to avoid breaking changes.

@lucasfernog lucasfernog requested a review from a team as a code owner October 9, 2025 16:12
@github-project-automation github-project-automation bot moved this to 📬Proposal in Roadmap Oct 9, 2025
Copy link
Contributor

github-actions bot commented Oct 9, 2025

Package Changes Through 1259ca5

There are 9 changes which include @tauri-apps/api with minor, tauri-cli with minor, tauri-utils with minor, tauri-runtime-wry with minor, tauri-runtime with minor, tauri with minor, tauri-bundler with minor, @tauri-apps/cli with minor, tauri-macros with patch

Planned Package Versions

The following package releases are the planned based on the context of changes in this pull request.

package current next
@tauri-apps/api 2.8.0 2.9.0
tauri-utils 2.7.0 2.8.0
tauri-bundler 2.6.1 2.7.0
tauri-runtime 2.8.0 2.9.0
tauri-runtime-wry 2.8.1 2.9.0
tauri-codegen 2.4.0 2.4.1
tauri-macros 2.4.0 2.4.1
tauri-plugin 2.4.0 2.4.1
tauri-build 2.4.1 2.4.2
tauri 2.8.5 2.9.0
@tauri-apps/cli 2.8.4 2.9.0
tauri-cli 2.8.4 2.9.0

Add another change file through the GitHub UI by following this link.


Read about change files or the docs at github.com/jbolda/covector

@lucasfernog
Copy link
Member Author

we might need to introduce new JS functions too.. this actually breaks the data received on the backend side if you are sending array buffers using the current event system (which serializes it)

Copy link
Contributor

@Legend-Master Legend-Master left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I kinda feel like it's a time to unify some channel and event staffs together 😂

*
* @since 2.10.0
*/
async function emitTo2<T>(
Copy link
Contributor

@Legend-Master Legend-Master Oct 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this new function necessary? We're sending the same command to our rust side anyways no (as long as we handle both cases in rust side which I assume it's already the case when are calling it like this, it should be backward compatible)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I get it, isn't the new emit2 code the same as emit in the previous revisions in the PR?

EmitPayload::Str(payload) => EmitArgs::new_str(event, payload)?,
};
EmitPayload::Str(payload) => EmitArgs::new_str(event, payload),
EmitPayload::Binary(payload) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be done with the same check (size check instead of binary type check) we did for the channel implementation or it will actually slow down smaller payloads

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 📬Proposal

Development

Successfully merging this pull request may close these issues.

2 participants