Fork me on GitHub
Johan Thorén07:09:48

An announcement of somewhat lesser scope.. is a tiny library to convert between and common time as we know it (year, month, day, etc.). The library supports two-way conversion and is available for both Clojure and ClojureScript.

🕑 22
👍 4

Addendum to yesterday's announcement about #clj-kondo, following up on the release of Clojure 1.11.0-alpha2: clj-kondo 2021.09.15 now supports :as-alias 🎉

partywombat 26
🖤 6
💯 10
clj-kondo 4

Does it also recognize update-keys and update-vals?


(and I guess there will need to be a clojure-lsp release using this in order for it to benefit Calva users @UKFSJSM38?)


@U04V70XH6 it should recognize this automatically when you lint clojure 1.11


but good point, I should update that in clj-kondo proper


Yes @U04V70XH6 it's already on clojure-lsp master, it should be available on next release


@UKFSJSM38 can you check if update-vals is recognized in a project with clojure 1.11?

👀 2

Thanks @UKFSJSM38 -- I asked because, for some reason, clojure-lsp had stopped running in my VS Code instance so I had to reload the "window" to restart it, and that made me curious as to which version is running: 2021.09.13-22.25.35, which uses clj-kondo 2021.08.07-SNAPSHOT


And that shows:

Unresolved symbol: update-keys


Tested with clojure-lsp master and it's working @U04V15CAJ


@U04V70XH6 even that version should work with update-keys iff you have .clj-kondo directory in that project so clj-kondo can save a cache of your linted deps

☝️ 2

@U04V15CAJ even so, if the user change the deps to use a newer clojure (1.11), clojure-lsp would scan the analysis with clj-kondo


I did this test with clojure-lsp and it worked, finding update-keys and update-vals


because any change to project.clj or deps.edn triggers a new clojure-lsp full scan


@UKFSJSM38 How does LSP run the scan? Does it need to know about aliases? I have a monorepo and everything is behind a couple of aliases so, right now LSP doesn't always seem to startup, until I refresh the VS Code window, and it isn't scanning. I even deleted .lsp/sqlite.db to try to force that.


you can configure the classpath-command for every project


For multiple custom aliases, the best would be to configure th :project-specs in LSP


{:cljfmt {:indents {#re ".*" ns [[:inner 0] [:inner 1]]}}
 :auto-add-ns-to-new-files? false
 :project-specs [{:project-path "deps.edn"
                  :classpath-cmd ["clojure" "-A:dev" "-Spath"]}]}

☝️ 2

copied from the docs


Yeah, just trying to set that up... So I have a monorepo where the Clojure code is in a subdirectory so it looks like this:

So I guess :project-path should be "clojure/deps.edn" but how would I get it to run :classpath-cmd in the clojure project or will that :project-path be sufficient to tell it that?


is your clojure code inside clojure folder? if so why not import the clojure folder as the project root?


then everything should work right?


No, we have lots of other stuff in the root of the repo so the "project root" is as shown above, and we run the REPL in the clojure folder.


and then under clojure we have lots of subproject folders, each containing src, test, etc. Those are brought in via the aliases. Here's my config.edn right now:

{:project-specs [{:project-path "clojure/deps.edn"
                  :classpath-cmd ["clojure" "-Spath" "-M:build:dev:everything:runner:test"]}]}
If I specify :source-aliases instead of :classpath-cmd will that help?


@U04V70XH6 I checked the clojure-lsp code, and it will probably don't work as we run the clojure command in the project-root:


so maybe we could improve clojure-lsp to accept an optional path to run the classpath lookup command


otherwise that would just work if for clojure you import the clojure folder for now


How about if I add a shell script that cd's to clojure and then runs the clojure -Spath ... command and tell LSP that's the :classpath-cmd ?


that could work :)


maybe we could improve clojure-lsp to check if the project-file is inside another subfolder not on root and run the classpath-cmd from that folder


That would also solve the problem 🙂


yeah, feel free to open an issue about that :) Also, let me know if the script that cd into the folder and run the clojure command works as well


OK, well that did seem to work. LSP started and -- after a much longer initialization period this time! -- reports problems that make more sense. And, in particular, update-vals and update-keys are no longer flagged as unresolved /cc @U04V15CAJ


the next startups should use the .lsp/.cache making it faster


I'm pleased to announce the release of martian 0.1.18 🎉 martian is the http abstraction library for Clojure/script with support for various http libraries, Swagger/OpenAPI, generative testing, VCR recording/playback and more! This release improves: • Errors thrown using the `hato` client are now handled by the interceptor chain This release changes: • An exception is now thrown if the route name is not found when calling an endpoint function - thanks • The `hato` dependency is updated to `0.8.2`

❤️ 14
🚀 8
👍 2
Karol Wójcik15:09:35

@U076R6N1L This a great library that I'm already using! Thank you for it! Do you maybe plan to use lighter version of http client for Clojurescript? I would rather not include clojure.core.async , 🙏

👍 2
Ben Sless15:09:01

I love the name


@UJ1339K2B thanks! do you know of any ring-compatible cljs http clients (apart from cljs-http, which as you point out uses core.async)?

Karol Wójcik16:09:30

Unfortunetely no. Which means you would have to write such library yourself


it could be a fork of cljs-http to be honest, it should only be a small change

Karol Wójcik16:09:43

Yeah. But probably you would have to release a new artifact for it

Jakub Holý (HolyJak)19:09:19

There is but I guess it is not ring-compatible, whatever that means

Karol Wójcik06:09:54

This is so awesome! Thank you!!

Alex Miller (Clojure team)20:09:34 v0.4.0 801a22f is now available • uber - TBUILD-2 - add support for configurable conflict handlers • uber - TBUILD-11 - detect file and dir with same name in uber • uber - TBUILD-16 - expand default exclusions • uber - add support for custom exclusions

clojure 18