This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-05-15
Channels
- # announcements (2)
- # babashka (137)
- # beginners (96)
- # calva (3)
- # cider (11)
- # clj-kondo (8)
- # cljs-dev (161)
- # cljsrn (21)
- # clojure (78)
- # clojure-europe (47)
- # clojure-france (1)
- # clojure-losangeles (1)
- # clojure-nl (4)
- # clojure-spec (24)
- # clojure-uk (9)
- # clojuredesign-podcast (4)
- # clojurescript (39)
- # conjure (2)
- # core-async (27)
- # cursive (36)
- # datomic (54)
- # emacs (6)
- # figwheel (9)
- # figwheel-main (46)
- # fulcro (25)
- # graalvm (8)
- # helix (30)
- # hoplon (6)
- # hugsql (3)
- # jobs (5)
- # leiningen (7)
- # luminus (12)
- # nrepl (20)
- # off-topic (20)
- # pedestal (16)
- # re-frame (14)
- # reagent (3)
- # reitit (3)
- # remote-jobs (5)
- # rum (25)
- # shadow-cljs (60)
- # spacemacs (10)
- # vim (2)
- # xtdb (36)
there's just no guide for code splitting with Webpack yet so you're kind of own your own
in theory you could use the existing code splitting and produce N bundles but far as I know no one has tried that yet and reported issues
I'm trying to use code-mirror from cljjsjs, and it says:
You can add the following boot tasks to add the css to your project.
(sift :add-jar {'cljsjs/codemirror #"cljsjs/codemirror/development/codemirror.css"})
(sift :move {#"cljsjs/codemirror/development/codemirror.css" "vendor/codemirror/codemirror.css"})))
But I'm not using boot, only tools.deps, any way for me to accomplish this without boot?
Add an alias as such in deps.edn
:
:sift-codemirror {:paths ["build-scripts"]
:main-opts ["-m" "sift-codemirror"]}
create a build_scripts
folder, and inside it create your build scripts, such as I created a sift_codemirror.clj
:
(ns sift-codemirror
(:require [ :as io]))
(defn -main
[& _args]
(->> (io/resource "cljsjs/codemirror/development/codemirror.css")
(slurp)
(spit "./resources/public/vendor/codemirror/codemirror.css")))
Now if you run: clojure -A:sift-codemirror
it will run the sift_codemirror script with the classpath of your project, and sift the css file from the jar into my resource dir.
You can use this to write any kind of build script you want, its just plain Clojure.any suggestions about how to do some simple tracing in clojurescript
what would be already very useful is just to see all the functions that are called in the right order, even without the arguments
https://github.com/clojure/tools.trace/blob/master/src/main/clojure/clojure/tools/trace.clj exists but I don't believe it's been ported to CLJS - seems possible
googling cljs-trace
does return some results, not sure if they can be configured to drop args
Question about the library ag-grid. After setting a css class to a row with getRowClass, can you remove the class when logic to getRowClass is false?
i.e. I want the background to be white again, when changing the Notstandard to Core.
(ns my-app.module
(:require
[group.module.a :as utils]
[group.module.b :as utils]))
In this case utils will only refer to whatever is in group.module.b only?what's the best way to convert a hashmap keys from keywords to strings? to have the same map but with string keys
There's also the helper library https://github.com/weavejester/medley where you can do
(medley.core/map-keys name {:a 1 :b 2})
for the same resultand of course, you can create a map keys function yourself by changing a tiny amount of the reduce-kv
code i sent first
(letfn [;; WTF Recursive solution
(namefy-keys [coll]
(if (coll? coll)
(into (empty coll)
(map (if (map? coll)
(juxt (comp name key)
(comp namefy-keys val))
namefy-keys))
coll)
coll))
(namefy-keys* [coll]
(into {}
(map (juxt (comp name key)
val))
coll))]
(let [coll {:a 1
:b 2
:c {:d 3
:e [[[[{:f 42}]]]]}}]
(namefy-keys* coll)))
another option: https://lambdaisland.com/blog/2019-12-04-advent-of-parens-4-a-useful-idiom
Hey @jjttjj!
Today I read this discussion with @thheller about importing antd
https://clojurians-log.clojureverse.org/shadow-cljs/2018-09-05
Have you managed to import only the desired modules instead of the whole library?
Importing antd
directly did not do the trick for me
(using shadow-cljs)
Hey sorry I don't remember this conversation at all or if I ended up getting it working š
@marodriguez you typically just require the component you want to use directly, eg (:require ["antd/es/date-picker" :default DatePicker])
or so
Thanks both for the fast replies. It worked!
Add an alias as such in deps.edn
:
:sift-codemirror {:paths ["build-scripts"]
:main-opts ["-m" "sift-codemirror"]}
create a build_scripts
folder, and inside it create your build scripts, such as I created a sift_codemirror.clj
:
(ns sift-codemirror
(:require [ :as io]))
(defn -main
[& _args]
(->> (io/resource "cljsjs/codemirror/development/codemirror.css")
(slurp)
(spit "./resources/public/vendor/codemirror/codemirror.css")))
Now if you run: clojure -A:sift-codemirror
it will run the sift_codemirror script with the classpath of your project, and sift the css file from the jar into my resource dir.
You can use this to write any kind of build script you want, its just plain Clojure.