This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-06-03
Channels
- # admin-announcements (2)
- # alda (4)
- # beginners (15)
- # boot (89)
- # cljs-dev (88)
- # cljsrn (75)
- # clojure (149)
- # clojure-belgium (16)
- # clojure-france (2)
- # clojure-greece (6)
- # clojure-russia (108)
- # clojure-spec (39)
- # clojure-taiwan (3)
- # clojure-uk (7)
- # clojurescript (70)
- # css (3)
- # cursive (17)
- # data-science (2)
- # datascript (7)
- # datomic (41)
- # dirac (3)
- # hoplon (12)
- # instaparse (1)
- # juxt (3)
- # lambdaisland (9)
- # mount (4)
- # off-topic (6)
- # om (71)
- # om-next (4)
- # onyx (22)
- # other-languages (56)
- # perun (15)
- # proton (6)
- # re-frame (32)
- # reagent (42)
- # specter (34)
- # spirituality-ethics (7)
- # tmp-json-parsing (5)
- # untangled (13)
- # vim (4)
- # yada (6)
Yea that would still be last resort
@juhoteperi: I was able to achieve what I wanted by writing a modified cljs-repl
task
one that doesn’t actually start a new REPL server, so that I can take advantage of the one I’ve got already
any possibility we could separate the cljs-repl
task in 2?
in particular, I’d want all the setup minus this part https://github.com/adzerk-oss/boot-cljs-repl/blob/master/src/adzerk/boot_cljs_repl.clj#L168-L170
actually that might not be enough
There might be some chance, it could make sense to use separate cljs-repl with normal Boot repl task
I would need to specify a connection string here: https://github.com/adzerk-oss/boot-cljs-repl/blob/master/src/adzerk/boot_cljs_repl.clj#L166
BUT, project task setup shouldn't be specific to one development env
So I'm not sure if this is a correct solution for Cider setup
I’m not suggesting making anything specific to cider
but rather decomposing that big thing into something that I could assemble in some other way if I wanted to
I can always write my own task to do this but I would be copying 90% or more of that task’s code
But the project you assemble would be specific to Cider?
I would prefer that cljs-repl is a thing that can be used to assemble projects that work with all environments
I’m not sure I understand the question, but let’s say my task is just setting the weasel environment for the build.
I’d call it cljs-repl-env
and this would be my build
(comp
(watch)
(repl-env) <— here
(reload)
(speak)
(less)
(cljs :source-map true)
I could definitely just hook up cljs-repl
in place of repl-env
so I don’t think it’s specific to cider
Yeah, and that pipeline would be setup in your project's build.boot?
I omitted the deftask
part
what I’m suggesting is that there is e.g. a repl-env
standalone task, and that the cljs-repl
task would comp
that with the builtin repl
one
such that users who don’t want to spawn a new nREPL server are able to do that
So it would work fine for you, but not necessarily for Cursive or Fireplace users
It is possible that the project is only developed by Cider users so it is not a problem
But for open source and such projects (and generally) it is good idea that stuff in build.boot would be usable for evereyone
It is not possible always, but I think it's a good objective
so what you’re saying is I should just write a task that fits my particular use case?
What I'm trying to say that I would like if the same task worked for everyone
Or something like that, I'm not sure anymore what I'm trying to say :D:D
@juhoteperi: OK let me try to explain myself better
Hmm, I think my co-workers using Cider are just running Boot in Terminal
Possible because I have enforced my Boot pipelines to them... 😄
As per my suggestion, users would get the same functionality from the cljs-repl
task, even with my modification
but the cljs-repl
task would be a composition of the builtin repl
task, and the one I’m proposing, which just sets up a weasel environment
this way I would be able to just call that new one without creating an unnecessary nREPL server
But I didn’t understand if that would be a good idea or not
@anmonteiro: It is a solution and if you make a clean PR I'll probably accept it
@juhoteperi: sounds good!
Maybe this gist better explains my thoughts: https://gist.github.com/Deraen/8c71ac076e6713f7350d2988a60a22ae
any contribution guidelines I should be aware before starting?
Hmm, boot-cljs-repl seems to be missing CONTRIBUTING.md, you can check the one from boot-cljs and other projects
How do Cider users use Figwheel? In terminal?
@juhoteperi: I don’t know, by the looks of it my workflow seems to be different since no one has posed these questions before?
I normally have a file like this one: https://github.com/omcljs/om/blob/master/script/figwheel.clj
and evaluate it in the REPL after cider-jack-in
switching between CLJ / CLJS REPLs is as simple as :cljs/quit
and (ra/cljs-repl)
I don’t really have any terminal windows open when I’m developing Clojure(Script)
only for building / deploying production stuff
Yeah either other Cider users are just running Boot in terminal, or are not using Cljs repl, or haven't just noticed the discussion yet 🙂
for me it’s really great to have the CIDER REPL buffer because I can evaluate S-expressions to it with a key binding
that’s why I like to have both my CLJ and CLJS REPLs there
@juhoteperi: what do you mean by this part in your gist?
it causes the environment specific configuration
;; to leak into build.boot
Sure, but that should be possible even if you connect to nREPL started by Boot running in terminal
right, so the main difference here is probably that I don’t have a terminal to which I cider-connect
to
@anmonteiro: If the project has developers using e.g. cider and figwheel, you need two different tasks
ah gotcha
;; 1) Add cljs-repl-env anyway, as it is not necessarily anymore env specific than current task
;; 2) Somehow automatically decide if cljs-repl should start a new repl?
1. what we were talking about
2. doesn’t really solve the problem of not leaking env into build.bootre: 2. if it was a param, for example
It might be possible to check if task is being run inside nREPL already, but that's not probably a good idea
@juhoteperi: there might be unforeseen use cases, and that would definitely be leaking environment details into boot-cljs-repl
😄
@juhoteperi: not sure if I can make this work for the general case.
https://github.com/adzerk-oss/boot-cljs-repl/blob/master/src/adzerk/boot_cljs_repl.clj#L166
I’d have to hardcode a port there I think
because it won’t be able to write the next one that’s called after start-repl
I think because it’s not in a pipeline, it won’t know where to write to
¯\(ツ)/¯
I think you can move it to inside the pipleline, but you need to use something to make it run only once, delay, atom etc.
no I was wrong
it’s possible without modifying that line
yes at the moment in lambone I have two nrepls as well, which is unfortunate
I noticed that if I use the boot-cljs-repl
one only, for some reason tools.namespace../refresh
does not work anymore...I did not have to to check boot-ctd
though
@richiardiandrea: what’s boot-ctd
?
wait, maybe it is not the right name
@juhoteperi: ^^ submitted this for initial feedback. Let me know if there’s anything that doesn’t look so good
oh great!
About the cider workflow: cider-jackin-clojurescript
bootstraps two buffers (on the same nrepl) one for clj and the other for cljs
So you don't usually switch between them in the same buffer ...I personally have two nrepls running in the same JVM in lambone
This is because the backend deps are in nrepl for clj and frontend deps are in nrepl for cljs
However I used the previous single-nrepl approach for long time