clojure-survey

Discussion about the State of Clojure survey (https://surveymonkey.com/r/clojure2020)
alexmiller 2020-01-06T14:59:49.134300Z

Clojurescripters.... feedback on these two questions?

alexmiller 2020-01-06T14:59:59.134600Z

* Q: Which ClojureScript tools do you use for interactive development?
** ClojureScript's built-in REPLs
** Figwheel Classic
** Figwheel Main
** lein-cljsbuild's command-line REPL
** shadow-cljs
** Dirac
** Devcards
** cljs-devtools
** Other [open response]

* Q: How are you running your ClojureScript tests?
** Headless browser (or actual browser)
** Node.js
** Nashorn
** Devcards
** Phantom
** doo
** Karma
** shadow-cljs
** Kaocha
** nubank/workspaces
** Figwheel
** I don't have any tests!
** Other [no response]

alexmiller 2020-01-06T15:00:35.135300Z

the first is in replacement for the prior "CLJS REPL" question, both have updated answer sets. what's missing?

thheller 2020-01-06T15:10:20.136700Z

@alexmiller cljs-devtools is a library that is usually used during development with any other tool. doesn't seem to fit into the question?

thheller 2020-01-06T15:10:49.137200Z

also the first answer should probably be cljs.main (as that covers the REPLs and more)

thheller 2020-01-06T15:11:50.137500Z

devcards also seems to fit better into the second category, not the first

alexmiller 2020-01-06T15:13:03.138600Z

(these are multi-select questions btw)

alexmiller 2020-01-06T15:13:30.139300Z

I think you're suggesting you would not use cljs-devtools during interactive dev and it should be removed?

2020-01-06T15:13:47.139800Z

I’m curious (no idea if anyone else is or if it’s relevant) how many people are coding or would like to code more cljc based code. I personally aim to do most of my development in that space and I think knowing whether it’s a niche area or not would be useful? Not sure what’s currently in the survey, so no idea if it’s already addressed…

thheller 2020-01-06T15:14:02.140Z

no you would absolutely use cljs-devtools but you can't just use cljs-devtools. you still need something to compile the code. it is just a library.

thheller 2020-01-06T15:14:22.140200Z

so you would still use cljs.main + cljs-devtools or shadow-cljs + cljs-devtools etc

alexmiller 2020-01-06T15:14:32.140700Z

first answer for which question? and do you mean replacing the existing one or inserting?

thheller 2020-01-06T15:15:01.140900Z

I guess its fine if you multi select it

alexmiller 2020-01-06T15:15:20.141100Z

yeah, that was the idea

thheller 2020-01-06T15:15:28.141300Z

maybe a separate question like "what libraries do you use frequently?" or so makes sense

alexmiller 2020-01-06T15:15:41.141500Z

not going down that path (see other threads in this channel)

alexmiller 2020-01-06T15:16:35.141700Z

it's not currently mentioned anywhere. certainly not niche - many people doing this. I'll think about where and whether to add it.

thheller 2020-01-06T15:17:20.141900Z

* Q: Which ClojureScript tools do you use for interactive development?
** ClojureScript's built-in REPLs

thheller 2020-01-06T15:18:02.142100Z

cljs.main covers those REPLs but also more generic compilation stuff

thheller 2020-01-06T15:18:59.142500Z

cljs.main should at least be part of that answer IMHO

alexmiller 2020-01-06T15:19:16.142700Z

would you still say this based on prior thread?

alexmiller 2020-01-06T15:20:41.142900Z

ok

thheller 2020-01-06T15:21:08.143100Z

kind of ... you have it in both right now. if you want both than libraries in the same category (eg. workspaces) should also be in both

alexmiller 2020-01-06T15:23:01.143300Z

does it make sense for these two to be separate questions?

2020-01-06T15:25:47.143500Z

It’s an area that still feels like it has a lot of sharp edges, I’m ok dealing with it if it’s not a priority, but otherwise would be good to know that I should be highlighting issues or picking things to work on =)…

thheller 2020-01-06T15:28:08.143700Z

hmm might be best to just have one

alexmiller 2020-01-06T15:28:27.143900Z

I've tweaked the portability answer in the "What has been most frustrating or has prevented you from using ClojureScript more than you do now?" to include it explicitly

1
alexmiller 2020-01-06T15:29:04.144100Z

"Which ClojureScript tools do you use for interactive development and testing?"

thheller 2020-01-06T15:29:09.144300Z

there is a lot of overlap after all. you could be using devcards with shadow-cljs or figwheel after all.

thheller 2020-01-06T15:29:31.144500Z

or you make a separate question focusing on the build tools

