My name is Thomas and this is a channel about my life Between Two Parens. I'm a professional Software Developer specializing in Clojure(Script) and JavaScript. On this channel we cozy up between two parens while we tutorial, walkabout code and experience this epic walk known as life through the lens of code.
I do it all because I want to give back but if your interested in supporting this channel beyond your most welcome likes, views and subs checkout my Github Sponsors page github.com/sponsors/athomasoriginal
Thanks for the video--great stuff. I have a fair amount of Clojure knowledge but always struggle setting up a cljs project. The idea of doing the minimum and fixing it bit by bit is really helpful. Less helpful is the way the Clojure CLI tools seem to have changed every time I come back to Clojure! What worked for me was: clj -M -m cljs.main --compile app --repl instead of: clj --main cljs.main --compile app --repl and: clj -M -m cljs.main --watch src --compile app --repl instead of: clj -M cljs.main --watch --compile app --repl
Thanks for the post! I'll look into this and I agree that Clojure CLI tools went through a good amount of evolution since this video was initially made. A new one will be incoming. 🙏
It would be more useful if you can zoom in to your screen, the color of the cursor doesn't see clearly, so I could appreciate better what are you doing.
Man, WTF :D You don't have to change the "hunk header" to edit the commit, git developers aren't that stupid. Just use the syntax git uses. Don't delete context lines and everything will be fine. (In your "example of apply path error" you deleted one context line: with curly brace)
Thanks for posting. How did you get your git diff to look that way? I assume you are using an alias of some sort, as normally git diffs have a much different look.
can you please keep our points in a tabular comparitive format in forefront & keeping your face at BACKGROUD as this is RU-vid & NOT a dating site to keep your FACE alone for whole presentation period, hope you give a better one next time thanks
You should do it and stop being so rude to content creators who are actually giving useful information. There is no such a rule that says he can't keep his face there as much as he wants.
Sad to see Atom being sunsetted. Even though it's not till Dec 2022, the site seems to barely work, and the extension download server appears to be failing
Indeed. Atom is no longer maintained by Github, but I believe there may be a community effort underway to revive it. Not sure of their progress. For now, I would recommend Sublime 4.
Fantastic thank you! Question: the initial setup outputs a message saying, "WARNING: Implicit use of clojure.main with options is deprecated, use -M instead. What is this and how would it be used correctly now?
Love the video and instruction, but since there is nothing on the web page you probably don't need it to be so big. So you could have the project directory open the whole time instead of switching it every time.
Thank you so much for doing this. It is crazy that Clojure / Clojurescript is so powerful but the onboarding is so poor. A bunch of videos like this really help out those who are interested.
Hey! Those two things are different tools. It's like comparing a hammer to a shovel. Very different purposes 😄 - shadow-cljs and figwheel-main provide tooling to enhance the development experience (HMR, Live CSS Reload etc) - cljsjs - this is a technique to package JS libraries so they can be used in Clojure land. This technique is not really used on project anymore because ClojureScript now has strong support for consuming NPM libraries "directly" now. Let me know if this helps!
Hi, is webpack necessary? I did not use npm deps in my clojure reagent website and I have the same config as you except the webpack option in the prod config. On my host Netlify, it does not seem to find my scripts for some reasons while locally everything is working fine. So I was wondering if figwheel can actually work without the webpack bundle and so npm? Thank you.
Hey there! If you are using figwheel-main and want to use npm packages in the modern approach in your CLJS project than you will need to have :auto-bundle :webpack set in your build config file and use webpack. There is no way around that.
@@BetweenTwoParens Thank you for your reply. Actually, I don't want to use npm in my project. (No need for a simple website imo). Without webpack, it actually creates a `prod.main.js` in `public/cljs-out` but this should be picked up by Netlify. However, I have the good old error with the js file filled with html (the js src path is correct in index.html) On the figwheel website, the owner shows how to use webpack but I was wondering if a non-npm reagent app needs it. I have no packages.json, only deps.edn. I just have `clj -A:prod` as a build command on Netlify and I am not sure if that's enough.
I configure my Mac so that Caps Lock becomes the meta key. So, for me its: Caps Lock + b. This article should get you started: www.howtogeek.com/409904/how-to-turn-your-mac’s-caps-lock-into-an-extra-modifier-key/
Hey Kyle, see docs.github.com/en/search-github/searching-on-github/searching-code#search-by-file-extension for the official docs. TL;DR -- extensions tells Github search that you only want to search within files ending in ".cljs". In other words: only look for my term inside of ClojureScript files. You can change the extension to whichever language you're working in. Example: if you want to only search Python, update the extension to be "py". I hope this helps!
I am going to thumb down your video for your font size. The reason I am here is that I want to see something happening, otherwise I am fully capable of reading the instructions online myself. Redo your video please. Also, you should teach this tool while you install two java versions.
Hi thanks for your tutorials they are great. How to setup a hello world reagent cljs without figwheel-main; I found the main.js is created in out directory and that the index.html must be in REPL directory and not in resources/public; thank you again for your help.
I tried as per your video at 9.45 change from "Hello, sailor" -> "Hello, sailoremoon" in app.cljs, refresh doesn't show the latest. clj --main cljs.main --watch src --compile app --repl rlwrap: warning: could not set locale warnings can be silenced by the --no-warnings (-n) option WARNING: Implicit use of clojure.main with options is deprecated, use -M WARNING: app is a single segment namespace at line 1 /Users/eric/Desktop/hello-world/src/app.cljs ClojureScript 1.10.866 cljs.user=> Watch compilation log available at: out/watch.log my chrome shows Hello, sailor VM482:1 POST localhost:9000/ net::ERR_EMPTY_RESPONSE VM482:1 POST localhost:9000/ net::ERR_EMPTY_RESPONSE I am using latest clojure 1.10.3 and jdk 11 Any idea?
refreshed on chrome too many times, showed me this in terminal Exception in thread "Thread-774" java.net.SocketException: Protocol wrong type for socket (Write failed) at java.base/java.net.SocketOutputStream.socketWrite0(Native Method) at java.base/java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:110) at java.base/java.net.SocketOutputStream.write(SocketOutputStream.java:150) at java.base/jdk.internal.reflect.GeneratedMethodAccessor7.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at clojure.lang.Reflector.invokeMatchingMethod(Reflector.java:167) at clojure.lang.Reflector.invokeInstanceMethod(Reflector.java:102) I tried jdk 11 adopt hotsport and zulu, made no difference. Any idea why --watch not working?
Hey Eric, I don't believe your issue is related to the JVM or Clojure. - What version of ClojureScript are you working with? (try 1.10.879) Are you running windows or mac? - How did you run the command? can you try: clj -M cljs.main --watch src --compile app --repl
Seems you now need to use: 'ctrl-y': 'chlorine:connect-socket-repl' rather than either of the connect-clojure-socket-repl and connect-clojurescript-socket-repl options
Well mate, I have a strong background with PHP / NodeJS ... (10years as Full Stack Development) but I always feel empty about those languages... then my friend suggests that I should go with Clojure. At an early stage! just () '() things impressed me. Do you have more videos about getting started with Clojure? Your method of explaining things is the real deal! I would like to hear more from you! Greetings!
I understand completely. I also came from a similar world (Node/Browser JS/Python) so I can relate. It's also the thing that made me want to share these videos. I don't have much on Clojure the language. I have found that this area has some good resources like "Getting Clojure", "Quick Clojure" and "Elements of Clojure". Those are my fav' for the early learning journey. Then there are a bunch of others for the rest of the journey too. My focus right now is hoping to flesh out the areas where I often see less coverage e.g. getting started with an app, structuring a Clojure codebase etc. More is in the works!! Cheers!
When you said " One last thing I want to show you ", instead of the --view command, I expected/hoped for an introduction to figwheel. Thanks for this, great back to basics tutorial.
I totally wanted to, but the video would be loooong. If you haven't seen it already, checkout this video: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-7b5114xE_GA.html
Hi Thomas, I am Traditional Java Dev and Totally new in Clojure(even for Lisp) can you please share Initial Docs to start with Clojure for a complete noobie, Thanks :)
Welcome! 🙇 For getting started with Clojure as a language I am a fan of the books Getting Clojure, Quick Clojure and Programming in Clojure. As for getting started with a backend Clojure app or CLI this one is a little trickier as I have yet to find a book or course which takes one through the steps in one place. In general, I learned by piecing it all together. Having said this, if you have thoughts on what exactly you want to build I can perhaps direct you better. Final note: checkout the Clojurians slack group if you haven't already. There are MANY brilliant and welcoming humans waiting there to help. Cheers!!
As in, which would I choose? Depends on what i'm building. If it's an an app of any serious size then ClojureScript. 💯 Clojure and ClojureScript help rein in the complexity. So that's why I wouldn't want to work with JS on large projects if I had a choice. If it was just a blog, or simple site with simple behaviours I would just do JS, HTML and CSS. Having said this, if you're looking to learn CLJS then a small project is a PERFECT way to explore the language.