Stop auto-wiring piggieback via :requires magic

未关闭
#443 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
58/100
Issue 类型
重构
描述清晰度
基本清楚
活跃度
冷清
技术栈
clojure
领域
tooling

调研方向

从 refactor-nrepl.middleware/wrap-refactor 开始,定位 maybe-require-piggieback,然后检查 refactor-nrepl.ns.resolve-missing-test 及其 session-fixture/default-handler 设置。在跟踪服务器何时启动以及 piggieback binding 何时应用的同时,运行指定的测试。完成的标准是 descriptor 不再依赖自动注入 piggieback,且测试仍然通过;可选的 grab-cljs-env 更改是独立的。

由索引模型根据 Issue 内容生成。

描述

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.

主要语言
Clojure
星标
261
派生
68
平均合并
10 小时 36 分钟
30 天内合并 PR
8

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

clojure-emacs/refactor-nrepl 的其他 Issue

查看 clojure-emacs/refactor-nrepl 的全部 Issue

相似的 Issue

更多 Clojure Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。