New Kitten update
The latest Kitten has experimental support for class-based routes (you subclass `kitten.Page`) and introduces the simpler event handler syntax and server-side event bubbling mentioned in the thread above. (A `kitten.Page` is a specialised `kitten.Component` and you can compose your pages by combining `kitten.Component` instances.)
This release coincides with version 4.0.4 of @small-web/kitten¹, Kitten’s type safety module², which I’ve also updated to reflect that latest changes (and added a bunch of missing type information I discovered in the process).
Note: this is a courtesy message in case you noticed the new update. None of this has been properly documented yet so I’ll make a proper announcement once it is (I have a lot of new reference material, examples, and a tutorials to write and there will be a new video demonstrating all this soon.)
This is meant to be a backwards-compatible change. All your existing closure-based³, function-based⁴, and Streaming HTML⁵ routes/event handlers should work as before so if you notice any regressions in your existing projects, please let me know⁶ (yes, the two of you using Kitten currently). The only thing you should notice is that using `on('eventName', eventHandler)` to add event handlers for page events is now deprecated and you will get a warning to that effect in the console. Going forward, you can use the spiffy new `onEventName`-style event handlers (either by exporting them from your page route if using function-based routes or by implementing them methods on your `kitten.Page` subclass if using the new page-based routes).
So, basically, you can ignore this for now but if you want to dig into the code⁷ and play with the new stuff, go ahead. Note, however, that there will likely be breaking changes to the new/experimental functionality in the coming days as I put it through its paces.
More to come, watch this space…
:kitten: 💕
¹ https://codeberg.org/kitten/globals/
² https://kitten.small-web.org/tutorials/type-safety/
³ e.g., as seen in https://kitten.small-web.org/tutorials/dynamic-pages/
⁴ e.g., as seen in https://kitten.small-web.org/tutorials/sessions/
⁵ https://kitten.small-web.org/tutorials/streaming-html/
⁶ Open an issue at https://codeberg.org/kitten/app/issues (or just ping me here)
⁷ A good place to start: https://codeberg.org/kitten/app/src/branch/main/src/lib/KittenPage.js
076萌SNS is a social network, courtesy of 076. It runs on GNU social, version 2.0.2-beta0, available under the GNU Affero General Public License.
All 076萌SNS content and data are available under the Creative Commons Attribution 3.0 license.