Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use fallback for magic requires when there's no middlware #559

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

a13
Copy link

@a13 a13 commented Jan 18, 2025

added a new defcustom cljr-magic-requires-fallback defcustom, so we can generate require expressions (from cljr-magic-require-namespaces) even if middleware is not available for some reason (e.g. when using babashka)

  • also, I updated cljr-magic-require-namespaces with more idiomatic aliases from The Clojure Style Guide.

  • The commits are consistent with our contribution guidelines

  • You've added tests (if possible) to cover your change(s)

  • The new code is not generating byte compile warnings (run cask exec emacs -batch -Q -L . -eval "(progn (setq byte-compile-error-on-warn t) (batch-byte-compile))" clj-refactor.el)

  • All tests are passing (run ./run-tests.sh)

  • You've updated the changelog (if adding/changing user-visible functionality)

  • You've updated the readme (if adding/changing user-visible functionality)

Copy link
Member

@vemv vemv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @a13 !

Thanks for the PR.

From my side I literally don't have the time in my hands to do a careful review.

My first instinct would be not to like the change because there's a lot of smartness in the middleware, and I wouldn't want users to miss out on that.

It's also the overall philosophy of CIDER - require an active connection to use most of the features.

To make matters more complicated, babasha-nrepl doesn't use the traditional nrepl middleware design, so refactor-nrepl cannot work there.

I don't have a definitive opinion on how to proceed.

Perhaps one can simply observe that most time one has at least one repl open. And that one could write .cljc files that work with bb and JVM alike, with reader conditionals. So that would work and could be documented.

Cheers - V

Comment on lines +109 to +113
("p" . "clojure.core.protocols")
("pp" . "clojure.pprint")
("r" . "clojure.core.reducers")
("s" . "clojure.spec.alpha")
("set" . "clojure.set")
Copy link
Member

@vemv vemv Jan 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These almost certainly will conflict will real-world preferences/usages from users out there, so I'd rather leave them untouched.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants