jonpither / cider-spy

Multi person REPL & lets developers share information on CIDER nREPL sessions
22 stars 4 forks source link

Auto connect NREPL to HUB #7

Closed jonpither closed 10 years ago

jonpither commented 10 years ago

Rightnow the whole only works if CIDER-SPY is present. This is a big barrier to entry, as users are only visible if they have the Emacs package.

The middleware should auto connect to the HUB, so when someone installs CIDER-SPY they can see where other devs are, even if those other devs aren't using the package.

jonpither commented 10 years ago

Done.

jonpither commented 10 years ago

Musing from README:

(This rumination is the start of a section in the docs that explains the thought process behind auto-subscribing everyone to participate in the CIDER-SPY-HUB. People will be rightfully worried about auto connecting and being spied on.)

The config cider-spy-hub-endpoint is a project based setting, not a personalised one. Therefore it shouldn't live in some personal Emacs config, it should live in the project root of the Clojure project.

This has the added benefit the NREPL middleware to CIDER-SPY-HUB communication can work without a dependency on the CIDER-SPY Emacs package feeding it config. When devs install CIDER-SPY they can then can see where other devs are, without the other devs having to install CIDER-SPY. This lowers barrier to entry.

If this is too intrusive, i.e. devs resent being spied on without their knowledge, then there are two answers: 1) The use of CIDER-SPY-HUB is a centralised project setting and should be team decision to adopt, and 2) we could implement a feature where the individual user can opt out*.

Where to put the centralised cider-spy-hub-endpoint config? I don't think it's right to put in project.clj and TBH I'm not sure how either - this is build time config. Perhaps then just stick a .cider-spy-root file in the project root. This looks to be an established pattern, i.e. .projectile, .gitignore etc.

Another config option is to use ENVIRON to allow users another chance at overriding the central project settings in .cider-spy-root. A further option is to use ENVIRON full stop and cut out the middle file. The downside of this is that whereas .cider-spy-root can be version controlled as a centralised project setting, the .lein file generated by ENVIRON shouldn't be as it typically contains personalised settings.