←back to thread

151 points lilprince1218 | 2 comments | | HN request time: 0.399s | source

Hey HN,

I'm 13, from Nigeria, and I just released PrinceJS — the fastest web framework for Bun right now.

• 19,200 req/s (beats Hono/Elysia/Express) • 2.8 kB gzipped • Tree-shakable (cache, AI, email, cron, SSE, queue, test, static...) • Zero deps. Zero config.

Built in < 1 week. No team. Just me and Bun.

Try it: `bun add princejs` GitHub: https://github.com/MatthewTheCoder1218/princejs Docs: https://princejs.vercel.app

Brutal feedback welcome. What's missing?

– @Lil_Prince_1218

Show context
ricardobeat ◴[] No.45958734[source]
Nice work! Some notes:

1. File size is a commonly highlighted metric for JS frameworks because of network transfer cost on the client side. For node/bun/deno frameworks, it isn't very relevant, especially the gzipped size.

2. In the benchmark, the number for all frameworks is quite low - I get closer to 80-100k req/s with Bun on my 3-year old machine. Might be worth using a standard VM size in a cloud provider to make it more meaningful.

3. "Cron" scheduling doesn't seem to belong in the library. This won't be very useful for real-world use cases, as soon as you have >1 node running a server you'll need some form of coordination. More size reduction :)

replies(3): >>45958909 #>>45961787 #>>45961916 #
1. ricardobeat ◴[] No.45958909[source]
some more after reading the source:

- JWT needs to be validated, as it is, your implementation[1] happily accepts anything, you can impersonate anyone you want. I'd argue that it's a bad default choice too [2]

- baking-in resend.com as email provider is unlikely to be useful for most people

- x-forwarded-for [3] is only added by proxy servers, and will often not be present. This means you'll be applying a shared rate limit to most of your users

- the 'ai' helper is missing from the code. If this is vibe-coded, having tests for the examples will help keep it cohesive

Sorry if this is a lot, I hope it can help.

[1] https://github.com/MatthewTheCoder1218/princejs/blob/main/sr...

[2] https://paragonie.com/blog/2017/03/jwt-json-web-tokens-is-ba...

[3] https://github.com/MatthewTheCoder1218/princejs/blob/main/sr...

replies(1): >>45961796 #
2. lilprince1218 ◴[] No.45961796[source]
Ok thanks. The ai is missing cause I couldn't fully implement it and I didn't want it half baked so I just took it out.