This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-08-13
Channels
- # aleph (6)
- # architecture (29)
- # beginners (175)
- # cider (22)
- # clara (5)
- # cljdoc (5)
- # cljs-dev (28)
- # cljsrn (6)
- # clojure (62)
- # clojure-finland (7)
- # clojure-italy (7)
- # clojure-nl (2)
- # clojure-spec (23)
- # clojure-uk (194)
- # clojurescript (90)
- # core-async (2)
- # cursive (23)
- # datomic (41)
- # defnpodcast (2)
- # editors (4)
- # emacs (1)
- # figwheel-main (41)
- # fulcro (53)
- # hoplon (15)
- # hyperfiddle (4)
- # immutant (1)
- # jobs (7)
- # jobs-discuss (103)
- # lein-figwheel (9)
- # off-topic (34)
- # onyx (3)
- # parinfer (1)
- # portkey (1)
- # re-frame (7)
- # reagent (2)
- # remote-jobs (2)
- # rum (1)
- # shadow-cljs (148)
- # sql (54)
- # tools-deps (3)
- # vim (7)
hello clojurescript community! When i define a defrecord i get for the type #object[function ]. in clojure i get java.lang.class. Is it possible to get a better tpename for defrecords in clojurescript?
@ferdi.kuehne if you don't intend to the use classname for anything other than outputting it you can use (pr-str TheType)
Would it be possible to add a warning to the CLJS compiler when the filename doesn't correspond to the namespace? That's my no1 "hard to diagnose" problem
Are there any libs for cljs for using google maps that are up-to-date ?or any other map that has direction for that matter, yandex is ok too i found 2 updated 2013/2015 that seems outdated
@lepistane probably easiest to use a js/react based library, and use that directly with reagent/rum/whaterver wrapper you're using.
I am using the newest clojurescript and targeting Node.js. I am curious when was the change in compiler which auto direct all prints to the javascript console? I remember that in the past the (enable-console-print!) was a standard 😛 Now it's not needed as I can see. (which is great 😄 🎉 ) @mfikes
@pesterhazy even that recommendation lib would be great, i am not very experienced with this so linking how to..
would be nice too
most useful thing i found was https://github.com/reagent-project/reagent-cookbook/tree/master/recipes/google-maps
and i will probably gonna use that but i was wondering if there are others that i can't find solo and community knows (i am talking about libs or blogs that teach u to use google/yandex map inside your project)
@kwcharllie379 It was 1.10.238 (`*print-fn*` automatically set): https://github.com/clojure/clojurescript/blob/master/changes.md#110238
Great change ❤️ Thank you @mfikes
anyone know how to select the :root
element with garden? [::root]
still compiles to root {}
😕
Hey everyone, I was wondering if any of you would have a suggestion as to how to print the source for a function as a string (without using clojure.repl source / sourcefn
)?
Hello folks! I have the following piece of code that is evaluated in a macro:
(cljs.test/async
done
(cljs.core.async/go
(try
(cljs.core.async/take!
(go (is (nil? (<! (throwing-ch)))))
(clojure.core/fn [val] (done)))
(catch
:default
e
(clojure.core/println "ERRORORORO")
(cljs.test/do-report (shared.test.test/chan-error-map e))
(done)))))
the error never gets caught in the catch
and I cannot understand why for life of me 😄
@jacob.haag Outside of creating a custom macro defn that stores the source in the meta, I don't see any other way get at the source other than the route source
takes
@richiardiandrea you have 2 go
's, I guess try/catch needs to be under 1 and the same go macro?
I tried to add try/catch
under the first one just now, no dice
I tried to add try/catch
under the first one just now, no dice
yeah that is what I know as well
this does not work as well:
(cljs.test/async
done
(try
(cljs.core.async/go
(try
(cljs.core.async/take!
(go (is (nil? (<! (throwing-ch)))))
(clojure.core/fn [val] (done)))
(catch
:default
e
(clojure.core/println "ERRORORORO")
(cljs.test/do-report (shared.test.test/chan-error-map e))
(done))))
(catch :default e (clojure.core/println "ERRORORORO2" e))))
very weird
uhm, let me try
yeah it is...it seems
I'm assuming that (go (is (nil? (<! (throwing-ch))))
is the throwing part? the exception thrown there won't propagate to the outer go so the try/catch doesn't matter at all?
so this is part of a testing framework
I am trying to catch as match as I can and report
the thing is...I see the exception printed out in console
so there must be a way to catch it somehow
(hopefully not node hooks)
Is there an ‘official’ template for starting a figwheel project with all the latest stuff?
@richiardiandrea hmm: https://bytearcher.com/articles/why-asynchronous-exceptions-are-uncatchable/
Cool, I’ll check it out. I know a lot has changed….
oh wow, that's sad...
my throwing fn was:
(defn throwing-ch []
(go
(gobj/get (js* "undefined") :foo)))
so I guess that's uncatchable
you have have to catch exceptions generated on the producer side and then, if you want, stuff them in the channel. see dnolen’s <?
operator
yep I know that trick
but this is a testing wrapper, so I do not have control over that
you learn new things every day I guess 😄
yep I understand that 😄
but that is not under my lib control
oh okay. i just ran into this headlong a while ago and was very frustrated by the experience 🙂
if a user does not do that, I thought I could still catch
but thanks for chiming in folks, I genuinely did not know about -> https://bytearcher.com/articles/why-asynchronous-exceptions-are-uncatchable/
for example, cljs-http
(which uses core.async) will throw an exception if the server returns bad json. but because it doesn’t catch it, it just dies. there’s no way to fix that from the consumer side.
so there is almost no point in what I am doing with channels 😉
maybe yeah, you might be right
my poor macro will have to die with the time I wasted writing it 😄
@richiardiandrea https://stackoverflow.com/questions/12571650/catching-all-javascript-unhandled-exceptions
thanks!
I was afraid of that 😄
Looks like node is:
process.on('uncaughtException', function(error) {
// do something clever here
alert(error); // do NOT do this for real!
});
that’s going to be tricky in a testing framework, because you won’t know what test caused the error, and you won’t know how long to wait
true that
I guess for now I am going to postpone the whole idea...too much work for little gain
Hi, can anyone help me? How print or format a value to show in an input field as currency or something like this (#,###.00)?
what I have found is cl-format, or split the number in decimal part and integer part and format accordingly
https://www.daveoncode.com/2009/11/26/goog-i18n-numberformat-formatting-number-locale-string/
@wvelezva (.toLocaleString 550.753 js/undefined #js {:style "currency" :currency "USD"})
thanks
no, I mean, calling "users/foo_function" from the core.cljs file doesn't work because all inside the "users" NS can't reach the DOM
it shouldn’t matter what namespace that function is defined as long as your requires are right
I explained here: https://stackoverflow.com/questions/51829375/calling-function-from-another-namespace-in-clojurescript/
@aarkerio you need to show more code. how are you requiring it? how were you executing the foo
function when it worked?