Hello again my little Stardancers ✨
inkan 0.8.0 is out. This one is less about new tricks and more about making inkan something you can actually build on without it shifting under you.
The big one: the API is stable now. Every function is marked either stable or experimental. Stable stuff won’t just change or disappear anymore. If I rename something, the old name keeps working with a warning for at least two versions and six months. Before freezing it I had the whole API reviewed and cleaned up the things I would have regretted later, like time options that were seconds in one place and milliseconds in another, or two different names for the same origin setting. There’s also a test now that fails the moment the public types change by accident.
Then storage. Until now every feature kept its own little store in memory, so jobs and logins only worked in one process. Now there’s one Store in the core, and four new packages that plug into it: redis, postgres, mongo and mysql. You pass in your own database client, so none of them add a dependency. With one of those, jobs, sessions, logins and rate limits work across several processes and servers. Each adapter has to pass the same test suite, and they’re all tested against real database servers, not fakes. They also got a security review. That found a few real things, like a way to inject SQL into MySQL under unusual server settings, and that my login protection had become weaker than before. All fixed.
Smaller stuff:
- React hooks for live data in @inkanjs/query, so you can show job progress or websocket messages with one hook
- websockets now also run on uWebSockets.js
- async handlers got faster and are now as fast as plain node:http on the benchmark
- a fix where the dev inspector could be reached when it shouldn’t
About speed, honestly: on the GitHub runner inkan scored 91.0 and Fastify 89.9. inkan was ahead in two runs and level in the third, so I’m calling it level to slightly ahead, not faster. At first 0.8 even looked slower than 0.7, so I measured the CPU time per request separately, and it’s exactly the same as 0.7. The difference was the test machine moving around.
One bug I only found during the release: on Node 22 a websocket that gets refused never tells you, it just waits forever. That’s fixed in 0.8.1.
Next: I want to make writing adapters for other servers easier, and I still want someone from Fastify and Hono to look at my benchmark code.
See you next time ✨