This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-05-14
Channels
- # announcements (3)
- # aws (7)
- # babashka (108)
- # beginners (222)
- # bristol-clojurians (3)
- # calva (8)
- # chlorine-clover (1)
- # cider (14)
- # clj-kondo (4)
- # cljdoc (6)
- # cljs-dev (89)
- # cljsrn (13)
- # clojars (6)
- # clojure (89)
- # clojure-australia (1)
- # clojure-europe (11)
- # clojure-italy (9)
- # clojure-losangeles (11)
- # clojure-nl (6)
- # clojure-spec (2)
- # clojure-sweden (1)
- # clojure-uk (9)
- # clojurescript (47)
- # conjure (18)
- # datomic (7)
- # docker (1)
- # figwheel (43)
- # figwheel-main (2)
- # fulcro (31)
- # kaocha (3)
- # leiningen (7)
- # luminus (2)
- # nrepl (14)
- # off-topic (24)
- # pathom (5)
- # pedestal (5)
- # rdf (4)
- # re-frame (49)
- # reagent (12)
- # reitit (9)
- # rum (21)
- # shadow-cljs (109)
- # tools-deps (35)
- # vim (8)
- # wasm (1)
Anybody gets a: REPL eval error TypeError: "goog.dependencies_ is undefined"
when using figwheel-main ?
Wild guess but I think figwheel is incompatible with the more recent CLJS release. That's close to fixed - might be worth trying an older CLJS version to see if it goes away.
https://github.com/bhauman/figwheel-main/commit/93e5709852e49899c5b98d6216ebabfa8fe6f372
Good stuff. I think a fix is close based on the #cljs-dev chatter.
Any rum compatible locally scoped CSS lib? Like if I want to define CSS style which applies to my whole rum component only?
There’s https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat
I'd just use the closure-library, it usually has enough. A bit hard to discover the docs though.
Hello all, when I use https://github.com/r0man/cljs-http/ to send a post, with :json-params, the request is always turns into a OPTIONS request. Anyone know how to solve this issue? Thanks.
(go (prn (:body (<! (http/post "
{:with-credentials? false
:json-params {:a :b}})))))
@kimi.im the browser will ALWAYS do an OPTIONS request first when talking to a different origin than the original page. this is done to do CORS checks to see if the server allows doing the actual request. see https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS
But is I change the code without json-params, it will send a correct POST and get the response:
(go (prn (:body (<! (http/post "
{:with-credentials? false
:body "test"})))))
sorry, the url is same, i just change it in previous message to remove some confusings.
read about CORS. the server you are talking to there might just handle the OPTIONS request correctly.
it has nothing to do with cljs-http
and every other library will have that behavior as well
is there any concurrency considerations with using binding
and dynamic vars? Had a issue where a function is using a dynamic var that is bound outside the function call, and called concurrently with the same function but different bindings, and sometimes it seems like it's using the wrong binding
Bindings are lost across thunk boundaries:
(def ^:dynamic value 1)
(println value)
(binding [value 2]
(println value))
(binding [value 3]
(js/setTimeout #(println value) 0))
This prints 1 2 1
hm, that would only apply to clojure, not clojurescript, right? In the issue I hit, it seemed binding
was not local to the body, if execute concurrently. But I have yet to make a minimal reproducible case, so can't say for sure
If folks want to experiment with the new :bundle
target in CLJS and figwheel-main, I’ve just release [figwheel-main 0.2.5] with supports the :bundle
target in [clojurescript 1.10.764]. Docs are shy but you can reference the https://clojurescript.org/guides/webpack to get a gist of how to get things setup.

Went through this yesterday. Currently using latest Figwheel and CLJS to build out a web app. Great stuff so far!
Something I did notice, which I imagine will trip up new users, is that if one were to follow the webpack guide exactly with figwheel they will hit a wall because of the :output-dir
and :output-to
dir being customized in the webpack guide. Just a note for when the docs become a priority 🙂
@U6GNVEWQG thanks, things are still evolving, 0.2.6-SNAPSHOT is available and it fixes some bugs, but it will be changing over the next few weeks
Nice. Will check this out now.
can't get the output -o
option to work with clojurescript compiler?
╭─fenton@dell ~/projects/supps ‹fenton*›
╰─$ find . -name "*main.js*"
./out/main.js
╭─fenton@dell ~/projects/supps ‹fenton*›
╰─$ rm -rf out/main.js
╭─fenton@dell ~/projects/supps ‹fenton*›
╰─$ find . -name "*main.js*"
╭─fenton@dell ~/projects/supps ‹fenton*›
╰─$ clj -m cljs.main -c supps.core -o blah.js
╭─fenton@dell ~/projects/supps ‹fenton*›
╰─$ find . -name "*main.js*"
./out/main.js
╭─fenton@dell ~/projects/supps ‹fenton*›
╰─$ find . -name blah.js
╭─fenton@dell ~/projects/supps ‹fenton*›
╰─$
`The init options may be repeated and mixed freely, but must appear before any main option.`
right, skipped the part Usage: java -cp cljs.jar cljs.main [init-opt*] [main-opt] [arg*]
where init options come before main options
Can anyone recommend a good code splitting guide? I'm using webpack and figwheel-main to get work done. Are we supposed to do as much code splitting as possible with webpack for our node deps or do we somehow use figwheel+cljs to code-split out the webpack dist?
If you ever decide to give shadow-cljs a go, there's this guide: https://code.thheller.com/blog/shadow-cljs/2019/03/03/code-splitting-clojurescript.html