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

Fixes for the Playground #979

Merged
merged 3 commits into from
Apr 21, 2022
Merged

Fixes for the Playground #979

merged 3 commits into from
Apr 21, 2022

Conversation

rachitnigam
Copy link
Contributor

Fixes #978.

@rachitnigam
Copy link
Contributor Author

Need a better solution than just duplicating the execute plan stuff

Copy link
Contributor

@sampsyo sampsyo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a quick thought within!

@@ -50,6 +50,7 @@ fn compile(

#[wasm_bindgen]
pub fn run(passes: &JsValue, library: &str, namespace: &str) -> String {
std::panic::set_hook(Box::new(console_error_panic_hook::hook));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Turning panics into console.logs is a neat solution!

@@ -176,6 +176,27 @@ impl PassManager {

Ok(())
}

/// Executes a given "plan" constructed with logging disabled
pub fn execute_plan_without_log(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know if this is a good idea, but one option would be to use a wasm-specific logger, sort of analogously to the wasm-specific panic hook.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the reference! I'm trying to see if there is a shim for the Instant::now() implementation somewhere that I can use. If not, this might be the way to go.

@rachitnigam rachitnigam marked this pull request as ready for review April 21, 2022 22:15
@rachitnigam rachitnigam merged commit cd6e427 into master Apr 21, 2022
@rachitnigam rachitnigam deleted the play-fix branch April 21, 2022 22:33
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.

Playground deployment broken
2 participants