js-compute-runtime icon indicating copy to clipboard operation
js-compute-runtime copied to clipboard

Qwik City on Fastly

Open kalebpace opened this issue 1 year ago • 2 comments

Summary

Hello 👋

I've been working on an adapter for the Qwik City meta-framework so it can be run on Compute@Edge. I wanted to open this issue to ask a few questions and socialize this work a bit in case this is helpful to anyone else.

I've run into a few missing APIs in the js-compute runtime when implementing the adapter in Qwik City's e2e integration project:

  • AbortSignal API
  • formData/blob on Request objects
  • Intl API - Causes wizer error
Wizer Error

Exception while evaluating JS: (new ReferenceError("Intl is not defined", "<stdin>", 20115))
  @<stdin>:20115:12
  @<stdin>:25647:3

Error: the `wizer.initialize` function trapped

Caused by:
    0: error while executing at wasm backtrace:
           0: 0x7ec9a5 - <unknown>!<wasm function 21789>
           1: 0x7ec6b7 - <unknown>!<wasm function 21765>
           2: 0x7edbd2 - <unknown>!<wasm function 21836>
           3: 0xfd6f - <unknown>!<wasm function 223>
           4: 0x1043c - <unknown>!<wasm function 226>
           5: 0x108b3 - <unknown>!<wasm function 229>
    1: Exited with i32 exit status 1
Error: Failed to compile JavaScript to Wasm:  Wizer initialization failure
 ELIFECYCLE  Command failed with exit code 1.

Questions

I am mainly curious about:

  1. Whether these APIs are planned for the runtime
  2. How a project like https://github.com/fastly/next-compute-js might suggest solving for their unavailability

Thanks very much in advance for your time and attention to this!

kalebpace avatar Dec 17 '23 17:12 kalebpace

Hi @kalebpace,

Whether these APIs are planned for the runtime

Yes, we would like to implement these APIs

How a project like fastly/next-compute-js might suggest solving for their unavailability

I'm not sure on that one, I don't work on the next-compute-js project, if you open an issue on that project then hopefully the team their will be able to answer 🤞

JakeChampion avatar Jan 11 '24 13:01 JakeChampion

Hey @JakeChampion, thanks for looking at this.

Yes, we would like to implement these APIs

Since there is interest here, is there a recommendation on how best to contribute/start work on these changes?

For example, the missing Intl API seems to be a flag in the spidermonkey runtime.

Would it be as simple as opening a PR with a successful build of it enabled or are there larger implications to making a change like this?

kalebpace avatar Jan 21 '24 17:01 kalebpace