Skip to content
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

Add attribute for custom path to wasm_bindgen #3360

Merged
merged 1 commit into from
Apr 11, 2023

Conversation

daxpedda
Copy link
Collaborator

This adds two new attributes: wasm_bindgen and wasm_bindgen_futures, which allow to specify the path to both crates if they were renamed or re-exported from a different crate.

This is analogous to Tokio, Serde or Pollster.

Comment on lines +46 to +47
wasm_bindgen: syn::parse_quote! { wasm_bindgen },
wasm_bindgen_futures: syn::parse_quote! { wasm_bindgen_futures },
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This should have been ::wasm_bindgen and ::wasm_bindgen_futures for added proc-macro hygiene. Unfortunately that would be a breaking change.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Mentioning it here for reference: we can make that change alongside #3372.

Comment on lines +159 to +161
wasm_bindgen: wasm_bindgen.unwrap_or_else(|| syn::parse_quote! { wasm_bindgen }),
wasm_bindgen_futures: wasm_bindgen_futures
.unwrap_or_else(|| syn::parse_quote! { wasm_bindgen_futures }),
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Same as above.

@daxpedda daxpedda force-pushed the custom-path branch 4 times, most recently from ce4ac9a to 76ca9f6 Compare March 19, 2023 13:21
@daxpedda
Copy link
Collaborator Author

The latest wasm-pack v0.11 release broke our CI somehow.

Copy link
Collaborator

@ranile ranile left a comment

Choose a reason for hiding this comment

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

Looks good to me 👍

Comment on lines +46 to +47
wasm_bindgen: syn::parse_quote! { wasm_bindgen },
wasm_bindgen_futures: syn::parse_quote! { wasm_bindgen_futures },
Copy link
Collaborator

Choose a reason for hiding this comment

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

Mentioning it here for reference: we can make that change alongside #3372.

@@ -0,0 +1,43 @@
extern crate wasm_bindgen as extern_test;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Ideally we should have a separate crate which renames wasm-bindgen in Cargo.toml but this should also suffice

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants