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

Component binding class naming issue #119

Open
Mossaka opened this issue Jan 9, 2023 · 1 comment
Open

Component binding class naming issue #119

Mossaka opened this issue Jan 9, 2023 · 1 comment

Comments

@Mossaka
Copy link
Member

Mossaka commented Jan 9, 2023

I was playing around the component model demo example listed in README. One issue I found with that is the python class Demo name is generated from the wasm file name. This is error-prone because I could rename the wasm name to demo.component.wasm and the generated Demo.component class name in Python is a syntax error.

How to reproduce

Go through the first demo example under the "Components" section. Change the commands to the following

$ wasm-tools component new demo.wat --wit demo.wit -o demo.component.wasm
$ python -m wasmtime.bindgen demo.component.wasm --out-dir demo

Notice how "demo.wasm" is replaced with "demo.component.wasm".

Then notice that the generated python file contains syntax error because the Demo class name is now replaced with Demo.component class name in demo/__init__.py

@alexcrichton
Copy link
Member

Ah yeah happy to adjust! The naming conventions there are just a baseline for now and it's ok to update them.

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

No branches or pull requests

2 participants