Stream: ComponentizeJS

Topic: setTimeout support


view this post on Zulip Jorge Vasquez (Sep 21 2023 at 15:49):

Hello, I'm trying to run componentize for a simple API that uses setTimeout:

export const api = {
  "checkout": function () {
    setTimeout(() => {
      console.log("Checking out.");
    }, 1000);
  }
}

And I'm getting this error when running the component: ReferenceError: setTimeout is not defined, is there a way to solve that problem?

view this post on Zulip Jorge Vasquez (Sep 21 2023 at 16:03):

I've created a GitHub issue as well: https://github.com/bytecodealliance/componentize-js/issues/56

I'm trying to run componentize for a simple API that uses setTimeout: export const api = { "checkout": function () { setTimeout(() => { console.log("Checking out."); }, 1000); } } And I'm getting t...

view this post on Zulip Eduardo Rodrigues (Sep 21 2023 at 16:37):

setTimeout is not in the list of exposed functions from spidermonkey: https://github.com/bytecodealliance/componentize-js#native-functions

JS -> WebAssembly Component. Contribute to bytecodealliance/componentize-js development by creating an account on GitHub.

view this post on Zulip Guy Bedford (Sep 21 2023 at 17:06):

Hi Jorge, we're working on implementing the event loop over the next couple of weeks, it's the number one priority for the project right now. So we should have an updated on it very soon!

view this post on Zulip Jorge Vasquez (Sep 21 2023 at 18:04):

ohhh, great, thank you for your answers!

view this post on Zulip Adam Fraser (Oct 30 2023 at 20:43):

Hi. Any update on the event loop support? Excited to get this in!

view this post on Zulip Guy Bedford (Oct 30 2023 at 21:35):

Adam Fraser said:

Hi. Any update on the event loop support? Excited to get this in!

Unfortunately, getting WASI support has taken over as a priority here. So others may wish to pick this up.

view this post on Zulip Guy Bedford (Oct 30 2023 at 21:35):

Guy Bedford said:

Adam Fraser said:

Hi. Any update on the event loop support? Excited to get this in!

Unfortunately, getting WASI support has taken over as a priority here. So others may wish to pick this up.

I hope to be able to work on it again next year.


Last updated: Nov 22 2024 at 17:03 UTC