-
Notifications
You must be signed in to change notification settings - Fork 5
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(618): handle remaining wasm panics, and expose is_valid_flux() API #621
Conversation
#[wasm_bindgen] | ||
pub fn initLog() { | ||
#[cfg(feature = "console_log")] | ||
console_log::init_with_level(log::Level::Trace) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Chose wasm-logger over console-log lib, due to the reported build size.
…ed main() function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding the test case! I have one question below
@@ -18,7 +18,7 @@ lto = true | |||
default = ["cmd"] | |||
strict = [] | |||
cmd = ["clap", "simplelog", "tokio", "tower-service", "lspower/runtime-tokio"] | |||
wasm = ["futures", "js-sys", "lspower/runtime-agnostic", "tower-service", "wasm-bindgen", "wasm-bindgen-futures"] | |||
wasm = ["futures", "js-sys", "fluxlang", "lspower/runtime-agnostic", "tower-service", "wasm-bindgen", "wasm-bindgen-futures"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm very new to wasm. Just trying to understand. What does fluxlang
do here? To expose is_valid_flux()
API? I thought is_valid_flux()
is already included in wasm-bindgen
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is_valid_flux()
uses the lang module, which is not included in the wasm without this feature.
But then did a build size sanity check, to make sure the wasm is still an ok size.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it! Thanks
So...lesson learned. chain of actions:
reason for failure?
. So what is the conclusion? Do it the manual way:
|
Fixed. On version bump in UI, we then need to update this file to:
|
…le import. Instead, provide the initLog to manually call on import in UI.
@@ -16,7 +16,6 @@ case $BUILD_MODE in | |||
;; | |||
"dev") | |||
BUILD_FLAG="--dev" | |||
BUILD_MODE_ARGS="${BUILD_MODE_ARGS},console_log" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we no longer include the console_log just for dev build, we don't need to re-bind the BUILD_MODE_ARGS
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the explanation!
Closes #618
Done:
parse()
contract does.parse()
as a validation method in the UI. Which is wrong.is_valid_flux()
method which can be used for validation in the UIPayload comparison:
The size of our wasm can impact network load times. With the changes made here, the release build has an increase in 25kB size.