Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nrepl / cider-nrepl deps #115

Closed
genmeblog opened this issue Apr 14, 2022 · 6 comments
Closed

nrepl / cider-nrepl deps #115

genmeblog opened this issue Apr 14, 2022 · 6 comments

Comments

@genmeblog
Copy link

Shoudn't nrepl and cider-nrepl be considered as development dependencies and moved to a separate profile? Similarly to a logging issue (#114) it may interfere with local dev setup of the users of the library.

@jacobobryant
Copy link
Owner

Those deps are used for production nrepl connections. The ./task prod-repl and ./task prod-dev commands both open an ssh tunnel to the server for that purpose. They can always be added to :exclusions in deps.edn if needed though.

@genmeblog
Copy link
Author

Sure! I overlooked this feature. Maybe it's good to add some info in readme or docs? I mean that there is some risk, that these two deps can overwrite local dev environment. For example cider-jack-in in Emacs injects own nrepl/cider-nrepl versions (which can differ from biff deps). The risk of dependecies conflict is rather minimal but who knows...

@jacobobryant
Copy link
Owner

Hm yes...

cider-jack-in does that by starting the clj process itself right? Going that route is already a slight deviation from Biff's default dev process, since ./task dev starts the clj process and also calls the main function, which in a cider-jack-in workflow would normally be done manually right? i.e. run cider-jack-in, then go to a repl namespace and eval a form that starts the system. If the clj process is already running and the .nrepl-port file exists, I wonder if cider-jack-in would instead connect to the existing nrepl session? (Questions from a non-emacs user!)

On one hand, it's possible that Biff's ./task dev workflow will make people less likely to use cider-jack-in in the first place, thus reducing the probability of conflicts (if I'm understanding correctly?). On the other hand, I'm guessing some people will want to keep using a cider-jack-in workflow. In that case we may need a small section in the docs that discusses both how to set up an alias to exclude the nrepl deps in dev (but not in prod) and how to start the app from the repl after running cider-jack-in.

On the other other hand, facilitating cider-jack-in in dev will still not remove the need to have the correct nrepl dependencies in prod (unless you don't use the prod-repl or prod-dev commands), so maybe better to have the docs just tell people "yeah if you have conflicts you'll just have to add the correct versions to deps.edn manually, sorry about that."

At a minimum, I'll reopen this and if anyone runs into problems maybe they'll see this conversation and chime in.

@jacobobryant jacobobryant reopened this Apr 17, 2022
@jacobobryant
Copy link
Owner

Actually I just added a "Jacking in" subsection to the getting started docs: https://biffweb.com/docs/#jacking-in. I think that'll be sufficient.

@genmeblog
Copy link
Author

Looks sufficient, thanks. And yes, you can connect to a running repl form emacs without any problem. The only possible issue I see is the version mismatch between cider client in emacs and cider-nrepl in case you stop upgrading the version. But I don't think you need to worry about that now.

@jacobobryant
Copy link
Owner

Yeah--even so, no matter what we do, that would be a problem when connecting to the production nrepl server, so I think might as well have the recommended path for local dev be to set deps manually if you run into conflicts.

Actually it wouldn't take long to mention that in the docs. I've added it to the Jacking In section.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants