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

Fix deprecation warning for wasm-bindgen >= 0.2.93 #906

Merged
merged 1 commit into from
Nov 7, 2024

Conversation

yescallop
Copy link
Contributor

This closes #905 by passing an object to init instead when the version of wasm-bindgen is >= 0.2.93.

Copy link
Collaborator

@ctron ctron left a comment

Choose a reason for hiding this comment

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

Many thanks for the PR. I think it's good in general. I'd prefer some thing to be different. Unless there are good reasons that I've overlooked.

If that's a problem, I can also change it after merging.

src/tools.rs Outdated
@@ -253,7 +253,7 @@ pub async fn get(
version: Option<&str>,
offline: bool,
client_options: &HttpClientOptions,
) -> Result<PathBuf> {
) -> Result<(PathBuf, String)> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I am not a fan of having this as a mandatory return value. Maybe we can have a get_details function, which returns a struct (which we can extend later). And then have an implementation of get reusing that new function, dropping everything exception the path.

src/pipelines/rust/output.rs Outdated Show resolved Hide resolved
src/pipelines/rust/output.rs Outdated Show resolved Hide resolved
@yescallop
Copy link
Contributor Author

Thanks for the suggestions. I introduced a WasmBindgenFeatures struct containing a init_with_object flag, for better modularity and documentation. Would you mind taking a look at how to return the version in a better way after the PR is merged?

Co-authored-by: Jens Reimann <ctron@dentrassi.de>
Copy link
Collaborator

@ctron ctron left a comment

Choose a reason for hiding this comment

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

Thanks for the change. I updated the API. Looks good.

@ctron ctron added this pull request to the merge queue Nov 7, 2024
Merged via the queue into trunk-rs:main with commit de09225 Nov 7, 2024
60 checks passed
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.

Console warning: using deprecated parameters for the initialization function; pass a single object instead
2 participants