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

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

Merged
merged 10 commits into from
Jul 17, 2023
Merged

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

merged 10 commits into from
Jul 17, 2023

Conversation

vladfrangu
Copy link
Member

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 oven-sh/bun#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)

@vercel
Copy link

vercel bot commented Jul 3, 2023

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

@codecov
Copy link

codecov bot commented Jul 3, 2023

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%) ⬇️
util 70.55% <12.50%> (-27.94%) ⬇️
ws 52.38% <14.28%> (-1.48%) ⬇️

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%) ⬇️
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%) ⬇️
packages/rest/src/lib/RequestManager.ts 89.47% <81.81%> (-0.64%) ⬇️
packages/rest/src/environment.ts 100.00% <100.00%> (ø)
packages/rest/src/lib/REST.ts 98.87% <100.00%> (-0.04%) ⬇️
packages/rest/src/lib/errors/HTTPError.ts 100.00% <100.00%> (ø)
packages/rest/src/lib/handlers/BurstHandler.ts 91.03% <100.00%> (-0.07%) ⬇️
... and 6 more

... and 2 files with indirect coverage changes

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

vladfrangu and others added 4 commits July 9, 2023 18:32
Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>
@vladfrangu vladfrangu marked this pull request as ready for review July 9, 2023 15:32
@vladfrangu vladfrangu requested review from a team and iCrawl as code owners July 9, 2023 15:32
@vladfrangu
Copy link
Member Author

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
Copy link
Member Author

vladfrangu commented Jul 9, 2023 via email

kyranet
kyranet previously requested changes Jul 9, 2023
packages/ws/src/ws/WebSocketShard.ts Outdated Show resolved Hide resolved
@Jiralite Jiralite removed their request for review July 10, 2023 14:47
@ckohen
Copy link
Member

ckohen commented Jul 10, 2023

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

@Bogdan1001
Copy link

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

@vladfrangu
Copy link
Member Author

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?

@kyranet
Copy link
Member

kyranet commented Jul 12, 2023

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

@imranbarbhuiya imranbarbhuiya mentioned this pull request Jul 12, 2023
@7xa5h
Copy link

7xa5h commented Jul 12, 2023

hm does this also fix the undici issue with windows?

@Jiralite
Copy link
Member

That sounds like something to raise to Undici.

@suneettipirneni
Copy link
Member

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.

Copy link

@Erisfiregamer1 Erisfiregamer1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's blocking this from being merged, Bun?

@7xa5h
Copy link

7xa5h commented Jul 15, 2023

What's blocking this from being merged, Bun?

im p sure iCrawl has to approve first

iCrawl
iCrawl previously requested changes Jul 15, 2023
packages/rest/.eslintrc.json Outdated Show resolved Hide resolved
packages/rest/.lintstagedrc.js Outdated Show resolved Hide resolved
packages/rest/tsup.config.ts Outdated Show resolved Hide resolved
BREAKING CHANGE: The REST and RequestManager classes now extend AsyncEventEmitter
from `@vladfrangu/async_event_emitter`, which aids in cross-compatibility
between Node, Deno, Bun, CF Workers, Vercel Functions, etc.

BREAKING CHANGE: DefaultUserAgentAppendix has been adapted to support multiple
different platforms (previously mentioned Deno, Bun, CF Workers, etc)

BREAKING CHANGE: the entry point for `@discordjs/rest` will now differ
in non-node-like environments (CF Workers, etc.)
@Erisfiregamer1
Copy link

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

@iCrawl iCrawl merged commit 386f206 into main Jul 17, 2023
22 checks passed
@iCrawl iCrawl deleted the feat/no-de-no-de branch July 17, 2023 06:27
@Jiralite Jiralite added this to the rest 2.0.0 milestone Jul 17, 2023
Vylpes pushed a commit to Vylpes/vylbot-app that referenced this pull request Aug 7, 2023
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [@discordjs/rest](https://discord.js.org) ([source](https://github.com/discordjs/discord.js)) | dependencies | major | [`^1.1.0` -> `^2.0.0`](https://renovatebot.com/diffs/npm/@discordjs%2frest/1.7.1/2.0.0) |

---

### Release Notes

<details>
<summary>discordjs/discord.js</summary>

### [`v2.0.0`](https://github.com/discordjs/discord.js/blob/HEAD/packages/rest/CHANGELOG.md#discordjsrest200-httpsgithubcomdiscordjsdiscordjscomparediscordjsrest171discordjsrest200---2023-07-31)

[Compare Source](https://github.com/discordjs/discord.js/compare/@discordjs/rest@1.7.1...@discordjs/rest@2.0.0)

#### Features

-   No-de-no-de, now with extra buns ([#&#8203;9683](discordjs/discord.js#9683)) ([386f206](discordjs/discord.js@386f206))
    -   **BREAKING CHANGE:** The REST and RequestManager classes now extend AsyncEventEmitter
        from `@vladfrangu/async_event_emitter`, which aids in cross-compatibility
        between Node, Deno, Bun, CF Workers, Vercel Functions, etc.
    -   **BREAKING CHANGE:** DefaultUserAgentAppendix has been adapted to support multiple
        different platforms (previously mentioned Deno, Bun, CF Workers, etc)
    -   **BREAKING CHANGE:** the entry point for `@discordjs/rest` will now differ
        in non-node-like environments (CF Workers, etc.)
    -   **Co-authored-by:** Suneet Tipirneni <77477100+suneettipirneni@users.noreply.github.com>
    -   **Co-authored-by:** Jiralite <33201955+Jiralite@users.noreply.github.com>
    -   **Co-authored-by:** suneettipirneni <suneettipirneni@icloud.com>
-   User avatar decorations ([#&#8203;8914](discordjs/discord.js#8914)) ([8d97017](discordjs/discord.js@8d97017))
-   Support new username system ([#&#8203;9512](discordjs/discord.js#9512)) ([1ab60f9](discordjs/discord.js@1ab60f9))

#### Refactor

-   **REST:** Remove double classing ([#&#8203;9722](discordjs/discord.js#9722)) ([8f4256d](discordjs/discord.js@8f4256d))
    -   **BREAKING CHANGE:** `REST` and `RequestManager` have been combined, most of the properties, methods, and events from both classes can now be found on `REST`
    -   **BREAKING CHANGE:** `REST#raw` has been removed in favor of `REST#queueRequest`
    -   **BREAKING CHANGE:** `REST#getAgent` has been removed in favor of `REST#agent`

<!---->

-   chore: update for /rest changes

<!---->

-   **rest:** Switch api to fetch-like and provide strategies ([#&#8203;9416](discordjs/discord.js#9416)) ([cdaa0a3](discordjs/discord.js@cdaa0a3))
    -   **BREAKING CHANGE:** NodeJS v18+ is required when using node due to the use of global `fetch`
    -   **BREAKING CHANGE:** The raw method of REST now returns a web compatible `Respone` object.
    -   **BREAKING CHANGE:** The `parseResponse` utility method has been updated to operate on a web compatible `Response` object.
    -   **BREAKING CHANGE:** Many underlying internals have changed, some of which were exported.
    -   **BREAKING CHANGE:** `DefaultRestOptions` used to contain a default `agent`, which is now set to `null` instead.

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC43NC4yIiwidXBkYXRlZEluVmVyIjoiMzQuNzQuMiJ9-->

Reviewed-on: https://gitea.vylpes.xyz/RabbitLabs/vylbot-app/pulls/327
Co-authored-by: Renovate Bot <renovate@vylpes.com>
Co-committed-by: Renovate Bot <renovate@vylpes.com>
@Jiralite Jiralite removed the blocked label May 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet