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

Use global WebSocket constructor if available #9645

Closed
Tracked by #9663
williamhorning opened this issue Jun 12, 2023 · 4 comments
Closed
Tracked by #9663

Use global WebSocket constructor if available #9645

williamhorning opened this issue Jun 12, 2023 · 4 comments

Comments

@williamhorning
Copy link

williamhorning commented Jun 12, 2023

Which application or package is this feature request for?

ws

Feature

Currently, Discord.js uses the ws module from npm, which works just fine in Node. However, this module causes issues on alternative JS runtimes like Deno.

Ideal solution or implementation

Discord.js should check to see if the WebSocket constructor is available globally and use that instead of the ws module if it's available.

Alternative solutions or implementations

Other context

The error thrown under Deno: terminal screenshot

@jaw0r3k
Copy link
Contributor

jaw0r3k commented Jun 15, 2023

We dont support deno for this moment,
Also it would require more changes

@williamhorning
Copy link
Author

@jaw0r3k This wouldn't just impact Deno users, this would also allow Bun users to use its WebSocket implementation, which they claim is faster than the ws module currently used by Discord.js. I'd be willing to try to do the work needed to make this happen if it isn't that high of a priority for Discord.js at the moment.

@imranbarbhuiya
Copy link
Contributor

Vladdy worked on it few months ago but didn't completed ig https://github.com/discordjs/discord.js/tree/feat/no-de-no-de

@Jiralite Jiralite mentioned this issue Jun 25, 2023
@williamhorning
Copy link
Author

fixed by #9683

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants