Right, thanks to your feedback, this is what the “hello, world” would look like in htmx versus the equiavelent of what I have now in Svelte.

But there’s one big drawback to htmx… no ES modules and thus no components. That’s a biggie.

🤔

Show thread

Question to JavaScript folks who have experience with Node.js… how does the following (theoretical) code listing for a server-side route that renders an index page with a count that’s persisted in memory on the server and updated any time someone loads the page read to you?

Show thread

Just moved NodeKit over to @codeberg from G****b.

Old: github.com/small-tech/nodekit

New: codeberg.org/nodekit/app

Will be moving all my other currently active projects over as well in the coming days.

Bun (a new JS runtime ala Node.js and Deno) sounds interesting. Not least of all because it doesn’t use V8.

(I can’t use it for NodeKit at the moment as it doesn’t support custom ESM loaders but I’ll be keeping an eye on it.)

bun.sh/

Node’s built-in error reporting leaves a lot to be desired so I just spent some time improving the error output for NodeScript runtime errors in Nodekit (github.com/small-tech/nodekit#)

Phew, finally merged my “major refactor” NodeKit branch into main. The previous main branch is now archived in the prototype branch.

Only production mode is functional right now but it’s a maintainable codebase (not like the jumble the prototype was as I was working to get things working for the first time).

Also: So. Little. Code. 😍

Now to add more tests and the development mode server functionality as I go.

Yay, progress! :awesome:👍

github.com/small-tech/nodekit/

Yay! WebSocket routes (and the simple chat example) are working again too :)

Show thread

w00t, just got the major refactor branch of NodeKit (github.com/small-tech/nodekit) running the Hello Count example for the first time.

Been refactoring the hell out of NodeKit recently to take it from prototype to maintainable app.

Nice to have a little win.

Now to find all the other things that are no doubt broken :)

Yesterday’s NodeKit demo made me realise how much I want some sort of hot module reloading in NodeKit sooner rather than later. So, first step, you gotta map your dependencies… ;)

✅ Step 1

And when I say ALL the code, I mean ALL the code. That’s the only file in the project.

You run the project by running NodeKit:

nodekit

That’s it. No build stage, no configuration, nothing.

Show thread

This is ALL the code you need in NodeKit to create a server-side rendered STREAMING view of your Mastodon public timeline.

Join us at 5PM UTC today to see me recreate this live on Small Is Beautiful.

owncast.small-web.org

And when I say ALL the code, I mean ALL the code. That’s the only file in the project.

You run the project by running NodeKit:

nodekit

That’s it. No build stage, no configuration, nothing.

By the way, when I say that’s all the code. I mean that’s ALL the code in the whole project:

github.com/small-tech/nodekit/

Run `nodekit` on that folder, get the result in the browser.

No scaffolding. No configuration. No bundlers.

Show thread

So I just got this running. This is all the code you need to display a basic fediverse public timeline using NodeKit right now.

(If you remove the CSS, that’s 31 lines. That’s it. That’s the WHOLE APP!) :)

First rule of creating something simple for others: you need to take the complexity hit yourself. *returns to rummaging through the internals of V8 virtual machines and Node ESM Loaders…*

Node’s (experimental) VM Module functionality is awesome. Just rewrote the NodeScript feature in NodeKit to use it (and replace my initial “write to file system and import” hack).

What’s NodeKit?

ar.al/2022/01/26/nodekit-updat

By the way, sorry, I keep writing small-web in the GitHub URL instead of small-tech.

The working link for the NodeKit repository is:

github.com/small-tech/nodekit

Show thread
Show older