photog.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
A place for your photos and banter. Photog first is our motto Please refer to the site rules before posting.

Administered by:

Server stats:

267
active users

#websocket

0 posts0 participants0 posts today

New Kitten release 🎉

kitten.small-web.org

• New: Lovely new icons¹ and new callouts in Kitten Settings²

• New: Markdown now supports attributes and bracketed spans³

• New: client-side `kitten` global with `trigger` function for triggering events on the server from the client. (Useful when streaming client-side JavaScript when using Kitten’s Streaming HTML⁴ workflow. e.g., when you have to use a client-only web API like the Clipboard API but you want to keep all your logic on your server-side page.⁵)

• Fixed: The bound render function returned by `KittenComponent` class’s `component` getter now correctly awaits asynchronous templates. (In Kitten, you don’t have to care whether your templates contain promises. Kitten handles all that for you.)

Enjoy! :kitten:💕

¹ kitten.small-web.org/reference

² mastodon.ar.al/@aral/114381983

³ kitten.small-web.org/reference (also see mastodon.ar.al/@aral/114381462)

kitten.small-web.org/tutorials

⁵ e.g., See how I use this to implement a copy to clipboard button in the database page of Kitten’s Settings: codeberg.org/kitten/app/src/br Of course, you don’t have to use this and you can just write client-side JavaScript or use the built-in Alpine.js integration. e.g., how I do it on the (older) settings/identity page: codeberg.org/kitten/app/src/br

#Kitten#SmallWeb#web

New Kitten Release

• Automatic message routing: if the element that triggers an event on the client does not have a `name` attribute, Kitten now falls back to using its `id` instead to route the event to the correct server-side event handler on your live Kitten pages.

If neither attribute exists, Kitten will fail to route the message but no longer crash as it was due to a regression introduced when I implemented support for colons in element names.¹

kitten.small-web.org

For more details on Kitten’s live pages and automatic message routing, please see the Streaming HTML tutorial:

kitten.small-web.org/tutorials

Enjoy!

:kitten:💕

¹ A colon in an element name is ignored for message routing purposes, letting you, for example, give unique names to <details> elements, allowing more than one to be open at a time, while having their events be handled by the same handler.

New Kitten release

• Fixes issue with routes where dynamic routes with file names that had more than two extensions were not recognised as the correct type of route. e.g., A route called index.xml.get.js would previously have been treated as a static route instead of a dynamic GET route.

kitten.small-web.org

For more details, see the Valid File Types section of the Kitten reference¹ and the Dynamic Pages tutorial².

Enjoy!

:kitten:💕

¹ kitten.small-web.org/reference
² kitten.small-web.org/tutorials

New Kitten release

• You can now use key paths in the names of your client-side live components and these will automatically be transformed into object hierarchies on the server for you.¹

• Self heals zombie live pages (see Streaming HTML workflow²) if they return to life due to client-side browser cache.³

• Removes htmx⁴ headers from `data` property into separate `header` property in Kitten Page events and the data your Kitten Page message handlers receive.

• Automatically passes references to the live page object (if any) and the request and response objects to the layout templates of Markdown pages⁵ (so you can, for example, check if `request.session.authenticated`⁶ is true from the your layout template and customise the layout accordingly).

kitten.small-web.org

Enjoy!

:kitten:💕

¹ e.g., See codeberg.org/small-tech/site/s (markup) and codeberg.org/small-tech/site/s (handler) and codeberg.org/small-tech/site/s (model class method).

² See Streaming HTML tutorial: kitten.small-web.org/tutorials (There’s actually more to it now but I haven’t had a chance to document the new class-based and event-driven live page workflow yet. It’s experimental but working very well for me so far so I will do so shortly.)

³ When a person leaves a live/connected page (a page connected to its default web socket), we clean up and remove that live page from memory. However, browsers being what they are, cache the page on the client. If a person uses the back/forward buttons to return to the page, the browser will serve the cached source from memory, which has the old page ID, for the page that no longer exists in Kitten’s memory. So now we have a problem. The only way to recover from this is to tell the page to reload itself. So we accept the WebSocket connection, send a command to the page for it to reload itself, and then close the socket. That makes the stale page self heal by replacing itself with a fresh one. Yay, go us!

⁴ HTMX: htmx.org

⁵ Kitten Markdown pages reference: kitten.small-web.org/reference

⁶ See Session tutorial: kitten.small-web.org/tutorials

New Kitten¹ update

Experimental:

• Adds `data` property to Kitten components

• Adds swap target to `page.send` so you can have an element added before, after, as first child of, or as last child of another (this is syntactic sugar over htmx and works around some of the complexities with out-of-band swaps in htmx, especially when streaming table rows to tables).

Also, check out the latest live page and page events state view in Kitten’s Settings (every Kitten app has this settings view).

vimeo.com/1050348456

¹ kitten.small-web.org

#Kitten#SmallWeb#OOP
Continued thread

So last night, while recording the preview of Kitten’s¹ improved component model², I made a silly mistake (copying raw HTML into a JavaScript function instead of wrapping it in a kitten.html`` tagged template, easy to do when you’re refactoring to pull out components from pages).

