Skip to content

Added #[wasm_bindgen] for all mentions of impl Universe #325

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Yug34
Copy link

@Yug34 Yug34 commented Apr 6, 2025

Summary

Explain the motivation for making this change. What existing problem does the pull request solve? 🤔

The first mentions of impl Universe don't have #[wasm_bindgen], this results in cargo build running successfully but the wasm_game_of_life.d.ts file containing only this type def for Universe:

export class Universe {
  private constructor();
  free(): void;
}

#[wasm_bindgen] is added later, which works perfectly! But admittedly, while studying the code, I didn't read the code outside of impl Universe, and had to spend time debugging and wondering why the d.ts file is correct for greet() but not Universe.

Might save the time for some other people as well; making sure the #[wasm_bindgen] is not missable!

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.

1 participant