Stop auto-wiring piggieback via :requires magic

Aperta
#443 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
58/100
Tipo di issue
Refactoring
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
clojure
Ambito
tooling

Direzione di ricerca

Inizia da refactor-nrepl.middleware/wrap-refactor e individua maybe-require-piggieback, quindi esamina refactor-nrepl.ns.resolve-missing-test e la relativa configurazione di session-fixture/default-handler. Esegui il test indicato tracciando quando viene avviato il server e quando viene applicato il binding di piggieback. Il lavoro è completato quando il descrittore non dipende più dall'iniezione automatica di piggieback e il test continua a passare; la modifica facoltativa di grab-cljs-env è separata.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Right now refactor-nrepl.middleware/wrap-refactor declares #'cider.piggieback/wrap-cljs-repl in its descriptor's :requires set whenever piggieback happens to be on the classpath. nREPL responds to this by warning that piggieback isn't in the middleware list and then injecting it automatically (extended-descriptors in nrepl.middleware, marked TODO: stop adding missing deps in future versions.).

This is exactly the kind of magic that cider-nrepl 0.59 set out to remove with PR #971 — they deprecated their own requires-piggieback helper to a no-op for the same reason. We're currently leaning on the deprecated nREPL behavior instead, just inlined locally.

Cleaner direction:

  1. Delete maybe-require-piggieback and don't put piggieback into :requires. The wrap-refactor descriptor stays piggieback-free.
  2. The only test that needs cljs is refactor-nrepl.ns.resolve-missing-test. Its fixture already passes piggieback to default-handler, but the rebinding happens after session-fixture has already started the server, so the binding doesn't take effect. The fixture currently "works" only because nREPL auto-injects piggieback. Restructure it to start the server inside the binding (or stop composing with the default session-fixture for this test).
  3. Optional: inline cider.nrepl.middleware.util.cljs/grab-cljs-env inside refactor-nrepl.ns.resolve-missing so we no longer depend on cider-nrepl's util/cljs namespace at all.

Not urgent — the current setup works on cider-nrepl 0.59 and the test passes locally and in CI. But extended-descriptors is on borrowed time so it's worth doing before nREPL drops it.

Lingua principale
Clojure
Stelle
261
Fork
68
Merge medio
10h 36m
PR unite (30g)
8

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di clojure-emacs/refactor-nrepl

Tutte le issue di clojure-emacs/refactor-nrepl

Issue simili

Altre issue su Clojure

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.