vim-iced icon indicating copy to clipboard operation
vim-iced copied to clipboard

Support dynamic-loader

Open liquidz opened this issue 5 years ago • 3 comments

https://github.com/nrepl/nrepl/pull/185

liquidz avatar May 11 '20 06:05 liquidz

need to rethink how to use it in which situations and what value it provides.

liquidz avatar Sep 04 '20 23:09 liquidz

For me the main use case it pretty-straightforward - you bundle all the Clojure deps (e.g. middleware) with the client package and the client loads those when it starts. This eliminates the need for you to craft special Lein/Boot/clj invocations to provide the deps in this manner.

More importantly, if the deps are packaged with the plugin, you can inject them in remote connections that you didn't start and that you don't control the dependencies of. This also makes it simpler for other plugins to load their library deps/middleware on the demand, without having to fiddle with the jack-in commands.

bbatsov avatar Aug 26 '21 06:08 bbatsov

This will be a super useful feature! Especially when iced needs its own middleware in addition to cider-nrepl (which I expect to be found in most places with nrepl). Supporting dynamic middleware loading will make it possible for iced to connect to basically every running nREPL instances.

For the downsides, I learned from this article https://lambdaisland.com/blog/2021-11-24-making-nrepl-cider-more-dynamic-2 that sideloading may hurt performance if the nREPL connection is not local. Nevertheless, the ability to connect to running servers without modifying its dependencies would still outweigh the drawback, IMO.

After taking a look at iced-nrepl, I also found it's basically independent from other cider-nrepl or nrepl features. So maybe another way to obtain the ability is to make a "proxy" connection, i.e. vim-iced will spawn an iced-nrepl process, which will handle all iced-specific ops locally, and forward everything else to the remote cider-nrepl instance?

Cnly avatar Dec 18 '21 16:12 Cnly