thheller 2020-01-06T15:29:39.144700Z

and the other for more generic development "tools"

alexmiller 2020-01-06T15:29:44.144900Z

I have separate questions for those

alexmiller 2020-01-06T15:30:21.145100Z

specifically for "deps definition and download" and one for "creating project artifacts"

thheller 2020-01-06T15:31:00.145300Z

ah ok

alexmiller 2020-01-06T15:31:30.145500Z

I will probably post those later, getting some feedback internally on those first

thheller 2020-01-06T15:32:28.145800Z

yeah I would probably combine those 2 questions then. otherwise you just keep repeating tools that cover those aspects and more (eg. shadow-cljs or figwheel)

alexmiller 2020-01-06T15:34:28.146300Z

or combined variant:

* Q: Which ClojureScript tools do you use for interactive development and testing?
** cljs.main
** ClojureScript's built-in REPLs
** Headless browser (or actual browser)
** Node.js
** Nashorn
** Phantom
** Figwheel Classic
** Figwheel Main
** lein-cljsbuild's command-line REPL
** shadow-cljs
** doo
** Karma
** Kaocha
** Dirac
** Devcards
** nubank/workspaces
** cljs-devtools
** Other [open response]

alexmiller 2020-01-06T15:34:48.146500Z

(multi-select question)

thheller 2020-01-06T15:35:52.146800Z

> Q: Which ClojureScript tools/libraries do you use for interactive development and testing?

thheller 2020-01-06T15:37:30.148200Z

dunno if it makes sense to separate but in my view some of these don't qualify as "tools", rather something you use with those tools.

alexmiller 2020-01-06T15:38:03.148500Z

kind of taking a big tent approach here

thheller 2020-01-06T15:38:24.148900Z

yeah, just meant the wording of the question

thheller 2020-01-06T15:38:53.149700Z

its fine really ... nevermind me 😛

alexmiller 2020-01-06T15:39:20.150300Z

both of the original questions (about CLJS repls and CLJS testing) were specifically added to assess the status quo wrt how people were doing these things (and pre-dated things like Figwheel)

thheller 2020-01-06T15:40:04.151600Z

yeah there is lots of overlap in the answers so I guess its kinda difficult to have "generic" answers

thheller 2020-01-06T15:40:16.152100Z

eg. when using karma you are likely using a headless browser

thheller 2020-01-06T15:40:39.152900Z

or when using kaocha I think you that wraps doo ... which wraps a headless browser

thheller 2020-01-06T15:41:12.154100Z

but its good to list stuff that people may also be using separately with handmade tools

alexmiller 2020-01-06T15:42:05.155100Z

I'm looking at changing them because I no longer felt like the REPL question was actually reflecting how people work. yes, they use REPLs, but in the context of larger environments or in combination with other things (and maybe not even just on ekind of RPEL). Maybe similarly for testing where something like Devcards seems to be equally as useful, but very different in some ways than traditional "test runners".

alexmiller 2020-01-06T15:42:57.156400Z

so my meta question is: what questions are useful to ask to assess how people work with developing ClojureScript apps?

2020-01-06T15:43:22.156900Z

Part of this is also tooling I think, I didn’t realise the value of a clojure repl vs say a python interpreter until I could get inline send form to repl working, it’s still really not great in clojurescript in my experience… IE, people with different workflows will have wildly varying perspectives…

alexmiller 2020-01-06T15:44:19.157700Z

I would like the results of this question or questions to answer "how do people usually work with ClojureScript?"

alexmiller 2020-01-06T15:50:42.160800Z

are there families of toolsets that would make sense to combine?

thheller 2020-01-06T15:53:49.162Z

assuming you already have a separate question regarding build tools it might make sense to not repeat them in that question

thheller 2020-01-06T15:54:24.162700Z

and instead focus on the feature they provide, eg. "Hot-Reload" provided by the build tool (figwheel or shadow-cljs)

thheller 2020-01-06T15:54:40.163Z

same for REPL

thheller 2020-01-06T15:57:17.165Z

hot-reload is a big part of my workflow ... I barely use the REPL for CLJS yet the REPL is my primary tool for CLJ

dpsutton 2020-01-06T15:57:17.165100Z

npm usage versus cljsjs?

alexmiller 2020-01-06T15:58:52.166300Z

for accessing js libs?

thheller 2020-01-06T15:58:53.166400Z

yeah that would be interesting too. I would be curious to see how many actually use the recommended webpack+cljs.main combination vs cljs.main+cljsjs

2020-01-06T15:59:20.166800Z

Is webpack+cljs.main recommended? I don’t think I’ve ever seen this…

