This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-02-24
Channels
- # babashka (6)
- # beginners (11)
- # calva (4)
- # clojure (12)
- # clojure-madison (2)
- # clojure-norway (25)
- # clojure-spec (8)
- # clojure-sweden (1)
- # clojurescript (17)
- # datalevin (1)
- # datomic (8)
- # events (5)
- # ghostwheel (1)
- # hyperfiddle (16)
- # off-topic (16)
- # pedestal (1)
- # reagent (6)
- # reitit (1)
- # releases (3)
- # scittle (1)
- # shadow-cljs (5)
- # specter (2)
- # squint (4)
I'm attempting to create declarative @tanstack/query-core adapter for reagent state. (Like atom, reaction, etc...) Can you recommend any other similar attempts or posting?
here is my prototype example.
(def health-reaction
(reaction-query-req (fn [] {:query-key ["health"]
:endpoint "/health"})))
(def derived-key-health-reaction
(reaction-query-req (fn [] {:query-key ["health" @key-atom]
:endpoint "/health"
:enabled (= (:status @health-reaction) :success)})))
(def length-reaction
(ratom/make-reaction #(count (@health-reaction :data))))
(defn app
[]
(let [{:keys [data status loading?] :as result} @health-reaction]
(prn result)
[:div.v-stack {}
[:li (str ":data " data)]
[:li (str ":status " status)]
[:li (str ":loading? " loading?)]
[:li (str "derived track " @length-reaction)]
[:li (str "derived key status " (@derived-key-health-reaction :status))]
[:br]]))
It is just a subscription to server resource. Unsubscribe :on-dispose.
Does anyone know how to use the following library from clojure or clojurescript? https://github.com/alvarcarto/url-to-pdf-api?tab=readme-ov-file#development I have CSS/HTML that I need to render into PDF files (without going the LaTEX route via pandoc)..
Are you required to use that project in particular or are you open to alternative solutions?
Only requirement is to be able to render nice looking CSS/HTML to pdf programatically from a docker container
In that case, Etaoin might serve you well. It has a print-page function that lets you use a headless browser to render the page to a PDF. https://cljdoc.org/d/etaoin/etaoin/1.0.40/doc/readme https://cljdoc.org/d/etaoin/etaoin/1.0.40/doc/user-guide#_print_page_to_pdf
sounds great, thank-you I will take a look. I also found a clj-pdf library to investigate
unless you want to interface with some C library directly you'll have to use a headless browser for PDF rendering sadly. i ended up going with calling into puppeteer (which should be possible from a cljs server too)
Headless in a docker container is what I'm aiming for, indeed. Considering phantomjs as well
Browserless is an easy solution: https://www.browserless.io/ It has a simple https://www.browserless.io/docs/pdf`/pdf` that lets you render a webpage to a PDF file.
It's more or less a wrapper for Puppeteer, but it has a lot of niceties. Docker quick start: https://www.browserless.io/docs/docker-quickstart
sounds nice, but my guess is this wouldn't be viable if the report contents contain sensitive info
You'd probably need to negotiate an Enterprise License or something like that with them and include a confidentiality clause in the contract