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 deprecated parameters js warning #3219

Merged
merged 1 commit into from
Nov 10, 2024

Conversation

paul-hansen
Copy link
Contributor

@paul-hansen paul-hansen commented Nov 10, 2024

Fixes the browser js console warning when running Leptos apps:

using deprecated parameters for the initialization function; pass a single object instead

I figured it out by following the link in the wasm-bindgen changelog entry:

Deprecated parameters to default (init) and initSync in favor of an object. rustwasm/wasm-bindgen#3995

Which told me it was our calling of the default function that was changed/deprecated, and I looked at the changed examples to see how it should be now be called with an object like {module_or_path: path} here:
https://github.com/daxpedda/wasm-bindgen/blob/152dcf22f241d0245cccd97e5d1bd3286ebc5514/examples/websockets/index.js#L4

I tested it with the hackernews_axum example and the warning no longer showed up with this change.

@benwis
Copy link
Contributor

benwis commented Nov 10, 2024

Glad you found this, that always bugged me

@paul-hansen
Copy link
Contributor Author

Same. I was about to try to figure out how to filter it out in my app to prevent warning fatigue, decided I should be a good citizen and try to track it down first.

paul-hansen added a commit to paul-hansen/leptos that referenced this pull request Nov 10, 2024
benwis pushed a commit that referenced this pull request Nov 10, 2024
@tetuaoro
Copy link

Hi, thank you. My website should reach 💯 at pagespeed insight now 😂. Big ❤️

@gbj gbj merged commit f804a69 into leptos-rs:main Nov 10, 2024
73 checks passed
@gbj
Copy link
Collaborator

gbj commented Nov 10, 2024

Thanks!

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.

4 participants