-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
refactor(rest): add web compatibility #9682
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ |
This PR makes the following changes: - `node:` prefixes for *value* imports have been removed in favor of global objects. - `ResponseLike` not has an additional property `statusText` as `STATUS_CODES` is only in node and `fetch`'s statusText seems to provide equivalent functionality - `file-type` has been removed due to dependence on node and `is-apng` is it's replacement - Various fixes have been made to how the undici strategy is imported. `undiciRequest` was being bundled even if `fetch` was specified as the `makeRequest` option, despite it being a dynamic import. This PR fixes that issue by manually specifying `undiciRequest.ts` should not be bundled.
63b9729
to
6e9c4bc
Compare
Codecov Report
@@ Coverage Diff @@
## feat/no-de-no-de #9682 +/- ##
====================================================
- Coverage 58.03% 57.80% -0.23%
====================================================
Files 228 232 +4
Lines 14955 15003 +48
Branches 1133 1137 +4
====================================================
- Hits 8679 8673 -6
- Misses 6236 6290 +54
Partials 40 40
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
e7c4a41
to
d4da3a1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm also not fully convinced about the setTimeout().unref?.()
since on Deno and Bun, it'll read properties that don't exist, which carries a performance penalty.
Maybe an utility named setUnrefTimeout()
?
The performance impact on |
Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com> Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>
Please describe the changes this PR makes and why it should be merged:
Allow /rest to run in edge/web environments.
node:
prefixes for value imports have been removed in favor of global objects.ResponseLike
now has an additional propertystatusText
asSTATUS_CODES
is only in node andfetch
's statusText seems to provide equivalent functionalityEventEmitter
withAsyncEventEmitter
.file-type
has been removed due to dependence on node andmagic-bytes.js
is it's replacementStatus and versioning classification: