clj-suitable icon indicating copy to clipboard operation
clj-suitable copied to clipboard

Shadow compat no longer necessary?

Open vemv opened this issue 2 years ago • 6 comments

Given

https://github.com/thheller/shadow-cljs/blob/51b15dd52c74f1c504010f00cb84372bc2696a4d/src/main/shadow/cljs/devtools/server/nrepl_impl.clj#L46-L59

, I believe it's no longer necessary to have shadow-cljs specific code.

vemv avatar Jul 22 '23 11:07 vemv

@vemv Can you elaborate on this? This bit of piggieback interface has existed in Shadow forever. (since before suitable was created)

bbatsov avatar Jul 22 '23 12:07 bbatsov

Hmm, that was unexpected :)

If that bit has always existed, then why is shadow-specific code needed at all?

Maybe that bit doesn't work as intended?

I'll be looking at this, mainly because in cider-nrepl we only use piggieback-based cljs stuff. And some features doesn't appear to work.

So cider-nrepl would have to be fixed some way or another (fix the piggieback compat or introduce suitable-like compat to cider-nrepl code).

vemv avatar Jul 22 '23 12:07 vemv

We don't use anything else just because I didn't want to bother to learn shadow's API and Tomas (the author of Shadow) was kind enough to offer this basic compatibility. :-) In an ideal world we use shadow's own nREPL middleware, as it provides full access to shadow's functionality. I recall not everything was working properly with the piggieback adapter, but I haven't touched the ClojureScript code in cider-nrepl in ages and I've started to forget the details.

bbatsov avatar Jul 22 '23 12:07 bbatsov

See https://github.com/thheller/shadow-cljs/issues/62 and https://github.com/thheller/shadow-cljs/issues/561 Those are most useful discussions related to the nREPL support in shadow I could find now.

bbatsov avatar Jul 22 '23 12:07 bbatsov

Thanks much!

I'll also check out https://github.com/thheller/shadow-cljs/blob/51b15dd52c74f1c504010f00cb84372bc2696a4d/src/main/shadow/cljs/devtools/server/nrepl.clj to see what it exactly does.

vemv avatar Jul 22 '23 12:07 vemv

One thing I've just realised is that cider-nrepl and refactor-nrepl use cider.nrepl.middleware.util.cljs/grab-cljs-env, suitable doesn't

Perhaps using it here would simplify some code.

vemv avatar Jul 24 '23 08:07 vemv