This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-03-06
Channels
- # admin-announcements (1)
- # aws (12)
- # beginners (35)
- # boot (12)
- # cider (32)
- # cljsrn (5)
- # clojars (10)
- # clojure (20)
- # clojure-russia (60)
- # clojurescript (229)
- # community-development (14)
- # cursive (9)
- # data-science (4)
- # datomic (3)
- # funcool (2)
- # hoplon (29)
- # jobs (15)
- # jobs-discuss (53)
- # keechma (2)
- # luminus (8)
- # om (42)
- # onyx (15)
- # parinfer (22)
- # re-frame (12)
- # reagent (162)
- # spacemacs (1)
Never mind I found out π
if I have some edn that in clojure read-string
will parse but in cljs, cljs.reader/read-string
wonβt parse, is there somewhere I should check known issues?
hey what do you guys think the best editor is that has good clojure AND good clojurescript support?
and hopefully it can work well with figwheel as well
@adamkowalski: emacs with cider can launch a clojure AND clojurescript at the same time
Yeah I used that for a while, and while it is great for Clojure I personally struggled using it with figwheel
You end up using nrepl and figwheel sidecar, and piggieback
I heard things might get better with the socket repl thats being worked on, but for now I was wondering if there is a solution that just works
Ideally it has some support for parinfer as well
That being said, maybe I am doing something wrong, and emacs/cider are great for clojurescript/figwheel and I would love to be told I am incorrect
@adamkowalski: I am using it at the moment and, while I had some problem as well, it looks like now it is easier then ever
you need lein repl
and the three figwheel commands only
I can link you to some working project.clj
on the other end, if you are not an emacs enthusiast, I heart Cursive and figwheel do work well together
yeah could I see your project.clj?
And how would you say light table compares to cursive and cider?
nice, kind of new, you have paredit (optional) of course and inline eval result, but I have never tried it with figwheel
@adamkowalski: my current project.clj
https://github.com/Lambda-X/replumb/blob/fix-async-init/project.clj
it is kind of still in progress so I hope it is working fine, I switched to the new figwheel way recently
Interesting. The reason I thought about light table is because of this https://github.com/mauricioszabo/lt_parinfer
yes well there is parinfer support in atom as well if i am not wrong, but I do not use parinfer so I cannot advice on that
ok so it seems like this is the important part to include right :profiles {:dev {:resource-paths ["dev-resources"] :source-paths ["src/cljs" "src/clj" "test/clj" "test/cljs" "test/browser" "src/browser" "repl-demo/browser/cljs" "dev"] :dependencies [[com.cemerick/piggieback "0.2.1"] [org.clojure/tools.nrepl "0.2.12"] [figwheel-sidecar "0.5.0-6"] [cljsjs/jqconsole "2.13.2-0"] [reagent "0.5.1"] [binaryage/devtools "0.5.2"] [spellhouse/clairvoyant "0.0-72-g15e1e44"]] :plugins [[lein-doo "0.1.7-SNAPSHOT"] [lein-figwheel "0.5.0-6" :exclusions [cider/cider-nrepl]] [lein-shell "0.4.2"]]} :repl {:plugins [[cider/cider-nrepl "0.11.0-SNAPSHOT"]] :repl-options {:nrepl-middleware [#_cider.nrepl/cider-middleware cemerick.piggieback/wrap-cljs-repl]}}})
oh if you are not using parinfer you need to try it, it is amazing
its not great, but it works in emacs
unfortunately it is not in melpa or marmolade
no I know it is, just slacked a bit π I want to add parinfer support in http://clojurescript.io
oh awesome, is that an online repl?
I know that @mfikes has it working in https://github.com/mfikes/replete so maybe you can talk to him about how to go about integrating it into your project
yes Mike and I are discussing constantly as replumb is basically a rib of planck π
sounds good
I wish that somehow we could combine the efforts of all the people that are working on projects like this so we could have a common base that works
I know that nrepl tries to do that but it seems like it hasnt really achieved that goal βim my opinion"
like figwheel has its own repl, then there is the brepl, nrepl, ios repl, and so on
I guess replumb was born out of that necessity, for bootstrapped Clojurescript only
if we could make a common standard that could support clojure/clojurescript/ios
and could have an easy to use way to extend it
so that way maybe parinfer, paredit, whatever could be made as part of the repl itself
then different projects could automatically get that for free
mmm, I don't know, I think you would me mixing too many responsabilities
a repl is just, read eval print loop
fair enough
on the other hand, having so many different implementations is a pretty nice problem to have
IMHO of course
@laggybit: yeah they have fireplace right
yes what's going on with Clojure tooling it's awesome imho
we even have a successor of paredit
yeah the tooling story is great
quite unexpected π
figwheel, devcards, browser repls, custom clojure devtools
probably we also need them because debugging and error messaging is, let's say, to be improved
I am just in search of βthe bestβ experience I can make with the awesome tools we have available
cursive was great, but it is maintained by one person so that is a little scary to me
yeah it seems like a lot of people think that
do you use it with nrepl as well?
the one thing that appeals to me about light table is that it is written in clojure, and something about having a clojure ide written and extended in clojure seems awesome
emacs has elisp which is nice, so it is definitely of much interest to me as well
I'm not sure changing editors in search of the best integration is your best bet; bringing that integration to your favored editor would probably work better in the long run
I think light table is written is Javascript no? I might be wrong
it is written in clojurescript
I think one of the ideas behind it is that the whole editor is one big immutable value
ah nice
81.9% clojure
14.9% css
but i think it is based on codemirror
@smw yeah definitely
i really like the ideas he has about using it for testing your user interface too
going back to building js/css components the old fashioned way feels like banging rocks together
on the other hand, clojurescript has proven extremely detrimental to my ability to write javascript
yeah, I agree
I also never write css anymore
I just use the style map
that way all my styles can be generated using functions
and I can compose styles together to get more interesting looking components
been exploring garden but I haven't had a project yet where I could make the switch and not piss off everyone else
yeah garden is really interesting
but I donβt even use that
because I havnβt found a way to make the styles dynamic with garden
if you just use a map {:style {:font-size β24pxβ}}
you can generate the styles on the fly
it just requires a change in mindset. before things like on hover were handled by css, and now they are part of the model
perhaps, but I havnt found a way where I can make garden product styles dynamically, to for example take in the current model as input to a function and then product different styles based on that
usually you need to use goog.style/injectStyles I think it was called
from vanilla react I used to use a library called Radium http://stack.formidable.com/radium/
which is inspired by this talk https://speakerdeck.com/vjeux/react-css-in-js
yup, no css classes
its definitely something I would try on a smaller project first just to see if you like it or not
it may not be for everybody
and I wouldnβt try to impose it on your coworkers before you have a firm understanding of how it works, and the sometimes wierd things you deal with
I deal with too many actual websites to make that work; we spent so much effort on our current css methodology already
thats understandable, but I think that if you have a small project that you can work on for your own leisure try it out
in my opinion css is really hard to wrangle because it lacks many things that we get out of the box in a real programming langauage
style reuse is the best part
since it is just clojure code, you can namespace it, and include it wherever
everything about clojure that makes it fantastic for managing your code now works for css
it is simply a map
everything is just a datastructure
that's the way garden pretty much works; everything is a clojure data structure until you actually persist the data structure to css, then it all becomes classes
yeah, thats exactly right
and that is the only thing I dislike about css
I think that class names are a really bad means on naming your styles
so I assume you're doing the same thing, but instead of generating an entire css file and then using classes on your components, you rather have the component be written to the DOM with the styles built-in
^ yup that is exactly correct
naming is a really hard problem, and being able to make small composable building blocks is the key to modularization
you have a generic function that can create the styles for a button
obviously you're still naming your clojure variables, but you get namespacing, which css doesn't give you
instead of having {:className ".button .greenβ}
you now have {:style (button βgreenβ)}
where button is a function which takes a color
obviously a really contrived example
but you get the point
if you can generate a map in some way, you have a valid style that you can attach to a component
if you want to share it between componenets, toss it in a seperate file and then include it wherever you need it
merge your different styles into larger and larger maps and boom! you get more interesting styles
I could probably apply that approach in both use-cases, the css case, and your direct-to-style case
for a website, export to css via garden, whereas for an SPA, apply the style directly to react components
yeah, or have a mixture of both
static styles can be made via garden or raw css
and if you have something that is dynamic then use my method for that portion
the best part is garden uses almost the same types of maps that I use
so you can honestly mix and match with minimal effor
make try making a similar project to something you have made before
that way you can do a comparison of how each way worked and which way works best for you
you probably wouldnβt even need to re code the app, just port the styles
unfortunately I cant help you with that one
;; ----------------------- ;; Channels (listen for events in a element and put then on a channel) (defn listen [el type] (let [out (chan)] (events/listen el type (fn [e] (put! out e))) out)) ;; clicks is a channel that receives all the click on app element (def clicks (listen (dom/getElement "app") "click")) (defn output-clicks [] (go (while true (<! clicks) #(swap! current-slide inc) (println current-slide))))
(defonce current-slide (reagent/atom 0))
;; -----------------------
;; Channels (listen for events in a element and put then on a channel)
(defn listen [el type]
(let [out (chan)]
(events/listen el type
(fn [e] (put! out e)))
out))
;; clicks is a channel that receives all the click on app element
(def clicks (listen (dom/getElement "app") "click"))
(defn output-clicks []
(go (while true
(<! clicks)
#(swap! current-slide inc)
(println current-slide))))
`I am playing around with parinfer and replumb, I had looked at using the bootstrapped compiler half a year back or so but found it a bit too difficult. Replumb made it way more accessible!
And parinfer makes it soo I don't have to miss paredit too much and actually makes my phone a viable device for development
@bbss: any advantages over paredit w/parinfer?
I've just managed to somehow get comfortable with emacs/paredit
@iwankaramazow: hmm, too early to tell.
πππ
I'm trying to use react-native and clojurescript (https://github.com/mjmeintjes/boot-react-native). I'm having problem using React.fetch(url) as I want to use .then on the returned promise: (.then (.fetch js/React uri) (fn [res] ...)), but I'm getting "undefined is not a fuction (evaluating 'React.fetch(....)'. Does anyone have any pointers?
I am having trouble require-ing macro's with replumb. Not sure if I need a newer version of cljs(.228)/replumb(0.1.5-3) or need to configure something differently (maybe add an additional source-path to repl opts) or it's just not possible yet. I would like to use core.async, mount and devcards macro's.
There are some posts/gists about using macros from bootstrapped cljs. This issue seems related: https://github.com/Lambda-X/replumb/issues/108, but I can't figure out if those fixes should be in cljs .228, judging from the ticket still being open maybe not. I will try to figure out how to build cljs from source.
We can now save pads in cljsfiddle! http://cljsfiddle.com/#gist=d0c3121fb7083f066273
Idk if you guys have seen atom and clojure work together but I thought I would share this
this is amazing
between those 3 packages atom is honestly as good as light table in my opinion
why thank you π
Ever since the invention of Parinfer, I have practically only used Atom for writing ClojureScript. No complaints.
awesome haha, have you been using figwheel as well?
@bbss that bug is still open but it is not macro related, macro are loading but you need to configure the source path and plug io in replumb
I don't use figwheel personally, but I think it's an excellent project. And the importance of rapid feedback while developing cannot be understated.
yeah, I am going to try to get atom and figwheel to play nicely with protorepl
I feel like I can go down the nrepl + sidecar + piggieback route and see how that works out
But, how was the process of writing plugins for atom? Was it a pleasant experiance?
It wasn't terrible. I enjoyed writing the Atom plugin better than writing the Sublime plugin.
I was driven by an intense desire to see Parinfer working in Atom; that over-shadowed any difficulty in working with the API.
Since Atom is javascript based, we should be able to write ClojureScript and transpile down to JavaScript right?
so we could write plugins with the same language as your actual projects
correct
atom-parinfer is written in CLJS, and I wrote it using Atom
so I would test out Parinfer features in atom, on the atom-parinfer codebase, the whole process was very recursive
wow, why are more people not doing this yet?
you should think about writing a blog post describing your process so more people get inspired and make more things π
that way we get more people writing clojure in atom, which leads to more packages, which makes the workflow even better
positive feadback cycle
I have been meaning to write more about CLJS.
I tend to seek out programming over writing with my spare time; the pendulum has probably swung too far towards programming though. Need to produce more English.
Yeah, but anyway thanks for your work on parinfer
If you need any help with the project you should let me know
I would love to check out the work and help contribute if I can
You're welcome Although @shaunlebron deserves the lion's share of the credit for Parinfer. The #C0F2A0MJN channel has some discussion around plugin development and whatnot.
alright cool, I joined. I will lurk around there and keep my ear open
There are some issues on the language-clojure package that would indirectly help atom-parinfer: https://github.com/atom/language-clojure
I gotta head out but it was nice talking to you
oh ok I will bookmark that and take a look tonight when i get back!
Specifically, writing some test cases for this PR would benefit atom-parinfer: https://github.com/atom/language-clojure/pull/37
no problem; thanks for the kind words