Post

πŸ’₯ srvx.h3.dev is close to 96.98% of node:http performance. βœ… Web standard servers on Node.js at no cost

2 reposts29 likes

I have a private repo and matching npm org called "h3xt" I registered yeas ago. Never pushed the code to it, but it was intended to be somewhere between your H3 and express. Web standard api's but with the the middle approach. Funny naming coincidence.

Ah thats funny! We also renamed org from httpjs back to h3js because could be so confusing with jshttp πŸ˜‚ Curious to read what was your original idea in h3ext ❀️

It was web standards based spiritual successor to express. So keeping some of the same middleware first designs, but using web api's and tightening some of the obviously bad parts historically in express. Honestly though, I realized that it would be better to just land those in Node.js/express.

One of the engineering aspects that feels most cursed to me is the propensity for drawing distinctions, rather than being able to see uniformity & relations. Having multiple distinct models for what http requests & responses makes no sense. The entities are the same wherever they are.

I know you're not a big fan of it, and FWIW, I don't disagree! Interfaces like `Request` were originally designed for outgoing, not incoming. So in srvx, we introduce a new `ServerRequest` interface. I believe simplified Request β†’ Response handlers and end-to-end consistency are major advantages.

Interop makes sense. And other platforms are adopting these. I hope we can land support in Node.js and tried to get that work started but it never really got its legs. (Reposted because I just woke up, am in bed still and it barely made sense when I re-read it lol)

For high scale/performant web servers though, might be a tough sell over more optimized APIs. But we need to also land those optimized approaches in Node.js before anyone will take that seriously.

AKA, node.js is really fast, fast enough for nearly all use cases, but could be faster. And so to split hairs on web streams/requests/etc vs @nodeland.devβ€˜s work, at this point is not widely understood.