Skip to content
cgrand edited this page Nov 16, 2012 · 13 revisions

Enlive N(ext)

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

  • 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: "plucking"
    • parallel execution of 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
  • move away from TagSoup (better html 5 support)
  • new state machine (shared with regex)
  • static CSS-in-string selectors
    • no dynamic support
      • dynamic only through [:traditional :selectors]
  • hiccup-like helper
  • new macro to replace template/snippet
    • ternary rhythm (selector op data)
    • extensible (net.cgrand.xmacros)
    • paves the way for Clojurescript

Sample

(deftemplate name resource 
  docstring? 
  :opt1 XXX :opt2 YYY
  ([args]
    sel1 op1 data1
    sel2 op2 data2)
  other arities)