GNU social JP
  • FAQ
  • Login
GNU social JPは日本のGNU socialサーバーです。
Usage/ToS/admin/test/Pleroma FE
  • Public

    • Public
    • Network
    • Groups
    • Featured
    • Popular
    • People

Untitled attachment

Download link

Notices where this attachment appears

  1. Embed this notice
    Aral Balkan (aral@mastodon.ar.al)'s status on Tuesday, 04-Mar-2025 02:59:36 JST Aral Balkan Aral Balkan

    While working on porting the Small Technology Foundation web site¹ to Kitten², I took the opportunity to pull out base Model and Collection classes that I’ll likely end up including in Kitten proper:

    • Model: https://codeberg.org/small-tech/site/src/branch/kitten/app_modules/database/Model.js
    • Collection: https://codeberg.org/small-tech/site/src/branch/kitten/app_modules/database/Collection.js

    To see them in use, here’s the base Posts class (with RSS generation) that extends Collection:
    https://codeberg.org/small-tech/site/src/branch/kitten/app_modules/database/Posts.js

    And here’s the concrete EventPosts collection class that extends Posts:
    https://codeberg.org/small-tech/site/src/branch/kitten/app_modules/database/EventPosts.js

    And the EventPost (showing an implementation of a calculated property):
    https://codeberg.org/small-tech/site/src/branch/kitten/app_modules/database/EventPost.js

    So all this is possible (persisting and reading back typed model collections, etc.) thanks to JSDB¹ (JavaScript database), a zero-dependency, transparent, in-memory, streaming write-on-update JavaScript database I wrote for the Small Web that persists to a JavaScript transaction log and is included as as first-class citizen in Kitten.

    https://codeberg.org/small-tech/jsdb

    PS. For a much gentler introduction to persistence in Kitten, see the Kitten Persistence tutorial:
    https://kitten.small-web.org/tutorials/persistence/

    Enjoy! :kitten:💕

    ¹ https://small-tech.org
    ² https://kitten.small-web.org

    #Kitten #SmallWeb #SmallTech #JavaScript #database #JSDB #typeSafety #JSDoc #closureCompiler #TypeScript #workInProgress

    In conversation about 2 months ago from mastodon.ar.al permalink
  • Help
  • About
  • FAQ
  • TOS
  • Privacy
  • Source
  • Version
  • Contact

GNU social JP is a social network, courtesy of GNU social JP管理人. It runs on GNU social, version 2.0.2-dev, available under the GNU Affero General Public License.

Creative Commons Attribution 3.0 All GNU social JP content and data are available under the Creative Commons Attribution 3.0 license.