Skip to content
Linus Ericsson edited this page Nov 2, 2015 · 13 revisions

Enlive N(ext)

Enlive N(ext) is live https://github.com/cgrand/enliven

Notes on the direction of Enlive. This is not a road map.

Transformations overhaul

Currently (Enlive <= 1.x), transformations are not first-order: they have to be put in a template/snippet with a selector.

I think all (or most) of those distinctions should go away: a transformation applies right there in the current context. If one wants to restrict its impact, she must use a HOF to create a new transformation.

An important piece of the previous sentence is current context. A template sits at the intersection of presentation and data. This is the context of a transformation.

(template (sample-for [:li] :items (content :name) (set-attr :id :id))

Misc.

  • Removes distinction between templates and snippets
    • Need to define a new seq type and a as-nodes function
    • Seq support is nearly mandatory for Ring
      • Or explicit call to a serialization fn?
    • snippets sub selection through :only option
  • New execution model for templates:
    • parallel execution of selectors
    • node selectors as a special case of fragment selectors
    • as soon as a selectors match, the matching fragment is plucked out (and saved with the state-machine state)
      • the remaining tree can be partially serialized
  • More options
    • parser, encoding, http client, serializer...
    • standard way to specify them
  • new state machine (shared with regex)
  • static CSS-in-string selectors
    • no dynamic support
      • dynamic only through [:traditional :selectors]