rewrite-clj

https://github.com/clj-commons/rewrite-clj
lread 2020-06-17T13:30:00.005800Z

coolio, clojure-lsp rewrite-cljc upgrade test helped me find one omission in rewrite-clj (and hence rewrite-cljc) otherwise upgrade pretty straightforward https://github.com/lread/clojure-lsp/commits/lread-rewrite-cljc-test

borkdude 2020-06-17T13:32:07.007300Z

what was the omission?

lread 2020-06-17T13:33:55.008200Z

zip/insert-child* fn was missing https://github.com/lread/rewrite-cljc-playground/commit/4eeac8576341cfd0b205e21745b8ca4063b70476

lread 2020-06-17T13:36:31.009700Z

I notice that most users of rewrite-clj don’t use the (ex zip/next ext) fns and use the underlying zipper directly, probably due to the fact that this wasn’t documented very well.

lread 2020-06-17T13:37:40.010300Z

so this is good news for rewrite-cljc, but not terribly exciting for users of rewrite-cljc until I get it up on clojars.

lread 2020-06-17T13:41:58.011500Z

So I’ve tested rewrite-cljc against cljfmt, zprint and clojure-lsp. Happy to try more if anybody has recommendations.

lread 2020-06-17T13:44:31.012500Z

In the short term, I’m gonna head back to cljdoc to finish up a couple of PRs I initiated many moons ago.

borkdude 2020-06-17T13:48:51.012700Z

ship it

borkdude 2020-06-17T13:48:56.012900Z

😉

borkdude 2020-06-17T13:49:46.013300Z

I'll do a call out on Twitter

borkdude 2020-06-17T13:49:53.013500Z

for projects using rewrite-clj

borkdude 2020-06-17T13:50:02.013800Z

although this should also be discoverable with data from clojars?

lread 2020-06-17T13:52:16.016Z

You sir, are a man of action! Thanks!

lread 2020-06-17T13:54:45.017600Z

I think I want to move to clj-commons before first release. And I am a bit concerned about current namespace handling and potential breaking changes, but if I mark first release at alpha, I guess breaking changes would be ok.

borkdude 2020-06-17T13:55:12.018Z

What would be breaking?

borkdude 2020-06-17T13:56:02.018800Z

If you're concerned about people having to change their namespaces from rewrite-clj. to rewrite-cljc., I don't think that's breaking. Your lib is a new one

borkdude 2020-06-17T13:56:19.019100Z

similar to clojure.java.jdbc and next.jdbc

lread 2020-06-17T13:57:27.020300Z

Nah… not worried about that… I think that rewrite-clj -> rewrite-cljc was a good choice.

lread 2020-06-17T13:59:11.021300Z

More worried about offering something up around namespaced maps that isn’t fully considered yet.

borkdude 2020-06-17T13:59:34.021500Z

You do have tests right?

lread 2020-06-17T13:59:59.022Z

Yup!

borkdude 2020-06-17T14:00:43.023400Z

Btw, I found a way to have tests run in a GraalVM native-imega. It can be done using a feature branch of babashka, but maybe this can be even a separate project

lread 2020-06-17T14:01:13.023800Z

I’m not sure what makes sense for cljs in the area of namespaced maps and sexpr.

lread 2020-06-17T14:03:57.026200Z

Cool! I was fiddling around with running rewrite-cljc test suite in GraalVM native-image a while back. Had something working locally but could not get past memory limitations of free CI services. Was thinking of splitting tests into multiple runs to overcome.

borkdude 2020-06-17T14:04:32.026400Z

yes, I remember that.

borkdude 2020-06-17T14:05:00.027Z

so how it works with babashka: you include the library like the other built-in libraries. and then you run the unit tests from source with bb

lread 2020-06-17T14:05:40.027400Z

oh that’s interesting

borkdude 2020-06-17T14:05:48.027700Z

the unit tests being the very same unit tests that normally run in the JVM

borkdude 2020-06-17T14:05:58.028100Z

I'm already doing this with several other libraries

lread 2020-06-17T14:06:55.029400Z

that’s a great idea, I will definitely explore

borkdude 2020-06-17T14:07:16.029900Z

maybe there can even be a bb spin-off (like bootleg, spire) that includes rewrite-cljc so you can use it for scripting

borkdude 2020-06-17T14:07:22.030100Z

or code formatting, etc.

borkdude 2020-06-17T14:07:50.030400Z

@lee I've got something similar here: https://github.com/babashka/pod-babashka-parcera

borkdude 2020-06-17T14:08:07.030900Z

(parcera is another clojure parser that preserves whitespace)

lread 2020-06-17T14:08:48.031700Z

Cool, thanks! Parcera is interesting too in itself.

borkdude 2020-06-17T14:09:35.032200Z

do you keep a list of changes/fixes compared to rewrite-clj(s)? I'd be interested in those for my own fork that's in clj-kondo

lread 2020-06-17T14:13:31.033900Z

Yeah, I think I have been pretty thorough in my migration notes https://github.com/lread/rewrite-cljc-playground/blob/master/doc/design/01-merging-rewrite-clj-and-rewrite-cljs.adoc but probably useful to split out changes/fixes compared to rewrite-clj(s) to separate doc. I’ll make a todo to see if that would work.

borkdude 2020-06-17T14:13:44.034200Z

awesome!

lread 2020-06-17T14:15:43.035800Z

So while I’ve been in lurk mode for the last long while, I’ve noticed you remain a whirlwind productivity! But even more whirlwindier and productivitier! :simple_smile:

borkdude 2020-06-17T14:17:08.036100Z

Addicted to Clojure, guilty as charged.

lread 2020-06-17T14:21:15.036400Z

Your addiction is a positive force!

borkdude 2020-06-17T14:22:10.036700Z

I'm using my addiction for good, not evil

lread 2020-06-17T14:23:21.037600Z

If only more addicts would follow your example, the world would be a better place. :simple_smile:

plexus 2020-06-17T14:54:17.037900Z

refactor-nrepl also uses rewrite-clj

lread 2020-06-17T15:00:06.038600Z

Ah right, thanks @plexus, will check it out!

lread 2020-06-17T20:25:01.040300Z

refactor-nrepl upgrade test to rewrite-cljc success https://github.com/lread/refactor-nrepl/commits/lread-rewrite-cljc-test

2✔️