Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Feature request: optional middleware

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

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
35/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
clojure
领域
cli

调研方向

定位 CLI REPL 从其配置(deps.edn/.cljconf 启动路径)加载 :middleware 的位置,以及每个中间件符号被解析或 require 的位置。第一项任务:与维护者确定两个候选设置中采用哪一个(:missing-middleware vs :optional-middleware),因为 issue 对此留有余地。完成标准:无法解析的中间件可以被忽略或给出警告,而不是抛出异常,默认行为保持不变,并通过运行项目现有的测试套件进行验证。

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

描述

Being able to control what dependencies are available via aliases (defined in deps.edn) is a convenient way to influencer the behavior of tooling: "use this dependency, if it is available on the classpath, else fallback to this other behavior".

For a long time, my own "REPL starter" library uses the availability of certain nses to control which tooling it configures at startup.

Since I wanted that behavior for the CLI REPL—especially if I am going to replace my own custom "REPL starter" with it—I find myself writing conditional loaders for middleware. See my CLI REPL middleware for examples of this for Portal and rephrase.

If there was a way to specify to the CLI REPL that middleware was optional, I wouldn't need to do this: the CLI REPL could attempt to call requiring-resolve on the middleware symbol and if it fails, could either throw (effectively the current behavior) or warn/ignore (possible new behavior).

I don't have a preference for how this might work. I can imagine several solutions, so here are a couple:

  • a new configuration setting: :missing-middleware with values :throw (default), :warn (print to stderr), or :ignore
  • a new configuration setting: :optional-middleware like :middleware except that the optional items are ignored if they cannot be required/resolved
主要语言
Clojure
星标
20
派生
0
PR 合并指标
30 天内没有已合并 PR

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

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

clojure/clojure-cli.repl 的其他 Issue

查看 clojure/clojure-cli.repl 的全部 Issue

相似的 Issue

更多 Clojure Issue

把新 issue 发到你的邮箱

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