You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I had a personal need to generate a debug version of a package in my project and quickly implemented a --debug flag. It may require some bikesheddish discussion:
(1) --debug is the opposite of the flag used by cargo (--release). Usage is more obvious if the wasm-pack flag is identical to the already-familiary cargo flag, however switching to --release also changes the default behavior of wasm-pack.
(2) There's a --debug flag in wasm-bindgen that we might also hook into.
(3) Not sure if this is within the scope of wasm-pack.
The text was updated successfully, but these errors were encountered:
hi @clanehin - thanks for filing this! i'm not opposed to a feature like this- though i am curious to learn more about the use case you had to generate a debug version of a package- would you mind sharing?
Sure. Easiest just to tell the story. I was working on an electron app structured as a lerna monorepo. I decided that some of the modules were good candidates to experimentally port to rust, which I did, partly because wasm-pack was so easy to use.
Inevitably, one of the components had a bug, and I wrote some assertions to catch the problem early. The assertions are useful and I want to keep them in the program, but they change the big-O runtime of the program rather dramatically, so it seemed to make sense to put them behind cfg(debug_assertions).
Of course, those assertions only fire in --debug. At that point, adding the debug flag to wasm-pack was easy, and I've been wanting to contribute more anyway, so I did, and here we are. :)
I can budget some time to follow up with additional changes, if you think the project will benefit from them. Not sure what direction you want go, though.
I had a personal need to generate a debug version of a package in my project and quickly implemented a --debug flag. It may require some bikesheddish discussion:
(1) --debug is the opposite of the flag used by cargo (--release). Usage is more obvious if the wasm-pack flag is identical to the already-familiary cargo flag, however switching to --release also changes the default behavior of wasm-pack.
(2) There's a --debug flag in wasm-bindgen that we might also hook into.
(3) Not sure if this is within the scope of wasm-pack.
The text was updated successfully, but these errors were encountered: