Fork me on GitHub
#calva
<
2022-01-09
>
orestis12:01:37

Are there any plans or ideas about having a simple inspector in Calva ? Like the Cider inspector that allows you to explore/drill down a large EDN value.

pez12:01:13

Yes, I always have such plans. Haven’t had the time to look in to it properly, though.

orestis12:01:38

From exploring the VSCode extension api, it seems it would be coded in html/js/css and then invoked via a webview. I guess the data would have to be serialized to the webview, but that's probably OK as this already happens to some extent when it's printed to calva.output ?

pez13:01:11

I would probably use a TreeView for it. And then people can use Portal etc for fancier viewers.

orestis13:01:53

I can't see a way to have tree view on a main editor, only on the sidebar…

orestis17:01:41

Perhaps a tree view on the sidebar would be cool though. Something like this https://marketplace.visualstudio.com/items?itemName=ChaunceyKiwi.json-tree-view

orestis18:01:09

Made an issue about this to track my thoughts: https://github.com/BetterThanTomorrow/calva/issues/1460

🙏 1
orestis12:01:27

I'm aware of solutions that include portal/reveal/rebl but all of those seem quite more involved to setup.

Lukas Domagala13:01:08

portal actually has its own vscode plugin that makes it a little easier to integrate. but i’m currently working on a way to make tools integration into calva easier for end-users, which would also make it possible to start portal with just one hotkey

pez15:01:16

The portal extension is Clojure only.

Lukas Domagala16:01:10

what do you mean by clojure only? it does work from cljs

pez16:01:12

Hmmm, last time I tried (which was a while ago) I couldn’t make it work with shadow-cljs, nor in a vanilla ClojureScript. I ran into problems adding a tap and @U1G869VNV said it was about portal.web not being supported in the extension. That might have changed, and I would be super if so. I want as much of Calva as possible to support both Clojure and ClojureScript, so this idea of mine of lacking support has so far stopped me from adding any specific portal support.

djblue20:01:54

The portal extensions are only implemented for jvm but the code should be easy to port to cljs for node.js. Web cljs is always more tricky. For now I would advise using the https://github.com/djblue/portal#remote-api (which implies all values must be serializable as edn) and push values to a jvm/cljs hosted portal.

djblue20:01:20

Given those constraints, the extension version of portal has most runtimes covered.

djblue20:01:18

@U7PBP4UVA out of curiosity, what would you say is the biggest hurdle you have ran into? I'm always looking for opportunities for making portal easier to use 👌

orestis07:01:34

For some reason I find the UI very difficult to scan. It might be something with the font size (which is quite big on my screen) or just lack of familiarity. Or it might be that I need to have the portal on my classpath... Idea: expose a remote portal HTTP api, that just accepts EDN data? Then anyone can write a simple http client function that just uses pr-str and POSTs that body to a plain http endpoint. No need to have any portal namespace in your actual application.

👍 1
djblue18:01:11

Something to note, a recent addition to portal is the ability to post edn/transit/json to an http endpoint :thumbsup: You can use the https://github.com/djblue/portal/blob/master/src/portal/client/jvm.clj#L15 or bring your own.

Lukas Domagala13:01:05

I’ve started playing with the calva source I have a few questions. Do you want the questions in their own threads on here or do you want one big thread? 🙂 The first problem I’m having is async of course. I’d like to load a file in config.ts/getConfig, but loading a file is an async operation and callers of getConfig expect an immediate return. I’m guessing theres a way to handle this without too much rewriting but it’s been a while since I had to write node code.

pez15:01:58

One thread per problem sounds good to me.

pez15:01:57

I'm afk. Without checking (or thinking much) I'd say make it return a promise and make the current callers await it.

Lukas Domagala15:01:29

that would be a lot of callers + those callers and so on. my thinking was wrong anyway, since getConfig gets called a lot and loading a file every time would be to slow. i’m doing it with a file watcher right now which works better + can be used to fix https://github.com/BetterThanTomorrow/calva/issues/1113

pez15:01:25

Sounds great.

fadrian14:01:20

I'm trying to jack into a deps.edn project in Calva. I am getting the following error message: Error building classpath. Could not find artifact org.clojure: in central () Jack-in process exited. Status: 1 My deps.edn is trying to load http://clojure.java.io version 1.10.3, which according to the documentation is the latest stable version. My deps.edn file looks like this: ;;; deps.edn for mercator project {:paths  `["src/main/clojure"]`  `:deps`  `{org.clojure/clojure {:mvn/version "1.10.3"}`   org.clojure/data.csv {:mvn/version "1.0.0"}   org.clojure/java.io {:mvn/version "1.10.3"}}  `}` Any idea why I'm getting this error?

Lukas Domagala14:01:34

are you sure there is such a thing as org.clojure/java.io? If you just want to access stuff in the http://clojure.java.io namespace, it’s bundled with clojure, no need to add it to your deps.

🙏 1
fadrian15:01:52

That worked. Thanks...