Fork me on GitHub

Anybody gets a: REPL eval error TypeError: "goog.dependencies_ is undefined" when using figwheel-main ?

Oliver George06:05:08

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.


Hum, that might be it


That was it 😄, went back 1.10.5.. and everything is much smoother now

Oliver George07:05:26

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?


what do people use for formatting dates in cljs?


I feel my best bet is to just use date-fns as in js


Browser support seems decent. I haven’t used it though. date-fns is decent I guess.


I'd just use the closure-library, it usually has enough. A bit hard to discover the docs though.


oh, i keep forgetting there are things from google built into cljs


Hello all, when I use 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}})))))

thheller08:05:10 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


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"})))))


are you sure its related to :json-params? you also changed the URL?


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, might be the issue, will dive deeper. Thanks a lot for the pointer!


I think bindings are thread local. You might want to use bound-fn


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


Didn't see where I was, oops

😉 4

binding really does not work in an async context


Hi! Does anyone have an example of using .cookies for setting "SameSite"?


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 to get a gist of how to get things setup.

parens 32

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*"
╭─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*"                 
╭─fenton@dell ~/projects/supps ‹fenton*› 
╰─$ find . -name blah.js 
╭─fenton@dell ~/projects/supps ‹fenton*› 


@fenton I just tried it here w/ master it works for me


ah i see ordering matters...


everything is left to right


-c should be last


clj -m cljs.main -h is very illuminating about usage


`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

Lone Ranger23:05:20

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?