Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

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

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages