Fork me on GitHub

Any one encounter this problem? TypeError: Class constructor Connection cannot be invoked without 'new' when I have something like (new Connection ...) or (Connection. ...).


Are you sure it's that exact line that's causing the error?


Yep, but I just solved it by upgrade the versions of ClojureScript and shadow-cljs to the latest. It's probably a solved bug.

👍 1
JD Codersteinersky16:03:40

Wondering. I'd like to get into WebDev and I've played a lot with Clojure so CLJS is super interesting. I don't know JavaScript well. Is it possible to bypass learning JS and just go straight to CLJS or would it be really helpful to become moderately fluent in JS first?


I don't think it's worth it learning JS in isolation if you want to end up using CLJS. Definitely learn about JS interop. But it's a single page of syntax, so a rather easy thing to do. Read through some fundamental stuff, like API available through js/document and js/window - without really memorizing anything, but just to let you know what's available. And then learn relevant bits of JS as you go. Chances are, you will never need to learn what function* is or what the difference between for (... of ...) and for (... in ...) is.

👍 6
JD Codersteinersky16:03:25

Appreciate your quick reply. Was hoping CLJS sans a JS rabbit trail was viable. Seems it is.


You'll definitely learn a bit about JS intricacies from the interop and stack traces and interacting with libraries


But mainstream JS is so big and full of so many bad ideas now.. not worth it to learn everything just so you can use CLJS effectively. If you wanted to read a single, short book or spend a weekend, sure.

Robert Brotherus08:03:00

As an hopefully encouraging example, I have been doing professional payed CLJS web-development with Re-Frame for 3 years now and I had very minimal background in JS but good background in Clojure.

clojure-spin 2
👍 2
James Amberger14:03:15

@UM54X8VTM mind if I ask you some more about your career ?

👍 1
David Pham19:03:25

I had the same experience as Robert haha

Robert Brotherus06:04:01

Feel free to ask anything @U032EFN0T33 🙂 You can also check my blog-post on moving from product company to consulting company where I was able to start using professionally Clojure (which I had previously only used in hobby programming):

Robert Brotherus06:04:46

I think in Clojure-area, since it is bit niche, it is quite posible to be hired as Clojure-developer by having (a) strong general programming background and (b) learned Clojure as hobby. I think one aspect of that is that learning Clojure as a hobby is considered as a strong indication of a good and motivated developer (like the old "python paradox")