thheller 2020-01-06T15:59:45.166900Z

https://clojurescript.org/guides/webpack

alexmiller 2020-01-06T16:00:53.167300Z

is this a dep mgmt question?

alexmiller 2020-01-06T16:01:11.167700Z

where are the deps defined in any of these cases?

thheller 2020-01-06T16:01:39.168200Z

package.json with npm or yarn. when using shadow-cljs or cljs.main + webpack

2020-01-06T16:01:42.168300Z

Ah, I was under the impression that was more of a, for those who wish to use it this way, rather than, this is how you should do it

thheller 2020-01-06T16:03:03.168600Z

well "should do it" is dependent on what you are doing 😛

alexmiller 2020-01-06T16:04:34.169500Z

so as additional options to "What tools do you use to define and download your dependencies?"

** npm (package.json)
** shadow-cljs and yarn
** webpack and cljs.main

alexmiller 2020-01-06T16:05:16.170200Z

(other options are more java focused - clj, lein, boot, maven, etc)

thheller 2020-01-06T16:05:50.171Z

sorry. JS deps are always managed by either npm or yarn (which both define the dependencies in package.json)

thheller 2020-01-06T16:06:21.171800Z

you typically use one of those and then consume the packages with either shadow-cljs OR cljs.main+webpack

alexmiller 2020-01-06T16:06:32.172100Z

can you help me rewrite those answers?

2020-01-06T16:06:36.172200Z

well most of my work development is clojurescript in browser…

thheller 2020-01-06T16:07:23.173100Z

define/download is only npm or yarn

alexmiller 2020-01-06T16:07:34.173400Z

I guess for the purposes of that question, probably only npm or yarn (package.json)

thheller 2020-01-06T16:08:17.173600Z

yes

alexmiller 2020-01-06T16:09:38.174400Z

I have another question "What tools do you use to create project artifacts for release/deployment?" and I will have both shadow-cljs and cljs.main in there

thheller 2020-01-06T16:10:34.175Z

do you have shadow-cljs in the "define and download dependencies"? it can do that as well 🙂

alexmiller 2020-01-06T16:11:13.175300Z

where are they defined in that case?

thheller 2020-01-06T16:11:32.175400Z

yeah I meant more in the direction of which kind of JS you are consuming

thheller 2020-01-06T16:12:08.175600Z

it you are just using react via CLJSJS that is fine. but if you use 20 different packages from npm you'd probably not use CLJSJS but rather shadow-cljs or webpack+cljs.main

thheller 2020-01-06T16:12:37.176300Z

shadow-cljs.edn :dependencies. same format as lein :dependencies (same library in fact, pomegranate)

2020-01-06T16:13:04.176400Z

That makes sense.

thheller 2020-01-06T16:14:15.177600Z

lots of people use shadow-cljs either standalone or with deps.edn/project.clj. would be interesting for me to see some numbers behind that 🙂

dazld 2020-01-06T16:34:07.179100Z

@alexmiller we use cypress as well for testing UI flows in the browser - i’m not sure if that’s helpful for this survey though

dazld 2020-01-06T16:35:07.179800Z

i guess that’d be in the open response bit

alexmiller 2020-01-06T16:37:58.180500Z

a few people mentioned that in last year's open responses but not enough that I had added it

alexmiller 2020-01-06T16:38:15.181Z

by "a few" I mean like 3

dazld 2020-01-06T16:38:30.181400Z

np, it’s a generic browser testing tool

dazld 2020-01-06T16:38:44.181700Z

i’d love to know more about how people handle errors / failed computations

dazld 2020-01-06T16:39:00.182Z

nil punning? bail on false? exceptions? failjure?

dazld 2020-01-06T16:40:01.182800Z

nested ifs? 😄

alexmiller 2020-01-06T16:40:08.183Z

sorry, not going to expand to things like that

dazld 2020-01-06T16:40:14.183200Z

fair enough.

alexmiller 2020-01-06T16:40:34.183500Z

nil punning and exceptions are both idiomatic in clj / cljs

alexmiller 2020-01-06T16:41:37.184700Z

condition systems and monadic failures are not idiomatic, but feasible and some people do those

dazld 2020-01-06T16:42:48.185700Z

i guess it’s another discussion

dazld 2020-01-06T16:42:53.185900Z

interesting one though

dazld 2020-01-06T16:43:31.186300Z

doing it cross platform too..

dazld 2020-01-06T16:43:33.186500Z

anyway

Filipe Silva 2020-01-06T17:28:25.188200Z

phantom falls under the category of Headless browser (or actual browser) , doesn't it?