Kitten update: session IDs now available in the request.session objects you get in your routes.
Kitten lets you persist arbitrary data in session objects to make it easy to work with sessions but you cannot store custom objects (instances of custom classes) as Kitten’s default database is not aware of custom classes in your application. Now, keyed to the session id, you can store custom objects in your app’s own database.
(The use case for this is pretty neat: keep your interface state in custom state class instances persisted in session objects and, using the Streaming HTML workflow*, send back pieces of the interface that take those state objects as their only prop. Quite a neat separation of concerns and state is maintained only on the server in those objects.)
My pure JavaScript module (no mkcert, certutil, etc., required) that automatically provisions and installs locally-trusted TLS certificates for Node.js https servers.
(There seems to be an issue with tests failing on macOS, will debug that tomorrow and likely post a patch release.)
Quick update: the failing tests were apparently because I had my VPN on on macOS (that was creating an additional IPv4 interface that was getting picked up by the tests that check that your server is accessible via a valid TLS certificate from all available local IPs).
Let me show you how easy it is to create a simple counter web app using the new Streaming HTML workflow in Kitten before peeling away the magic layer by layer so you learn how to make the same app using:
• HTMX & WebSockets
• Plain old JavaScript, and, finally,
• Without Kitten in pure Node.js.
Handlebars.js is the worst templating language in existence, but, if you have to use it, and need some sort of "global" value in your templates, e.g., a csrf_token, then you can use this:
You can now create HTML and CSS fragments in Kitten.
This introduces two new file extensions (.fragment.html and .fragment.css) and you can import these fragments into your pages and into other components and fragments as if they were JavaScript modules*.
[Screenshot of terminal window showing hx (Helix Editor) with two panes. Left pane, selected, shows source of Markup.fragment.html: I’m some HTML from Markup.fragment.html.
${SLOT} I’m some other HTML Markup.fragment.html.
${SLOT.other} I’m yet more HTML Markup.fragment.html.
Been using Volta for a long time now to manage my #nodejs setup, but been slowly feeling like it's being made redundant with Corepack becoming more mature.
I switched to Mise for a few weeks and found a few interesting things 😀
Especially the part where you can just publish your TypeScript package without transpilation, and they handle #NodeJS /NPM compatibility is pretty big for IMO.
My team at Wolt is looking for a staff+ engineer proficient in either #Python or #Nodejs.
The position is fully remote as long as you live in or willing to relocate to Stockholm, Berlin, or Helsinki. If you know someone who might be a great fit, I’d love to have a chat.
I'm working on a JS script that lets you manage packages on Linux (and maybe also Windows) from #NodeJS, as part of Zentrox. I'll see how it goes. If it works fine, I'll try to make it a small library.
I have been trying to get the Lume static site generator to run inside a #Dropserver sandbox, but I have been running into all kinds of issues: some modules written for #NodeJS assume they have read permissions for the entire disk, and error out when you run them with restrictive permissions. Any project that uses #PostCSS + #autoprefixer (ie most build systems) will hit this.