-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat: add deno_web
APIs like setTimeout
#34
Conversation
Signed-off-by: Miroslav Bajtoš <oss@bajtos.net>
Signed-off-by: Miroslav Bajtoš <oss@bajtos.net>
@juliangruber This pull request is adding many new public APIs, significantly increasing the amount of stuff we will need to support in the future. Most of these APIs are lightweight (e.g. AbortController, events, Performance, URL), so I don't anticipate any need to restrict their usage when we start limiting resource consumption. Many other APIs will be needed in the future:
Could you please review the list of the new APIs and let me know if there is anything you would prefer to remove from the global scope (make it private)? Do you have any opinions on how to test this? I don't want to replicate the Deno test suite or Web API conformance tests. At the same time, I think it would be nice to have some sort of smoke tests to verify that the APIs are correctly exposed. But that's quite a lot of work, considering how many new APIs are added in this PR. |
Signed-off-by: Miroslav Bajtoš <oss@bajtos.net>
Signed-off-by: Miroslav Bajtoš <oss@bajtos.net>
+100, always go with the platform / ecosystem.
I'm not sure how to think about this. In general, everything that is expected in a modern JS platform should be here, unless its implementation is problematic for Zinnia's purposes.
What about just checking whether the global is defined? And then progress with regression tests where necessary. We could also add some more tests to one specific module, which "proves" that in general integrating modules from Deno works. |
Cool.
I will land this PR as-is and open another PR to add some smoke tests. I'll see if I can find a reasonably easy way to add these tests en masse. |
Add JS APIs from
deno_web
crate.Most notably:
AbortController
TextEncoder
andTextDecoder
(will be needed for WASM)File
,FileReader
andBlob
MessageChannel
,structuredClone
and friendsatob
andatoa
(will be needed for WASM)setTimeout
,setInterval
, and friendsPerformance
APIsReadableStream
,WritableStream
, etc.)URL
and friendsSee #7