discord.js icon indicating copy to clipboard operation
discord.js copied to clipboard

feat: no-de-no-de, now with extra buns

Open vladfrangu opened this issue 2 years ago • 4 comments

Please describe the changes this PR makes and why it should be merged:

This PR brings in out-of-the-box support for:

  • Deno
  • Bun
  • Cloudflare Workers
  • Vercel Functions

and whatever else floats your boat.

note: Bun is currently blocked with this PR due to https://github.com/oven-sh/bun/issues/3392, but 🤞 they get that fixed

Status and versioning classification:

  • Code changes have been tested against the Discord API, or there are no code changes
  • This PR changes the library's interface (methods or parameters added)
  • This PR includes breaking changes (methods removed or renamed, parameters moved or removed)

vladfrangu avatar Jul 03 '23 23:07 vladfrangu

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Ignored Deployments
Name Status Preview Comments Updated (UTC)
discord-js ⬜️ Ignored (Inspect) Jul 16, 2023 11:50pm
discord-js-guide ⬜️ Ignored (Inspect) Jul 16, 2023 11:50pm

vercel[bot] avatar Jul 03 '23 23:07 vercel[bot]

Codecov Report

Merging #9683 (be02852) into main (75d91b5) will decrease coverage by 0.42%. The diff coverage is 49.52%.

@@            Coverage Diff             @@
##             main    #9683      +/-   ##
==========================================
- Coverage   58.20%   57.78%   -0.42%     
==========================================
  Files         227      232       +5     
  Lines       14902    15062     +160     
  Branches     1131     1135       +4     
==========================================
+ Hits         8673     8703      +30     
- Misses       6189     6319     +130     
  Partials       40       40              
Flag Coverage Δ
builders 98.69% <ø> (ø)
proxy 76.31% <ø> (ø)
rest 92.71% <90.90%> (-0.42%) :arrow_down:
util 70.55% <12.50%> (-27.94%) :arrow_down:
ws 52.38% <14.28%> (-1.48%) :arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
packages/rest/src/lib/CDN.ts 96.01% <ø> (-1.76%) :arrow_down:
packages/rest/src/web.ts 0.00% <0.00%> (ø)
packages/util/src/functions/runtime.ts 8.33% <8.33%> (ø)
packages/util/src/functions/userAgentAppendix.ts 13.46% <13.46%> (ø)
packages/ws/src/ws/WebSocketShard.ts 18.97% <14.28%> (-0.88%) :arrow_down:
packages/rest/src/lib/RequestManager.ts 89.47% <81.81%> (-0.64%) :arrow_down:
packages/rest/src/environment.ts 100.00% <100.00%> (ø)
packages/rest/src/lib/REST.ts 98.87% <100.00%> (-0.04%) :arrow_down:
packages/rest/src/lib/errors/HTTPError.ts 100.00% <100.00%> (ø)
packages/rest/src/lib/handlers/BurstHandler.ts 91.03% <100.00%> (-0.07%) :arrow_down:
... and 6 more

... and 2 files with indirect coverage changes

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

codecov[bot] avatar Jul 03 '23 23:07 codecov[bot]

For now, to not block this PR moving forward, /ws will keep using the ws module. Once the bun issue is solved, we'll enable using global ws instead

vladfrangu avatar Jul 09 '23 15:07 vladfrangu

Yes, yes we should make it static instead, or even a variable outside the class. Good catch On Jul 9, 2023, 20:02 +0300, Aura Román @.***>, wrote:

@kyranet commented on this pull request. In packages/ws/src/ws/WebSocketShard.ts:

@@ -83,6 +83,12 @@ export interface SendRateLimitState { export class WebSocketShard extends AsyncEventEmitter<WebSocketShardEventsMap> { private connection: WebSocket | null = null;

  •   // TODO(vladfrangu): enable this once https://github.com/oven-sh/bun/issues/3392 is solved
    
  •   // private WebSocketConstructor: typeof WebSocket = shouldUseGlobalFetchAndWebSocket()
    
  •   //      ? (globalThis as any).WebSocket
    
  •   //      : WebSocket;
    
  •   private WebSocketConstructor: typeof WebSocket = WebSocket;
    

Shouldn't we make this static? — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

vladfrangu avatar Jul 09 '23 17:07 vladfrangu

lgtm, just need the last commit message to have the breaking changes list

ckohen avatar Jul 10 '23 23:07 ckohen

I hope the changes will be applied asap :) I really need to use it with supabase.

Bogdan1001 avatar Jul 11 '23 19:07 Bogdan1001

lgtm, just need the last commit message to have the breaking changes list

I'll just mark as blocked so kodiak doesn't do the auto merge but can't I specify the changelog and breaking entries when merging the PR myself?

vladfrangu avatar Jul 12 '23 08:07 vladfrangu

You can, but you can also squash the commits with the breaking change list in the commit description.

kyranet avatar Jul 12 '23 16:07 kyranet

hm does this also fix the undici issue with windows?

7xa5h avatar Jul 12 '23 17:07 7xa5h

That sounds like something to raise to Undici.

Jiralite avatar Jul 12 '23 18:07 Jiralite

hm does this also fix the undici issue with windows?

It should remedy this as it’ll opt to use the native fetch in deno instead of using undici.request.

suneettipirneni avatar Jul 12 '23 18:07 suneettipirneni

What's blocking this from being merged, Bun?

im p sure iCrawl has to approve first

7xa5h avatar Jul 15 '23 04:07 7xa5h

@vladfrangu you might need to merge with main, you're out of date

Erisfiregamer1 avatar Jul 17 '23 00:07 Erisfiregamer1