MyNixOS website logo
Description

A reactive frontend web framework.

A reactive frontend web framework. See haskell-front.org for more details.

front (work-in-progress)

A front-end web framework which aim is to bring the power of GHC on client side with as less JavaScript as possible by the Fay.

The goal is to have a tiny websockets-based bridge between client and server to propagate client events on server for further handling.

Features

  • Server-side rendering.
  • both SPA and regular webapp (sharing state across multiple routes).
  • Several communication models (single session, broadcast, etc.).
  • Virtual DOM with full/partial rendering.
  • "blaze-html" like extended markup tree for handling both DOM and JS events.

Usage

  1. Add front as a dependency to your project using preferred build tool.
  2. Obtain bundle.js by
curl https://raw.githubusercontent.com/swamp-agr/front/master/examples/todo/static/bundle.js

and include it as static resource in your application server.

  1. Import Shared module.
  2. Choose proper communication model (Only session, Broadcast, etc.).
  3. That's it.
  4. The only thing you need to keep in mind that one of records in your types should have name commandValue!

Examples

  • TODO

    • Installation with Stack (servant-auth-cookie should be fixed to allow build with cabal):
    stack install --flag="front:examples"
    

    or

    cabal v2-build --flags examples
    
    • usage:
    cd examples/todo
    # for servant-based:
    todo-servant-example
    # for yesod-based:
    todo-yesod-example
    # open web browser:
    open http://localhost:3000
    

Developer Installation (Contribution)

For server:

cabal new-build

or

stack build

For client: there is nothing special you need on client side. bundle.js already had everything included.

Please do not hesitate to open Issue to discuss your questions or use cases.

Acknowledgement

This ongoing framework would not have happened without these people and technologies:

  • @5HT for inspiration by N2O framework. The idea of transfer both data and events over websockets.
  • @jaspervdj for blaze-html.
  • @meiersi for blaze-react and the approach how to handle events in the same markup with html.
  • @snoyberg for yesod-fay and the way how to embed generated assert into server and to trigger dependent Fay compilation from Haskell code.
  • @bergmark for Fay compiler.
Metadata

Version

0.0.0.8

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows