This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-07-01
Channels
- # announcements (23)
- # babashka (66)
- # babashka-sci-dev (7)
- # beginners (24)
- # biff (2)
- # calva (19)
- # cider (10)
- # clj-kondo (12)
- # cljs-dev (3)
- # cljsrn (2)
- # clojure (37)
- # clojure-art (1)
- # clojure-europe (50)
- # clojure-gamedev (1)
- # clojure-nl (1)
- # clojure-norway (22)
- # clojure-uk (7)
- # clojurescript (6)
- # conjure (28)
- # cursive (19)
- # data-science (11)
- # fulcro (21)
- # holy-lambda (12)
- # honeysql (6)
- # hyperfiddle (2)
- # jobs (1)
- # lsp (5)
- # malli (4)
- # meander (3)
- # missionary (8)
- # nbb (5)
- # off-topic (39)
- # rdf (9)
- # reitit (1)
- # releases (1)
- # sci (21)
- # shadow-cljs (42)
- # specter (1)
- # xtdb (11)
I thought https://github.com/BrianChevalier/radiant was pretty cool. I used it in comp.el https://github.com/johnmn3/comp.el/blob/ce51104f4a34ee4786a44c96a41f90199dbd1eac/ex/src/todomvc/views.cljs#L73.
❤️ 1
well, as long as you can target the same env from two different build ids, I don't recall. But you can def use tag readers to conditionally require things
you can do that, but you can't define new features (like :build-1 or :other-build)
Yeah, I'm not sure what the ask is there. I one time toyed around with lazy requires, where you defined whether to require lazily loaded modules via clojure-defines, with something like:
(defn get-req-form [form]
(->> form (filter #(and (list? %) (= :require (first %)))) first))
;; maps to #lz/ns
(defn rq [[lazy-form orig-form]]
(if (:lz/lazy? (get-env))
orig-form
(let [req-form (get-req-form orig-form)
new-reqs (-> lazy-form rest set)
old-reqs (-> req-form rest set)
not-reqs (->> orig-form (filter #(not= req-form %)))]
(concat not-reqs
(list (concat (list :require)
(into old-reqs new-reqs)))))))
And then in some namespace def you could do something like:
#lz/ns
[(:require [com.acme.eager :as eager])
(ns lz.suspense.reagent.example
(:require
[lz.suspense.reagent]
[cljs.loader :as loader]
[goog.dom :as gdom]
[reagent.core :as reagent :refer [atom]]))]
(Something like that - it's been a while)
Kinda ugly though