announcements

Project/library announcements ONLY - use threaded replies for discussions. Do not cross post here from other channels. Consider #events or #news-and-articles for other announcements.
Lu 2020-07-28T10:26:53.250600Z

I just made Navi, a cljs library that changes the active menu tab based on the relevant section scrolling position. There are jquery and js solutions out there, but 1 - I didn't want to add jquery to the project and 2 - several js libs had some minor glitches that pushed me to roll my own version 🙂. ATM, the library does everything for you in that it's not very flexible, but it can become more dynamic to work also with side menus and whatnot. If you have a cljs project, I'd love to hear what you think about it. It'll take 2 minutes to set it up. https://github.com/luciodale/navi

1
2020-07-28T10:53:39.251800Z

Take a look at the Intersection observer api: https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API

🔥 1
2020-07-28T10:55:27.252600Z

As a possible improvement ^^

✔️ 1
Lu 2020-07-28T10:58:16.252800Z

Looking great! Will play with this thank you! 🙂

alexmiller 2020-07-28T13:45:34.258100Z

A new development version of clj is now available (1.10.1.590). This has not yet been promoted to "stable" release but you can https://github.com/clojure/homebrew-tools#version-archive-tool-releases if you'd like to use it:

brew uninstall clojure
brew install clojure/tools/clojure@1.10.1.590
Changes in this version: • Added support for https://clojure.org/reference/deps_and_cli#_executing_a_function_that_takes_a_map with data from aliases and overrides on the command line (-X) • Added support for using https://clojure.org/reference/deps_and_cli#_paths • Added explicit https://clojure.org/reference/deps_and_cli#_replace_project_environment_tool for :deps/:paths override (can now pass with -T alias) • Added new program for https://clojure.org/reference/deps_and_cli#_local_maven_install (as execution function) • Deprecated support for unqualified lib names (like cheshire) - will warn on use (use cheshire/cheshire instead) • More fixes for https://clojure.atlassian.net/browse/TDEPS-152 to address problems with -Spom for both new and synced pom srcDirectory • Many changes in https://clojure.github.io/tools.deps.alpha/ • Added new https://clojure.github.io/tools.deps.alpha/#clojure.tools.deps.alpha/calc-basis API • Added https://clojure.org/reference/deps_and_cli#_basis_injection via a JVM system property

💯 19
8
martinklepsch 2020-07-28T13:47:39.258300Z

> Deprecated support for unqualified lib names (like cheshire) - will warn on use Interesting. That’s lots of libraries, is there a problem with unqualified names?

alexmiller 2020-07-28T13:48:09.258600Z

yes, but I will talk more about this elsewhere rather than reply in-thread here. I'm going to write several blogs today about different facets of the above

👍 5
alexmiller 2020-07-28T13:49:06.258900Z

we're deprecating the single part naming format, you should use cheshire/cheshire instead

martinklepsch 2020-07-28T13:49:54.259300Z

Oh right, I forgot that that’s implicit. Was fearing that all those libs would need to be published under updated coordinates

alexmiller 2020-07-28T13:50:04.259600Z

no no

alexmiller 2020-07-28T13:50:09.259800Z

just the naming format

👍 1
alexmiller 2020-07-28T13:51:22.260100Z

if you use Cursive, please note that Cursive needed to catch up to the tools.deps api changes mentioned above so you will need the latest 1.9.3-eap1 if you want Cursive to work with clj integration

vlaaad 2020-07-28T14:00:50.260500Z

clj -A:deps -X:install :jar '"/path/to.jar"'
I’m going to cry escaping this in powershell 😄 Have you considered converting edn symbols back to strings for overrides to -X?

vlaaad 2020-07-28T14:02:13.260700Z

So I can have :jar /path/to.jar … Sort of how I done it here: https://github.com/vlaaad/reveal/blob/e547ecee8812d5433c3d4665d4e6b855d9dceebf/src/vlaaad/reveal.clj#L86-L89

vlaaad 2020-07-28T14:02:42.261Z

I think it’s fair to expect that command line args “gravitate” towards strings

alexmiller 2020-07-28T14:03:15.261200Z

we considered it, decided not to do it for now

vlaaad 2020-07-28T14:04:20.261400Z

I’m curious to hear the reasoning, because I thought about it and decided it’s a good idea — mainly because escaping is hard

alexmiller 2020-07-28T14:06:10.261700Z

because "everything is an edn string" is simpler than "everything is an edn string except symbols which are quoted and read as strings"

vlaaad 2020-07-28T14:06:51.261900Z

that’s fair

alexmiller 2020-07-28T14:42:14.264Z

we reserve the right to change our mind :)

seancorfield 2020-07-28T16:06:30.264700Z

@alexmiller In the paths and maven install examples in the CLI/deps reference, you seem to be missing the actual alias inside the :aliases structure.

alexmiller 2020-07-28T16:11:21.265Z

thx

seancorfield 2020-07-28T16:11:37.265200Z

(I asked a follow-up in #tools-deps )

vlaaad 2020-07-28T18:13:51.266500Z

> because "everything is an edn string" is simpler than "everything is an edn string except symbols which are quoted and read as strings" This is a true statement, yet I hope you will reconsider. I think it is good to have some sort of "string gravity" for command line argument parsing in the expense of being simple, because using cli args is done for solving the task at hand rather than writing a program to share, read, run and reason about. It is much more rare to use symbols at runtime as function arguments — they are usually used near macros and loading namespaces, which is probably an uncommon configurable option for solving a task at hand. Much more common when using command line arguments is specifying urls and file paths, that are both make more sense as strings rather than symbols. Requiring strings being escaped makes it harder to use, and since escaping is different in different terminals, that makes sharing snippets of clj -X... invocations more problematic.

alexmiller 2020-07-28T18:30:39.266900Z

thx, I hear you

alexmiller 2020-07-28T18:34:56.268Z

the problem is broader than just this though - does true mean true or "true" ? what about nil or "nil"? what's the mechanism for actually passing a symbol etc? I did go down this path for a while. may go back again, will listen for more feedback.

seancorfield 2020-07-28T18:36:00.268200Z

The downside of treating everything as a string is that 1234 comes in as a String instead of a Long and any ... yeah, Booleans and also structured arguments like {:a 1} -- now that has to be parsed in your function and if you have :args in deps.edn it will be treated differently -- as EDN.

seancorfield 2020-07-28T18:37:07.268400Z

{:fn something/foo :args {:port 8080}} invoked with -X:whatever :port 8888 has a Long as the default value but String for any provided override which is... ugly.

seancorfield 2020-07-28T18:39:19.268600Z

Given that -X:some-alias is very explicitly invoking a Clojure function (and not -main), I would much rather have the arguments pre-`read` rather than having to deal with strings from the command-line but native Clojure data from the :args defaults -- and I'll happily pay the '"string"' tax for that convenience.

💯 1
➕ 1
alexmiller 2020-07-28T18:47:40.268900Z

everything already comes in as a string, the question is whether you pre/post process around edn/read-string

seancorfield 2020-07-28T18:56:43.269600Z

I meant "inside the called function", in case that wasn't clear.

alexmiller 2020-07-28T19:28:05.271100Z

A new dev version of clj 1.10.1.596 is now available thanks to the keen eyed clj bug hawks in #tools-deps - if you like some more long form words, I have written some here: https://insideclojure.org/2020/07/28/clj-exec/

5
🪲 1
❤️ 14
🦜 2
🚀 6