sciences.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
Non-profit, ad-free social media for social scientists. Join thousands of social scientists here and across the fediverse.

Administered by:

Server stats:

720
active users

#templates

0 posts0 participants0 posts today

New Kitten update

🥳 Kitten HTML templates and kitten.Component render functions can now be async.

kitten.small-web.org

This is quite a big one and it took me finally biting the bullet and getting my head around generators in JavaScript to implement properly.

So now you can mix synchronous and asynchronous components as you like and if there are any asynchronous components in your templates they will automatically be awaited (even if you forget to use await) ;)

I’ll write a proper post/tutorial/documentation for it soon but for the time being enjoy the screenshots where a layout template gets the latest three posts from my mock fediverse public timeline service and displays them on the page.

The kitten.Component version also has a refresh button that streams a different three to the page.

For those of you unfamiliar with Kitten, this is all the code in either example. No scaffolding, nothing. Pop either into a file called index.page.js and run kitten in that folder and visit https://localhost to see the example run.

Enjoy!

:kitten:💕

Starting a project often means juggling scattered emails, shared drives, and endless message threads. Keeping track of key information can be a challenge.

With XWiki’s Templates Application, your team can:
✔️ Create structured project spaces for key info
✔️ Standardize workflows to improve collaboration
✔️ Eliminate repetitive setup

Learn how templates can streamline your work: xwiki.com/en/Blog/how-to-creat

Continued thread

In 2023, two years after being built, the app was legacy. Couldn't upgrade the frontend.

Sure Svelte was less heavy than React. But why did the login page, as bare as it was, need JS anyway, let alone 100kB of it?

I took a week off my main project and did the app a favor: rewrite, but moving *out *of the "JS by default" paradigm.

I replaced the API routes with controller methods returning HTML rendered by Nunjucks #templates.

A third of the codebase disappeared!