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

put ErrorEvent and CloseEvent on global scope #2084

Closed
jimmywarting opened this issue Apr 22, 2023 · 2 comments
Closed

put ErrorEvent and CloseEvent on global scope #2084

jimmywarting opened this issue Apr 22, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@jimmywarting
Copy link
Contributor

I think this is more targeted to the nodejs/node repo.
but since they both are implemented here in undici i will instead post it here.

CloseEvent and ErrorEvent exist globally in Deno, but not in NodeJS.
I guess Deno has it b/c of WebSocket and FileReader, Workers and globalThis.onerror.

Any way... my feature request is to make those two accessible on the globalThis...

I tried last weak to build a more spec compatible Worker last week and wanted to use ErrorEvent but was a tiny bit surprised that it where not introduced earlier.

related to: nodejs/node#47587

@jimmywarting jimmywarting added the enhancement New feature or request label Apr 22, 2023
@jimmywarting jimmywarting changed the title Make ErrorEvent and CloseEvent put ErrorEvent and CloseEvent on global scope Apr 22, 2023
@KhafraDev
Copy link
Member

KhafraDev commented Apr 22, 2023

Adding globals is out of scope for undici. Once undici exports WebSocket in its "fetch" bundle (which node is using), I can see the errors also being exported. FWIW I don't think WebSocket is ready to be exported yet, not until we have some confirmation it's being used and it works.

@mcollina
Copy link
Member

We are happy to update the fetch bundle with whatever API Node.js needs, but it's not up to us to decide.

@mcollina mcollina closed this as not planned Won't fix, can't repro, duplicate, stale Apr 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants