-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(api): add SERIALIZE_TO_IPC_FN
const and implement it for dpi types, add more constructors
#11191
Conversation
Package Changes Through bc08c82There are 9 changes which include tauri with minor, @tauri-apps/api with minor, tauri-bundler with minor, tauri-cli with minor, @tauri-apps/cli with minor, tauri-utils with minor, tauri-runtime-wry with minor, tauri-macros with patch, tauri-runtime with minor Planned Package VersionsThe following package releases are the planned based on the context of changes in this pull request.
Add another change file through the GitHub UI by following this link. Read about change files or the docs at github.com/jbolda/covector |
toIpc
method on dpi types, add more constructorstoIpc
and toJSON
method on dpi types, add more constructors
this one can wait to be merged after the v2 stable release right? |
Co-authored-by: Tony <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think we should use toTauriIpc
instead of just toIPC
?
yes, i am not to keen on |
Made a |
Sounds good to me, but shouldn't the symbol be a |
Normally it should be, but we access this value in multiple places and we can't keep re-defining it because it will not be the same value (that's how Symbol works, it is always unique). We can define it on the global const ToIPCSymbol = window.ToIPCSymbol because it will break usage with next.js and SSR framworks and I don't want to deal with their issues again. |
Never mind, we can't use import here |
What about |
That works I guess but is it really that different? the main problem here IMO is that we can't share the value by using imports |
Right, that doesn't really make a difference, let's just go with a string then, in that case maybe changing the name to |
renamed! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't test it, but the code looks good to me
* | ||
* @since 2.0.0 | ||
*/ | ||
[SERIALIZE_TO_IPC_FN]() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the whole toIPC approach (makes the __CHANNEL__
thingy available to anyone) but this is actually a breaking change - existing commands relying on PhysicalPosition / PhysicalSize / LogicalPosition / LogicalSize cannot deserialize this new format, so we should revert these - if you explictly want a generic Position or Size type we need to create a wrapper type just like Rust has one
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that makes sense, I have added Position
and Size
classes and reverted breaking changes.
toIpc
and toJSON
method on dpi types, add more constructorsSERIALIZE_TO_IPC_FN
const and implement it for dpi types, add more constructors
No description provided.