-
Notifications
You must be signed in to change notification settings - Fork 111
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
Can I keep cljsjs requires when using "clean ns" ? #275
Comments
No, but now that you've taught me about these, I might teach Do all of these start with the prefix |
Secret goal achieved, thanks :) cljsjs is unfortunately not the only way to have external dependencies loaded. A project may use its own externs file which specifies to the closure compiler what things exist in the native js libraries too. For starters cljsjs would be a great start I think! A suggestion: is it possible to have metadata for the requires? I'm thinking of a special metadata key that would cause |
Oops, in the last message I meant not pruning anything from cljsjs would be a great start. Just noticed it's not very clear in the message. |
Yeah, but it kind of sucks that source code has to be changed just to please a refactoring tool. My guess is that just ignoring cljsjs dependencies will be a pretty good first step. Teaching refactor-nrepl how to read boot.clj and project.clj files to learn about externs in general seems quite difficult :/ |
Thanks for taking the time to do this! I'll get to using it soon I think.
|
Well, I tested it in practice and it seems to work correctly. Thanks again! ❤️ |
Thanks for giving it a spin! 👍 |
Hi, cljsjs provides, as you might know, javascript native packages wrapped with support for clojurescript and the Google closure compiler. The way to use these is to
(:require [cljsjs.js-yaml])
which does not add a real namespace (to my understanding) but only requires the native js. Requiring external libraries/functions this way is pretty easy, as they are accessible fromjs/jsyaml.safeLoad
for example.Clean ns does not understand these requires and deletes them since they are not used (and I don't blame it, they are special). Is there a way I could clean my ns form and keep these special requires around?
The text was updated successfully, but these errors were encountered: