Skip to content

Conversation

@Legend-Master
Copy link
Contributor

@Legend-Master Legend-Master commented Apr 27, 2025

This PR refactors transformCallback and the functions calls to it into a few js functions, and instead of binding them on window, we put them inside window.__TAURI_INTERNALS__.callbacks instead

Also introduced

  • window.__TAURI_INTERNALS__.runCallback to replace the old window['_{cb}'] which is quite hard to understand what it's doing
  • window.__TAURI_INTERNALS__.unregisterCallback to replace delete window['_{cb}']

Honestly, window['_{cb}'] is super hard to understand and we also need to use format_callback to send a warning message to test if the callback is still there in case of webview reloads

@github-project-automation github-project-automation bot moved this to 📬Proposal in Roadmap Apr 27, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Apr 27, 2025

Package Changes Through e9aaa14

There are 5 changes which include tauri with minor, @tauri-apps/api with minor, tauri-bundler with patch, tauri-cli with patch, @tauri-apps/cli 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.5.0 2.6.0
tauri-bundler 2.4.0 2.4.1
tauri 2.5.1 2.6.0
@tauri-apps/cli 2.5.0 2.5.1
tauri-cli 2.5.0 2.5.1

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


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

@Legend-Master Legend-Master marked this pull request as ready for review April 27, 2025 11:21
@Legend-Master Legend-Master requested a review from a team as a code owner April 27, 2025 11:21
@Legend-Master
Copy link
Contributor Author

Legend-Master commented Apr 27, 2025

Should we also expose unregisterCallback and runCallback?

@Legend-Master Legend-Master force-pushed the transform-callback-rework branch from c666295 to 2a3e02a Compare April 29, 2025 00:51
Copy link
Member

@lucasfernog lucasfernog left a comment

Choose a reason for hiding this comment

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

you have so many great ideas ❤️

@lucasfernog lucasfernog merged commit b5c549d into tauri-apps:dev May 5, 2025
25 checks passed
@github-project-automation github-project-automation bot moved this from 📬Proposal to 🔎 In audit in Roadmap May 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🔎 In audit

Development

Successfully merging this pull request may close these issues.

2 participants