Fork me on GitHub
#boot
<
2016-06-03
>
raynes00:06:54

open the terminal inside of Emacs

raynes00:06:00

It'll make ya feel better

anmonteiro09:06:47

Yea that would still be last resort

anmonteiro14:06:14

@juhoteperi: I was able to achieve what I wanted by writing a modified cljs-repl task

anmonteiro14:06:42

one that doesn’t actually start a new REPL server, so that I can take advantage of the one I’ve got already

anmonteiro14:06:42

any possibility we could separate the cljs-repl task in 2?

anmonteiro14:06:19

actually that might not be enough

juhoteperi14:06:38

There might be some chance, it could make sense to use separate cljs-repl with normal Boot repl task

juhoteperi14:06:07

BUT, project task setup shouldn't be specific to one development env

juhoteperi14:06:24

So I'm not sure if this is a correct solution for Cider setup

anmonteiro14:06:07

I’m not suggesting making anything specific to cider

anmonteiro14:06:31

but rather decomposing that big thing into something that I could assemble in some other way if I wanted to

anmonteiro14:06:21

I can always write my own task to do this but I would be copying 90% or more of that task’s code

juhoteperi14:06:35

But the project you assemble would be specific to Cider?

juhoteperi14:06:54

I would prefer that cljs-repl is a thing that can be used to assemble projects that work with all environments

anmonteiro14:06:13

I’m not sure I understand the question, but let’s say my task is just setting the weasel environment for the build.

anmonteiro14:06:22

I’d call it cljs-repl-env

anmonteiro14:06:40

and this would be my build

(comp
    (watch)
    (repl-env) <— here
    (reload)
    (speak)
    (less)
    (cljs :source-map true)

anmonteiro14:06:58

I could definitely just hook up cljs-repl in place of repl-env so I don’t think it’s specific to cider

juhoteperi14:06:10

Yeah, and that pipeline would be setup in your project's build.boot?

anmonteiro14:06:29

I omitted the deftask part

anmonteiro14:06:04

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

anmonteiro14:06:28

such that users who don’t want to spawn a new nREPL server are able to do that

juhoteperi14:06:30

So it would work fine for you, but not necessarily for Cursive or Fireplace users

juhoteperi14:06:44

It is possible that the project is only developed by Cider users so it is not a problem

juhoteperi14:06:07

But for open source and such projects (and generally) it is good idea that stuff in build.boot would be usable for evereyone

juhoteperi14:06:06

It is not possible always, but I think it's a good objective

anmonteiro14:06:34

so what you’re saying is I should just write a task that fits my particular use case?

juhoteperi14:06:17

What I'm trying to say that I would like if the same task worked for everyone

juhoteperi14:06:31

Or something like that, I'm not sure anymore what I'm trying to say :D:D

anmonteiro14:06:29

@juhoteperi: OK let me try to explain myself better

juhoteperi14:06:32

Hmm, I think my co-workers using Cider are just running Boot in Terminal

juhoteperi14:06:03

Possible because I have enforced my Boot pipelines to them... 😄

anmonteiro14:06:18

As per my suggestion, users would get the same functionality from the cljs-repl task, even with my modification

anmonteiro14:06:02

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

anmonteiro14:06:05

this way I would be able to just call that new one without creating an unnecessary nREPL server

anmonteiro14:06:57

But I didn’t understand if that would be a good idea or not

juhoteperi15:06:47

@anmonteiro: It is a solution and if you make a clean PR I'll probably accept it

anmonteiro15:06:49

any contribution guidelines I should be aware before starting?

juhoteperi15:06:57

Hmm, boot-cljs-repl seems to be missing CONTRIBUTING.md, you can check the one from boot-cljs and other projects

juhoteperi15:06:27

How do Cider users use Figwheel? In terminal?

anmonteiro15:06:24

@juhoteperi: I don’t know, by the looks of it my workflow seems to be different since no one has posed these questions before?

anmonteiro15:06:45

and evaluate it in the REPL after cider-jack-in

anmonteiro15:06:17

switching between CLJ / CLJS REPLs is as simple as :cljs/quit and (ra/cljs-repl)

anmonteiro15:06:36

I don’t really have any terminal windows open when I’m developing Clojure(Script)

anmonteiro15:06:50

only for building / deploying production stuff

juhoteperi15:06:54

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 🙂

anmonteiro15:06:34

for me it’s really great to have the CIDER REPL buffer because I can evaluate S-expressions to it with a key binding

anmonteiro15:06:45

that’s why I like to have both my CLJ and CLJS REPLs there

anmonteiro15:06:23

@juhoteperi: what do you mean by this part in your gist?

it causes the environment specific configuration 
;; to leak into build.boot

juhoteperi15:06:26

Sure, but that should be possible even if you connect to nREPL started by Boot running in terminal

anmonteiro15:06:00

right, so the main difference here is probably that I don’t have a terminal to which I cider-connect to

juhoteperi15:06:02

@anmonteiro: If the project has developers using e.g. cider and figwheel, you need two different tasks

anmonteiro15:06:36

;; 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.boot

anmonteiro15:06:19

re: 2. if it was a param, for example

juhoteperi15:06:50

It might be possible to check if task is being run inside nREPL already, but that's not probably a good idea

anmonteiro15:06:40

@juhoteperi: there might be unforeseen use cases, and that would definitely be leaking environment details into boot-cljs-repl 😄

anmonteiro15:06:04

@juhoteperi: not sure if I can make this work for the general case.

anmonteiro15:06:23

I’d have to hardcode a port there I think

anmonteiro15:06:52

because it won’t be able to write the next one that’s called after start-repl

anmonteiro15:06:14

I think because it’s not in a pipeline, it won’t know where to write to

juhoteperi15:06:01

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.

anmonteiro16:06:03

no I was wrong

anmonteiro16:06:08

it’s possible without modifying that line

richiardiandrea16:06:58

yes at the moment in lambone I have two nrepls as well, which is unfortunate

richiardiandrea16:06:49

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

richiardiandrea16:06:12

wait, maybe it is not the right name

anmonteiro16:06:17

@juhoteperi: ^^ submitted this for initial feedback. Let me know if there’s anything that doesn’t look so good

richiardiandrea22:06:28

About the cider workflow: cider-jackin-clojurescript bootstraps two buffers (on the same nrepl) one for clj and the other for cljs

richiardiandrea22:06:34

So you don't usually switch between them in the same buffer ...I personally have two nrepls running in the same JVM in lambone

richiardiandrea22:06:10

This is because the backend deps are in nrepl for clj and frontend deps are in nrepl for cljs

richiardiandrea22:06:51

However I used the previous single-nrepl approach for long time