feat(adapter): new uWebSockets adapter#103
Conversation
Deploying h3-srvx with
|
| Latest commit: |
d4a5698
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://8b74922b.h3-srvx.pages.dev |
| Branch Preview URL: | https://feat-adapter-uws.h3-srvx.pages.dev |
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
|
Thanks for taking a shot at this. I'm not a maintainer or a contributor here, so pardon the intrusion. But I've implemented a similar adapter before and there are a few sharp edges in uWebSockets.js that need to be addressed: Most importantly, It's probably best not to expose it to the user as user code may run after any number of Alternatively, one could call the user handler, and if the return value is a promise, do the "gutting" at that point but I'd expect it to cause more complexity for little gain. Another sharp edge is when reading the request body: The const src = new Uint8Array(chunk);
const copy = new Uint8Array(chunk.byteLength);
copy.set(src);
controller.enqueue(copy);for all but the very last chunk. Also, I also see a few optimization opportunities like deferring the I also see some new APIs that I was not aware of, like I'm also interested in seeing uWebSockets.js adapter merged. Drop me a line on Discord or check my profile for other contact info if you'd consider pairing on this. |
Resolves #71
I wanted to take a shot at this, as it is a topic which I'm new but would like to understand. As such I want to warn that I've used extensively various LLMs to find docs and explain things, but final touch/edits/verifications were always human.
I tried to setup some benchmarks to distinguish from native node and uws, but failed. @pi0 I would love your help if and when you are available.
Tests run super smooth tho