Skip to content

Ring utility to enable progressive html rendering by streaming Hiccup forms.

License

Notifications You must be signed in to change notification settings

protocol55/fragment

Repository files navigation

Fragment

Ring utility to enable progressive html rendering using Hiccup forms.

What is Progressive HTML Rendering?

See the following links:

Installation

deps.edn

protocol55/protocol55.fragment {:git/url "https://github.com/protocol55/fragment.git"
                                :sha "d9d499ae057927aa65f8512f3225a0e794f15b83"}}

Usage with Ring

{:headers {"Content-Type" "text/html"}
 :status 200
 :body (protocol55.fragment.core/fragmentized-input-stream
        [:html
         ^:flush?
         [:head
          [:link {:src "..."}]]
         [:body
          ^:flush?
          [:div.above-the-fold
           [:p "..."]]
          (repeat 10000 [:div "..."])]])}

The above ring response streams the Hiccup form, flushing after forms with :flush? metadata.

About

Ring utility to enable progressive html rendering by streaming Hiccup forms.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published