GithubHelp home page GithubHelp logo

dstulle / fritz2 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jwstegemann/fritz2

0.0 1.0 0.0 20.76 MB

Easily build reactive web-apps in Kotlin based on flows and coroutines.

Home Page: https://www.fritz2.dev

License: MIT License

Kotlin 85.04% HTML 0.07% CSS 0.26% JavaScript 1.17% Nunjucks 5.45% TypeScript 8.02%

fritz2's Introduction

fritz2

Actions Status Awesome Kotlin Badge Download IR Examples API Docs Slack chat

fritz2 is an extremely lightweight, well-performing, independent library for building reactive web apps in Kotlin, heavily depending on coroutines and flows.

fritz2 includes an intuitive way to build and render HTML elements using a type-safe dsl. You can easily create lightweight reactive HTML components which are bound to an underlying model and automatically change whenever the model data changes:

val model = storeOf("init value")

render {
    div("some-css-class") {
        input {
            value(model.data)
            changes.values() handledBy model.update 
        }
        p {
            +"model value = "
            model.data.renderText()
        }
    }
}

fritz2 implements precise data binding. This means that when parts of your data model change, exactly those and only those DOM-nodes depending on the changed parts will automatically change as well. No intermediate layer (like a virtual DOM) is needed. fritz2 requires no additional methods to decide which parts of your component have to be re-rendered. fritz2 also supports two-way data binding out-of-the-box to update your model by listening on events:

State management in fritz2

Utilizing Kotlin's multiplatform-abilities, you'll write the code of your data classes only once and use it on your client and server (i.e. in a SpringBoot- or Ktor-Backend). This is also true for your model-validation-code, which can quickly become far more complex than your data model.

Key Features

  • easy reactive one- and two-way data binding (even for lists and deep nested structures)
  • hassle-free state-handling
  • model-validation and message handling
  • http and websockets
  • hash-based routing
  • history / undo
  • processing state ("spinning wheel")
  • webcomponents
  • easy to learn
  • documentation
  • examples i.e. implementing the specification of TodoMVC

How to try it?

Overall Goals

  • staying lightweight
  • keeping dependencies as low as possible
  • providing tags, attributes, events for HTML from specification (w3c, mozilla, ...)
  • making it as easy as possible to write reactive web-apps in pure kotlin

Inspiration

fritz2 is hugely inspired by the great Binding.scala framework. Later we discovered that a lot of those concepts are described independently in Meiosis. Also, fritz2 relies heavily on the great Kotlin coroutines library.

Leave us a star...

If you like the idea of a lightweight pure Kotlin implementation for building reactive web-apps, please give us a star. Thank you!

fritz2's People

Contributors

jwstegemann avatar jamowei avatar oeffentliche avatar evabs avatar mkempa-np avatar lysander avatar cnconsult-neumann avatar henryb99 avatar westhuus avatar bfongank avatar petertiupe avatar metin-kale avatar haukesomm avatar jillesvangurp avatar hpehl avatar serras avatar tradejmark avatar dstulle avatar ersin-ertan avatar sebastianaigner avatar fritzmaster2 avatar realqdbp avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.