Skip to content
This repository was archived by the owner on Aug 25, 2025. It is now read-only.

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 subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant