We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Previously #[serde(rename = "...")] can be used to rename types, but it had a problem when the type is referenced in other types madonoharu#43
#[serde(rename = "...")]
However, without renaming, there could be name collisions
use serde::{Deserialize, Serialize}; use tsify::Tsify; use wasm_bindgen::prelude::*; mod foo { #[derive(Tsify, Serialize, Deserialize)] #[tsify(into_wasm_abi, from_wasm_abi)] pub struct Bar { ... } } mod biz { #[derive(Tsify, Serialize, Deserialize)] #[tsify(into_wasm_abi, from_wasm_abi)] pub struct Bar { ... } }
becomes
export interface Bar { ... } export interface Bar { ... }
To fix this, 3e81856 could be reverted to enable rename again, and madonoharu#43 can be addressed with #[tsify(type = "RenamedType")]
#[tsify(type = "RenamedType")]
The text was updated successfully, but these errors were encountered:
Hmmm...this does seem tricky. It's not nice to require users to rename there types all over the place.
Ideally, types wouldn't be global, but could be in typescript modules, but I don't think there's a way to deduce that from inside a Rust macro.
If you have name collisions, you should be able to use the namespace attribute to prevent the collision.
namespace
Sorry, something went wrong.
Apparently namespace does not work the way I thought it did...this will need different workaround.
No branches or pull requests
Previously
#[serde(rename = "...")]
can be used to rename types, but it had a problem when the type is referenced in other types madonoharu#43However, without renaming, there could be name collisions
becomes
To fix this, 3e81856 could be reverted to enable rename again, and madonoharu#43 can be addressed with
#[tsify(type = "RenamedType")]
The text was updated successfully, but these errors were encountered: