This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-05-10
Channels
- # announcements (4)
- # beginners (111)
- # boot (34)
- # cider (67)
- # cljdoc (10)
- # clojure (90)
- # clojure-dev (37)
- # clojure-europe (3)
- # clojure-gamedev (3)
- # clojure-italy (18)
- # clojure-losangeles (2)
- # clojure-nl (27)
- # clojure-spec (24)
- # clojure-uk (59)
- # clojurescript (41)
- # cursive (32)
- # datomic (31)
- # emacs (21)
- # figwheel (1)
- # figwheel-main (2)
- # fulcro (43)
- # graalvm (6)
- # graphql (3)
- # jobs-discuss (3)
- # kaocha (1)
- # nyc (1)
- # off-topic (22)
- # pathom (10)
- # pedestal (11)
- # re-frame (9)
- # reitit (17)
- # shadow-cljs (15)
- # spacemacs (13)
- # sql (6)
- # testing (5)
- # tools-deps (3)
- # vim (13)
- # yada (1)
Looking for a JS setup... I come to javascript from clojurescript and not the other way round, so I find it hard to give up on my emacs experience... pointers?
The Spacemacs layer should give you some ideas, for packages used and configuration. https://github.com/syl20bnr/spacemacs/tree/master/layers/%2Blang/javascript
If at all possible, attempt to use typescript over javascript. The typescript tooling for emacs (specifically tide) is miles better than the js equivalent.
I use JS at work with spacemacs, I've added RJSX package manually as it's great for react, though it has missing gaps/bugs.
@U5DEC96P7 is it backwards compatible, as in, does it provide a lot of syntax functionality to just js or does it bug out at certain points in es6 syntax? Also does it support react?
Typescript is a superset of javascript, so any valid es6 is valid typescript. And it does support react, I'm using it for a react project at work right now. The files simply change from js/jsx
to ts/tsx
ah, I have to trigger the modes manually when it detects import React at the top of a buffer.
since at my job our react files are just .js
I'll try it out. though
Thanks, @U05254DQM @U5DEC96P7 and @theeternalpulse .
@UBGH0Q0H4 glad we could help. I don't use JavaScript myself, I use ClojureScript and reagent (react.js wrapper). I would be interested to hear if the JavaScript layer or others has helped you. Thanks.
I will let you know @U05254DQM, I was sent a link to download visual-studio and immediately turned pale.. 😱 So I will give it my best shot...
VSCode is quite a nice editor and a world appart from Visual Studio. So if you don't get what you need from Spacemacs in terms of JavaScript, it could be a good alternative. There is also a nice Clojure plugin called Calva.
I would like to see a nice Spacemacs experience for VSCode, maybe called Spacecode :)
Sorry for the late response but you may find this Reddit thread of relevance: https://www.reddit.com/r/emacs/comments/8e24t9/writing_reactjsx_in_2018_what_addons_do_you_all/ I've been recently trying to build up a nice JavaScript experience on top of Spacemacs (coming from Clj/Cljs just like you) and this helped me a lot. RJSX with Tide, flycheck/eslint, prettier and flow. It's the best of VSCode on top of Emacs so it has been great so far. I only wish I could find work with CLJS forever and never touch a line of JS again though.
hey, I started using orchestra along with clojure specs and looks like defn-spec
macro fools clojure mode in a way that all docstrings are treated as strings (and displayed in different color). is there any way to instruct clojure mode (which I guess is responsible for syntax highlighting) to recognize a syntax of defn-spec
, which looks more or less like this:
(defn-spec my-add integer?
"Returns the sum of `a` and `b`."
[a integer?, b integer?]
(+ a b))
something like (put 'defn-spec 'clojure-doc-string-elt 3)
where 3
is the index of the docstring in the sexp
Any good tutorials on developing an emacs package? I've found a coupl that touch on it but nothing really comprehensive.
@theeternalpulse - Not comprehensive, but maybe a start: the "Extending Emacs" series here: http://emacsrocks.com/