Shpadoinkle-backend-snabbdom: Use the high-performance Snabbdom virtual dom library written in JavaScript.

[ bsd3, library, web ] [ Propose Tags ]

Snabbdom is a battle-tested virtual DOM library for JavaScript. It's extremely fast, lean, and modular. Snabbdom's design makes Snabbdom a natural choice for a Shpadoinkle rendering backend, as it has a similar core philosophy of "just don't do much" and is friendly to purely functional binding.


[Skip to Readme]

Modules

[Last Documentation]

  • Shpadoinkle
    • Backend
      • Shpadoinkle.Backend.Snabbdom

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0.0, 0.1.0.1, 0.2.0.0, 0.3.0.0, 0.3.0.1, 0.3.0.2
Dependencies base (>=4.12.0 && <4.16), containers, exceptions, file-embed (>=0.0.11 && <0.1), ghcjs-dom (>=0.9.4 && <0.20), jsaddle (>=0.9.7 && <0.20), monad-control, mtl (>=2.2.2 && <2.3), Shpadoinkle, text (>=1.2.3 && <1.3), transformers-base, unliftio (>=0.2.12 && <0.3) [details]
License BSD-3-Clause
Author Isaac Shapira
Maintainer isaac.shapira@platonic.systems
Category Web
Source repo head: git clone https://gitlab.com/platonic/shpadoinkle.git
Uploaded by fresheyeball at 2021-06-02T17:58:39Z
Distributions
Downloads 870 total (14 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs not available [build log]
All reported builds failed as of 2021-06-03 [all 2 reports]

Readme for Shpadoinkle-backend-snabbdom-0.3.0.2

[back to package description]

Shpadoinkle Backend Snabbdom

Goldwater Haddock BSD-3 built with nix Hackage Hackage Deps Hackage CI

This package contains a script to setup the Snabbdom virtual dom library as a backend to render Shpadoinkle applications.

Snabbdom consists of an extremely simple, performant, and extensible core that is only ≈ 200 SLOC. It offers a modular architecture with rich functionality for extensions through custom modules. To keep the core simple, all non-essential functionality is delegated to modules.

These design decisions made Snabbdom a good fit for Shpadoinkle's first high-performance pure JavaScript backend. Right now Snabbdom is being provided statically, and a slightly modified build is included in this repo. Although this increases the size of the resulting executable, it's necessary for reproducible and stable builds.

Building

In order to re-build Shpadoinkle/Backend/Snabbdom/Setup.js, it needs to be bundled with a tool like parcel - the following methodology is how it's currently done:

# clone outside the source directory of Shpadoinkl
git clone git@github.com:snabbdom/snabbdom.git
# compile its typescript so we can bundle the javascript
cd snabbdom && npm install && npm run compile
# Setup_src.js imports the snabbdom sources locally, so we need to manually move it
cp path-to-shpadoinkle/backends/snabbdom/Shpadoinkle/Backend/Snabbdom/Setup_src.js build/package/
# nix is most reliable for running parcel
nix-shell -p nodePackages.parcel-bundler --command "parcel build build/package/Setup_src.js"
# copy the bundled output as Setup.js
cp dist/Setup_src.js path-to-shpadoinkle/backends/snabbdom/Shpadoinkle/Backend/Snabbdom/Setup.js

Now when you build your shpadoinkle project, this new Setup.js will be statically allocated with your GHCJS output.