As a fun little exercise, I decided to port Miuki Miu’s (Elizabet Oliveira’s) adorable React Kawaii¹ to Kitten².
Going to write a blog post about the experience but, in the meanwhile, if you want to play with the cute little characters, here you go:
https://kitten-kawaii.small-web.org
And here’s the source code:
https://codeberg.org/aral/kitten-kawaii/
Things to try: the back and forward buttons ;)
¹ https://react-kawaii.vercel.app
² https://kitten.small-web.org
Following the data scope bug I fixed yesterday, I just added a new feature to Kitten to make this sort of bug more difficult to introduce into your apps.
Introducing: page storage (server-side, ephemeral page-scoped data).
This is available only for the Streaming HTML workflow and the scope is shared between your page route and on your onConnect() handler. It’s great if you want state per page instead of per session, etc.
New data scopes docs: https://kitten.small-web.org/reference/#data-scopes
You should now get per-page state for the Kitten Kawaii example:
https://kitten-kawaii.small-web.org
See diff with the session-based fix I implemented yesterday:
https://codeberg.org/aral/kitten-kawaii/commit/211ce86ab5d77fba0b511a4640d54f54a4629dc8
For more information on Kitten’s Streaming HTML workflow, see this tutorial:
https://kitten.small-web.org/tutorials/streaming-html/
PS. I also improved the handling of dynamically-added HTML attributes in Kitten’s HTML parser in the process.
Enjoy!