[ANN] Miraj: functional, idiomatic Clojure web programming, including web components

206 views
Skip to first unread message

Gregg Reynolds

unread,
Jun 18, 2017, 2:29:40 PM6/18/17
to clo...@googlegroups.com
Hi folks,

The goal of the Miraj project is to  support web programming, including definition and use of web components (specifically Polymer 1.9.x in this version), in seamless and idiomatic Clojure.  It seems to be somewhere in the vicinity of Alpha, so I'm looking for feedback and help.

The homepage at https://miraj-project.github.io/ contains high-level docs and brief examples (and is implemented in Miraj).  I've also got a bunch of graded and commented demos at https://github.com/miraj-project/demos/tree/master/hello-world .  I would be grateful to anybody who gives them a whirl and provides feedback.

Very briefly, it contains a functional HTML library, supports bits of sugar (e.g. :#foo for id attributes, etc.), and provides macros for defining pages, components and component libraries, such that the shape of such code is similar to that of ordinary deftype or defrecord.  It tries to hide and automate as much low-level detail as possible (e.g. construction of the <head> element).

The code it generates could be used in production, but the libraries themselves should be considered alpha, since they depend on Clojure 1.9.0 alpha, and currently only Polymer version 1 is supported.  There are a few loose ends in the Polymer support that will only be tied off in version 2.

For help:  I've taken the liberty of creating a #miraj channel on Clojurians slack; I also monitor this list, #clojure, #clojurescript etc.

Thanks,

Gregg

Jiacai Liu

unread,
Jun 19, 2017, 2:38:16 AM6/19/17
to clo...@googlegroups.com
Cool.
One question: Is miraj compatible with https://github.com/weavejester/hiccup

--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Gregg Reynolds

unread,
Jun 19, 2017, 4:17:05 AM6/19/17
to clo...@googlegroups.com
On Mon, Jun 19, 2017 at 1:37 AM, Jiacai Liu <jiaca...@gmail.com> wrote:
Cool.
One question: Is miraj compatible with https://github.com/weavejester/hiccup ?

If you mean mixing Hiccup and Miraj source code, I doubt it, the approach is completely different.  I believe Hiccup translates Clojure data structures into HTML strings.  Miraj uses functions, one per HTML5 element (plus any custom ones), that evaluate to an XML DOM node (a Clojure record), which gets serialized at compile time.

If you want to use Miraj components from Hiccup, that should be easy, since Miraj generates HTML+CSS+Clojurescript.  I added dev and prod target dirs to one of the demos so you can see: https://github.com/miraj-project/demos/tree/master/hello-world/acme-widgets.   Look in the acme subdir of target-dev, target-prod.

HTH,

Gregg
Reply all
Reply to author
Forward
0 new messages