All Projects → alexmingoia → Purescript Pux

alexmingoia / Purescript Pux

Licence: other
Build type-safe web apps with PureScript.

Programming Languages

purescript
368 projects

Projects that are alternatives of or similar to Purescript Pux

whistle
Experiment to build single page apps in Elixir
Stars: ✭ 52 (-90.75%)
Mutual labels:  elm-architecture, web-framework
Bubbles
TUI components for Bubble Tea 🍡
Stars: ✭ 467 (-16.9%)
Mutual labels:  elm-architecture
Shiro
Apache Shiro
Stars: ✭ 3,685 (+555.69%)
Mutual labels:  web-framework
Reframe
A new kind of web framework.
Stars: ✭ 429 (-23.67%)
Mutual labels:  web-framework
Gramework
Fast and Reliable Golang Web Framework
Stars: ✭ 354 (-37.01%)
Mutual labels:  web-framework
Learn Redux
💥 Comprehensive Notes for Learning (how to use) Redux to manage state in your Web/Mobile (React.js) Apps.
Stars: ✭ 442 (-21.35%)
Mutual labels:  elm-architecture
Centurion
Centurion is a web-based framework for rapid prototyping and building larger web projects.
Stars: ✭ 327 (-41.81%)
Mutual labels:  web-framework
Prism
React / Redux action composition made simple http://salsita.github.io/prism/
Stars: ✭ 499 (-11.21%)
Mutual labels:  elm-architecture
Iris
The fastest HTTP/2 Go Web Framework. AWS Lambda, gRPC, MVC, Unique Router, Websockets, Sessions, Test suite, Dependency Injection and more. A true successor of expressjs and laravel | 谢谢 https://github.com/kataras/iris/issues/1329 |
Stars: ✭ 21,587 (+3741.1%)
Mutual labels:  web-framework
Bocadillo
(UNMAINTAINED) Fast, scalable and real-time capable web APIs for everyone
Stars: ✭ 401 (-28.65%)
Mutual labels:  web-framework
Farrow
Farrow is a progressive, incrementally-adoptable TypeScript framework for full stack development.
Stars: ✭ 384 (-31.67%)
Mutual labels:  web-framework
Pyramid
Pyramid - A Python web framework
Stars: ✭ 3,615 (+543.24%)
Mutual labels:  web-framework
Bubbletea
A powerful little TUI framework 🏗
Stars: ✭ 7,886 (+1303.2%)
Mutual labels:  elm-architecture
Leptus
The Erlang REST framework
Stars: ✭ 352 (-37.37%)
Mutual labels:  web-framework
Zkweb
A flexible web framework supports .Net Framework and .Net Core
Stars: ✭ 475 (-15.48%)
Mutual labels:  web-framework
Joy
A full stack web framework written in janet
Stars: ✭ 327 (-41.81%)
Mutual labels:  web-framework
Echo
High performance, minimalist Go web framework
Stars: ✭ 21,297 (+3689.5%)
Mutual labels:  web-framework
Learn Elm
🌈 discover the beautiful programming language that makes front-end web apps a joy to build and maintain!
Stars: ✭ 432 (-23.13%)
Mutual labels:  elm-architecture
Javalin
A simple and modern Java and Kotlin web framework
Stars: ✭ 5,184 (+822.42%)
Mutual labels:  web-framework
Lessgo
Lessgo 是一款简单、稳定、高效、灵活的 golang web 开发框架,支持动态路由、自动化API测试文档、热编译、热更新等,实现前后端分离、系统与业务分离,完美兼容MVC与MVVC等多种开发模式,非常利于企业级应用与API接口的开发。[A simple, stable, efficient and flexible web framework.]
Stars: ✭ 481 (-14.41%)
Mutual labels:  web-framework

PUX

Build type-safe web applications with PureScript.

Documentation | Examples | Chat

Latest Release ComVer Build Status Gitter Chat

Pux is a PureScript library for building web applications. Interactive UI is modeled as a single state transition function, Event -> State -> (State, HTML) which is run for every event. Pux also provides tooling such as:

  • Isomorphic routing and rendering
  • Hot reloading
  • Render to React (or any virtual DOM library)
  • Time-travelling debug extension

Quick start

The starter app provides everything you need to get started:

git clone git://github.com/alexmingoia/pux-starter-app.git my-awesome-pux-app
cd my-awesome-pux-app
npm install
npm start

Example

The following chunk of code sets up a basic counter that can be incremented and decremented:

module Main where

import Prelude hiding (div)
import Control.Monad.Eff (Eff)
import Pux (CoreEffects, EffModel, start)
import Pux.DOM.Events (onClick)
import Pux.DOM.HTML (HTML)
import Pux.Renderer.React (renderToDOM)
import Text.Smolder.HTML (button, div, span)
import Text.Smolder.Markup (text, (#!))

data Event = Increment | Decrement

type State = Int

-- | Return a new state (and effects) from each event
foldp :: ∀ fx. Event -> State -> EffModel State Event fx
foldp Increment n = { state: n + 1, effects: [] }
foldp Decrement n = { state: n - 1, effects: [] }

-- | Return markup from the state
view :: State -> HTML Event
view count =
  div do
    button #! onClick (const Increment) $ text "Increment"
    span $ text (show count)
    button #! onClick (const Decrement) $ text "Decrement"

-- | Start and render the app
main :: ∀ fx. Eff (CoreEffects fx) Unit
main = do
  app <- start
    { initialState: 0
    , view
    , foldp
    , inputs: []
    }

  renderToDOM "#app" app.markup app.input

Benchmarks

Table of benchmarks comparing rendering speed of similar libraries

Why is Pux slow?

Pux has not focused on performance yet. The slow performance arises from translating Pux's (smolder) virtual DOM to React's virtual DOM. The goal is to write a purescript virtual DOM module for smolder, which would avoid that translation step and could be optimized for a monadic datastructure. I suspect this would achieve performance on par with Halogen.

Below are the render steps for the other libraries compared, which shows that Pux is the only one that has an intermediate virtual DOM representation (it has to render to React first then React has to render):

  • Elm = Virtual DOM -> DOM patch
  • React = Virtual DOM -> DOM patch
  • Thermite = Virtual DOM -> DOM patch
  • Halogen = Virtual DOM -> DOM patch
  • Pux = Smolder Markup -> React Virtual DOM -> DOM patch
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].