-
Notifications
You must be signed in to change notification settings - Fork 223
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: plain
and web
adapters
#483
Conversation
Codecov Report
@@ Coverage Diff @@
## main #483 +/- ##
==========================================
+ Coverage 82.56% 82.79% +0.23%
==========================================
Files 28 31 +3
Lines 3234 3424 +190
Branches 494 515 +21
==========================================
+ Hits 2670 2835 +165
- Misses 564 589 +25
|
Let's try it! |
// Shim for Node.js request and response objects | ||
// TODO: Remove in next major version |
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.
What does this actually mean? I did not find any other information regarding this comment.
Does this mean that internal representation as IncomingMessage/ServerResponse
will change at some point? If yes, is there discussions somewhere on the subject? If no, what was the idea?
For the context, I'm experimenting on generic handlers (and middlewares), and currently listing how each popular server implements handlers and middlewares.
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.
Some more context on a dedicated repo https://github.com/magne4000/universal-handler
π Linked issue
Resolves #458
β Type of change
π Description
This PR adds two new plain and web adapters to use h3 directly outside of Node.js environments!
Until now, it was only possible to use h3 in workers and lambda environments by either using Nitropack or custom code. With two new adapters, integration will be much more straightforward.
Two new utils depend on unenv framework to keep backward compatibility with Node.js API. This will be fully optional in the next major version of H3 once all h3 internal utils were decoupled.
Worker test deployment (deno deploy): https://rich-owl-49.deno.dev
Total bundle size analysis (with esbuild):
π Checklist