Fork me on GitHub
#announcements
<
2021-09-15
>
Johan Thorén07:09:48

An announcement of somewhat lesser scope.. https://github.com/johanthoren/julian is a tiny library to convert between https://en.wikipedia.org/wiki/Julian_day 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
borkdude11:09:59

Addendum to yesterday's announcement about #clj-kondo https://clojurians.slack.com/archives/C06MAR553/p1631634221275000, 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
seancorfield17:09:34

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

seancorfield17:09:17

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

borkdude17:09:58

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

borkdude17:09:15

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

ericdallo17:09:03

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

borkdude17:09:49

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

👀 2
seancorfield17:09:33

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

seancorfield17:09:11

And that shows:

Unresolved symbol: update-keys

ericdallo17:09:15

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

borkdude17:09:13

@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
ericdallo17:09:50

@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

ericdallo17:09:02

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

ericdallo17:09:35

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

seancorfield18:09:16

@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.

borkdude18:09:44

you can configure the classpath-command for every project

ericdallo18:09:22

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

borkdude18:09:35

{: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
borkdude18:09:49

copied from the docs

seancorfield18:09:39

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:

<root>
    .clj-kondo/
    .lsp/
    clojure/
        deps.edn
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?

ericdallo18:09:32

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

ericdallo18:09:41

then everything should work right?

seancorfield18:09:18

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.

seancorfield18:09:15

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?

ericdallo18:09:15

@U04V70XH6 I checked the clojure-lsp code, and it will probably don't work as we run the clojure command in the project-root: https://github.com/clojure-lsp/clojure-lsp/blob/master/src/clojure_lsp/crawler.clj#L27

ericdallo18:09:52

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

ericdallo18:09:05

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

seancorfield18:09:38

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 ?

ericdallo18:09:14

that could work :)

ericdallo18:09:35

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

seancorfield18:09:11

That would also solve the problem 🙂

ericdallo18:09:04

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

seancorfield18:09:17

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

ericdallo18:09:30

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

oliy15:09:34

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! https://github.com/oliyh/martian 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 https://github.com/oliyh/martian/pull/120 - thanks https://github.com/AndreaCrotti • 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

oliy16:09:42

@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

oliy16:09:15

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 https://github.com/lambdaisland/fetch 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

tools.build 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