Then, once I figured out what I’d done, I made another one by forgetting to return the value from the function (easy to do when you’re used to using one-line closures as render functions).

I would have caught both of those so much faster if Kitten had helpful error messages for those two pitfalls. And guess what, this morning, it does :)

Attached are screenshot showing the before and after error messages.

Enjoy!

:kitten:💕

¹ kitten.small-web.org
² Scroll up the thread to watch the video.

Continued thread

Little preview video: Kitten’s improved component model

• Class-based page routes and components
• Object-oriented
• Event-based
• Seamless hypermedia-driven WebSocket-based event mapping and interface updates (Streaming HTML)
• A light server-side live component hierarchy with event bubbling
• Almost as if you’re building a desktop or mobile app instead of a web app…

… another authoring simplification made possible because on the Small Web – which is a peer-to-peer web – you build a web app/site as a tool for one person (the owner of the site/app) instead of as a tool for you to farm millions of people.

… still experimental ;)

vimeo.com/1049055406

Learn more about Kitten:

kitten.small-web.org

If you like what you see and want us to keep existing, we could definitely use your support:

small-tech.org/fund-us/

:kitten:💕

Replied in thread

@lumen Hey, thanks so much :)

The main two apps that will initially be using it are Place (codeberg.org/place/app) and Domain (codeberg.org/domain/app) — both under heavy development at the moment.

There are some mini apps I made that you can play, each with their own tutorial.

• Draw Together (draw-together.small-web.org; tutorial: kitten.small-web.org/tutorials)
• Kitten Kawaii (kitten-kawaii.small-web.org/ch, write up: ar.al/2024/08/19/kitten-kawaii)
• Streamiverse¹ (streamiverse.small-web.org, tutorial: kitten.small-web.org/tutorials)

And you can find a host of little examples in the codebase:

codeberg.org/kitten/app/src/br

Hope that helps. Until the Small Web stuff is publicly released I don’t really foresee a lot of folks using it. Although I know a few people are playing with it.

¹ Just noticed I need to improve it so it recaches profile images if they’ve changed. Noticed a couple of broken ones.

Codeberg.orgappPlace: a Small Web social network. (A peer-to-peer Web/personal web social network.)
Continued thread

New Kitten release 🥳

• Live events view in /💕/settings/state/pages
• Fix automatic event handler binding

kitten.small-web.org

I’ve also updated the Kitten Count example in the Streaming HTML tutorial to use the new, simpler, event handler syntax in the improved (and experimental) Kitten component model. There’s more to the latter (e.g., class-based routes) that’s not documented yet but will be soon.

kitten.small-web.org/tutorials

Enjoy!

:kitten:💕

Kitten¹ update

I just added a new htmx header to #WebSocket messages in Kitten that contains the actual event type (name) that triggered the message.

This is useful, for example, if your trigger is a horizontal swipe and you need to differentiate between whether it was a swipe left or a swipe right that caused it.

Upstream issue: github.com/bigskysoftware/htmx

Upstream merge request: github.com/aral/htmx-extension

Enjoy!

:kitten: 💕

¹ kitten.small-web.org

GitHub[ws] [ECR] Ability to differentiate response based on triggering event · Issue #74 · bigskysoftware/htmx-extensionsBy aral

Neue Zeile in der Messenger-Matrix ergänzt: »Unterstützte Push-Benachrichtigungsdienste«. Ich habe nicht zu jedem Messenger ausreichend Informationen gefunden, daher wäre es lieb ❤️ , wenn ihr dazu Feedback abgebt. Korrekturen nehme ich gerne vor. 👇

messenger-matrix.de/messenger-

www.messenger-matrix.deMessenger-Matrix • Kuketz IT-Security BlogMessenger: Vergleich sicherheits- und datenschutzrelevanter Eigenschaften von Messengern
#push#google#apple

Nach gut drei Wochen Test kann ich sagen: Die #UnifiedPush Version von #Molly (Signal Fork) funktioniert prima. Eine Benachrichtigung über neue Nachrichten erfolgt via #ntfy. Fazit: Akku-Verbrauch ist (deutlich) geringer als mit #WebSocket bei Signal. Insbesondere im Mobilfunknetz. Allerdings muss jeder selbst entscheiden, ob er einen Fork nutzen möchte.

#signal #molly #ntfy #unifiedpush #messenger #fork

github.com/mollyim/mollyim-and

GitHubGitHub - mollyim/mollyim-android-unifiedpush: Molly with UnifiedPush support.Molly with UnifiedPush support. Contribute to mollyim/mollyim-android-unifiedpush development by creating an account on GitHub.
Continued thread

I’ve also updated the readme with instructions on how to run Draw Together yourself (you could have it up and running locally in under a minute by installing Kitten, cloning the repository, and running the kitten command) and links to where you can learn more about the Streaming HTML magic in Kitten that means that the whole app is ~60 lines of code :)

codeberg.org/aral/draw-togethe

Codeberg.orgdraw-togetherA very simple Kitten toy in ~60 lines of code for drawing together on a 20×20 grid.