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
Is your feature request related to a problem? Please describe.
At a first approach, the JavaScript workers follow the Web Workers API. It requires to subscribe to a specific event and then, process the request and provide a response:
However, the current JavaScript SDK emulates this behavior, so it doesn't provide any Web API behind it. In addition to that, other platforms like Cloudflare and Vercel started to simplify this syntax in favor of ECMA modules:
Why export an object and not the fetch function directly? Is it a standard that emerges from other platforms?
Yes! One of the goals of wws is to keep compatibility with other platforms. For example, you can take a worker from wws and run it in Cloudflare or Fastly. We're following the WinterCG standard and taking Cloudflare as a reference for the syntax on the JavaScript workers.
In the examples, they use this syntax. I assume they want to return an object open to support future methods / use cases.
Is your feature request related to a problem? Please describe.
At a first approach, the JavaScript workers follow the Web Workers API. It requires to subscribe to a specific event and then, process the request and provide a response:
wasm-workers-server/examples/js-params/fixed.js
Lines 27 to 30 in 51da710
However, the current JavaScript SDK emulates this behavior, so it doesn't provide any Web API behind it. In addition to that, other platforms like Cloudflare and Vercel started to simplify this syntax in favor of ECMA modules:
This syntax is simpler and more convenient.
Describe the solution you'd like
I want to write workers using the ECMA modules approach, while keeping compatibility with existing modules based on the Web Workers API.
It requires to change the current JavaScript SDK to:
Describe alternatives you've considered
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: