This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-03-04
Channels
- # announcements (4)
- # asami (38)
- # babashka (20)
- # beginners (188)
- # cider (1)
- # clara (11)
- # clj-kondo (103)
- # clj-together (1)
- # cljs-dev (15)
- # clojure (138)
- # clojure-australia (5)
- # clojure-europe (33)
- # clojure-france (1)
- # clojure-losangeles (5)
- # clojure-nl (4)
- # clojure-norway (11)
- # clojure-serbia (3)
- # clojure-uk (11)
- # clojurescript (45)
- # community-development (3)
- # conjure (22)
- # core-async (18)
- # datomic (44)
- # defnpodcast (4)
- # deps-new (1)
- # depstar (49)
- # events (2)
- # fulcro (33)
- # girouette (2)
- # honeysql (37)
- # jackdaw (5)
- # jobs-discuss (16)
- # kaocha (3)
- # leiningen (4)
- # lsp (77)
- # malli (55)
- # membrane (4)
- # off-topic (61)
- # polylith (5)
- # quil (5)
- # reagent (33)
- # reitit (12)
- # remote-jobs (1)
- # reveal (4)
- # rewrite-clj (2)
- # sci (16)
- # shadow-cljs (22)
- # sql (1)
- # test-check (27)
- # tools-deps (44)
we're working on adding an :npm-module
output into a webpacked js frontend at work. One footgun is that forgetting to mark things with ^:export
has no consequence during dev time but is obviously catastrophic at release time. Is it possible to have the dev build munge names so that we can kinda feel this pain under dev settings and not just in CI or (gasp) released?
@dpsutton no, the closure compiler does the munging and that is not used in dev builds
you might want to use :target :esm
. there the exports are configured in the build config so no ^:export
there
also, is there a way to get around enumerating every namespace in the :entries
vector? Basically everything will be compiled either directly or transitively so would be nice to just get all namespaces for free.
i was a cljs dev for 3 or so years and i'm excited that i'll finally be able to use shadow in a work product. its all been lein-figwheel because the projects were set up when that was the only game in town and wasn't worth changing over
@denik that is not possible if you want to use :advanced
optimizations (which you should for browser builds). with one small adjustments you can just interpret the EDN though: turn functions into actual data. for [example](https://github.com/thheller/shadow-cljs/blob/f0a2ae8e9cfdbadc19641bd89327b3fb496733d3/src/main/shadow/cljs/ui/components/inspect.cljs#L107) in the stuff I'm building you'd say :on-click {:e :some.ns/foo! :with "some" :other "args" :maybe true}
(just data). yes that limits you to only using events that already exist but that might be enough for you
@dpsutton I recently changed the logic back so that an emptry :entries []
is allowed again
oh nice. i saw a spec error that indicated it needed at least one simple simple. maybe we need a newer version
@denik I did something very similar for fun. I had a re-frame on the front. Using sente I both passed hiccup data that was written to the db, and instead of sending functions, I sent re-frame event keys. If you wanted to send functions though, you could use sci
reagent interprets hiccup in runtime, so you can fetch data from the db and simply render it when received.
@thheller you recomment letting shadow bring in the ClojureScript dep, correct? Asking because I want to give https://github.com/clojure/clojurescript/commit/715cdc07dbb1d595af91ea12affb6faf0b615d4b a try
seeing this now:
Syntax error (ClassNotFoundException) compiling at (shadow/build/closure.clj:1:1).
com.google.javascript.jscomp.AnonymousFunctionNamingPolicy
oh, I see that’s fixed by bumping shadow and getting https://github.com/thheller/shadow-cljs/commit/d0451aba279689bc74ae5340e83b2466e4bdb237
it might work if you use master
yes. I still haven't checked all the closure-library/compiler related changes and verified they work