Fork me on GitHub
#clojure
<
2022-11-19
>
stuartrexking03:11:57

Is there a pattern, framework or approach to building https://spring.io/projects/spring-webflow like flows to complete multi step business tasks in a Ring or Pedestal world. I’m working on an approach that stores a state machine in the session and calls handlers depending on events and state. I’m confident it will work fine but I’d really like to know if there are already any good ways to do this in the Clojure ecosystem.

qqq05:11:20

If I am looking for a clojure editor that RUNS IN THE BROWSER, is the state of the art https://github.com/nextjournal/clojure-mode ? There's also https://calva.io/ but I'm not sure if that runs in the browser. I.e. vscode runs in the browser: https://vscode.dev/ but when I try to load the calva extension from http://vscode.dev, I get the warning of: > The 'Calva: Clojure & ClojureScript Interactive Programming' extension is not available in Visual Studio Code for the Web Back to original question. Conditioned on RUNNING IN BROWSER, is the current best clojure ide nextjournal-codemirror-clojure-mode ? (Say we really care about things like structural editing / par-edit / refactorings.)

p-himik06:11:21

Here's the page where it's mentioned: https://calva.io/get-started-with-clojure/

Alex Miller (Clojure team)06:11:56

that ^^ is basically Calva and VS Code running in the browser via gitpod

qqq07:11:11

Is gitpod open source? Is it truly running in the browser, or is there a server part, and the frontend is basically a "vnc / x-forwarding", except for VSCode DOM elements ?

pez08:11:46

Calva runs on Gitpod and on GitHub codespaces. Both run VS Code in the web browser, no VNC or such. Both need a server part/container, but it’s cloud stuff, so you just need a browser. We haven’t made Calva work on VS Code Web, yet, because lot of work and there’s only recently we could even run Clojure that way.

pez08:11:46

VNC can run there, though, as is demoed hacking on a Java GUI app here: https://youtu.be/oXU17qZjtWM

Joshua Skrzypek16:11:04

If you have the ability to host your own environment (e.g. k8s, ec2, cloud-hosted machine), you might also look at the stuff from https://coder.com/ (notably code-server, which serves an oss vscode in the browser) to get a bit more customized beyond the level of what gitpod offers

👀 1
ahungry07:11:31

I'm re-reading https://clojure.org/guides/deps_and_cli - I see it suggests "io.github.yourname/time-lib" would resolve to http://github.com/yourname/time-lib.git - being a little curious, I followed the link and found out while the repo doesn't exist, "yourname" is a valid github user - is it owned by the clojure team or someone here? Otherwise, if someone eventually added a repo there, could that be a problem? if someone ran the guide commands literally, would it pull the hosted (potentially dangerous) code? I was thinking it might be nice if the guide actually linked to a real sample deps installable lib (perhaps the referenced "time-lib" toy library) - edit: follow up Q - is "io.github" a custom resolver for deps? Is there a way to list/view all such resolvers? I assume if I wrote "io.ahungry.foo/bar", it would not auto resolve to "http://ahungry.com/foo/bar.git" ?

Alex Miller (Clojure team)07:11:07

Probably would be better if it wasn’t an actual name. The resolvers are hard coded and doc’ed in the reference see https://clojure.org/reference/deps_and_cli#_git

🙏 1
qqq14:11:30

What's a good CLJS library for displaying a file/directory tree. I'm looking for something where directories can either be expanded or not expanded, (i.e. + or -), and files are leafs -- like the way IDEs typically display a directory to the left of the editor pane.

borkdude14:11:36

Is this for the command line or in a browser?

qqq14:11:38

cljs/browser

qqq14:11:05

cljs/browser; not node, not xterm;

borkdude14:11:48

if there isn't a cljs lib I would look for a JS lib, the host platform ecosystems usually have what you need

Madara Uchiha16:11:37

Is there a way to use maps/structures containing lazy infinite sequence in the REPL? When I try it throws an error after trying to print it all

Madara Uchiha16:11:11

I'm using nREPL with Calva if that helps

Alex Miller (Clojure team)16:11:36

things like

(set! *print-length* 20)
(set! *print-level* 5)
will help

🙌 1
jpmonettas11:11:36

@U24MDANHY https://github.com/jpmonettas/flow-storm-debugger has a feature for this, called the value inspector. So if you have the debugger open you can use like (tap> {:n 5 :r (range)} or (reduce + (take 10 #tap (range))) and then use the value inspector to recursively inspect the structures, doesn't matter if they contain infinite sub structures

👀 1
🙌 1