@leafgarland has joined the channel
@mail188 has joined the channel
@daslu has joined the channel
@codeasone has joined the channel
Joyride v0.0.2 just released. (Some fixes, haha). Also, Joyride is now available on Open-VSX. (So that it can be installed by various VS Code clones, including Gitpod, where I think it will come in handy for Calva's Getting Started REPL. https://open-vsx.org/extension/betterthantomorrow/joyride
I think the nrepl console logging can be turned off as well
Do we need to enable the GitHub plugin in this channel? People can subscribe to issues on GitHub if they want to see those?
I guess not.
Either way is fine with me but some people may find it too noisy
When I added it I was still thinking we would be preparing the release a bit more than we did. 😃
Even then, I'm watching the repo so I'm now getting notified three times :)
The nrepl console logging is default off now. And there's a command for enabling it.
Do you see these messages?
Yes
Funny. But then you know 😃
Know what?
That I unsubscribed to github updates. But now I deleted the messages.
I think nrepl message logging enabledment should be a setting instead of commands. But commands were easiest, so will have to do for now.
Sure
Dear Joyriders, Joyride has the potential to reach outside the Clojure community. It is a hope we have for it that it will become a vehicle for Clojure #community-development. Please consider giving it a solid foundation of 5-star ratings. Non-clojurians might struggle a bit with the concepts at first and some might blame Joyride in that situation, I fear. Here is where you can read and submit reviews: https://marketplace.visualstudio.com/items?itemName=betterthantomorrow.joyride&ssr=false#review-details
Someone posted joyride on Hacker News: https://hn.algolia.com/?dateRange=all&page=0&prefix=true&query=joyride%20clojure&sort=byDate&type=all Feel free to upvote it! 🤩
We're looking into organizing a Joyride study session at the #visual-tools group: https://clojurians.slack.com/archives/C02V9TL2G3V/p1651130654080509 Thoughts and comments would help.
@daslu It might be interesting to play around with vscode/window.createWebviewPanel - perhaps even scittle etc could be used inside there
Fantastic. Yes, these are the kinds of hopes I am having for the Scittle-related tool, so it is encouraging to hear that you think it is worth trying.
See below in the channel
Here is a demo of a webview with scittle 🎉
(ns scittle-demo
(:require ["fs" :as fs]
["path" :as path]
["vscode" :as vscode]))
(def panel
(vscode/window.createWebviewPanel "Hello Scittle!" "Reagent"
vscode/ViewColumn.One
#js {:enableScripts true}))
(def html (fs/readFileSync (path/join vscode/workspace.rootPath ".joyride" "scripts" "page.html")))
(set! (.. panel -webview -html) (str html))This is huge, opening so many possibilities. I'll try this practice with the clay scittle tool during the weekend. 🙏
I committed the example here now:
https://github.com/BetterThanTomorrow/joyride/blob/master/examples/.joyride/scripts/webview/example.cljs
You can open the examples directory directly in vscode and then choose Joyride: run workspace script
@pez I intend to keep the examples directory structured and clean with easy to find examples which you can open in your editor (the playground directory seems a bit messy and seems to be for development?)
Yeah, I haven't moved my example from the playground because I'm not satisfied with it yet.
BTW. There's a debug launch target which opens up the dev extension host with the playground folder. In case you weren't aware. I should document that.
Your demo blows my mind, @borkdude!
@leif.eric.fredheim has joined the channel
Please help spread the word about Joyride on LinkedIn 🙂
@max.r.rothman has joined the channel
ooooh I just realized I could use joyride to change my fonts and font sizes based on needs in different scenarios
like I pair with someone with a much smaller screen and need to bump up the size when I pair with him
and I use a certain font on macos but another on linux
🎉
@corasaurus-hex I'd love to see a PR with an example of that into the examples dir
cooool
Awesome usecase!
@corasaurus-hex It appears to me that it's not possible to set the font size... or maybe it is possibly by programmatically changing a settings.json file
maaaaybe
@corasaurus-hex sorry, I beat you to it: https://twitter.com/borkdude/status/1519709769157775360
This is the code: https://github.com/BetterThanTomorrow/joyride/blob/master/examples/.joyride/scripts/fontsize.cljs
oooooh!!
thanks!!
can you store functions for later use so you can call them from anywhere?
like from the in-editor joyride repl
yes, just add them in your scripts directory and require them
cooool
prediction: there will eventually be a joyride stdlib
Yes, if we dog food this a while, we might come up with something good in that area. I guess we have a lot of stuff in Calva utilities.ts that are candidates.
I wonder if something like Emacs’ “Org Mode” could be implemented only using Joyride 😅
oh dear
@leif.eric.fredheim I think you maybe could but I don't know if you should :) I think it makes a lot of sense that when you implement an org-mode extension, that you export functions so you can control it from joyride
Has anyone created an example script with joyride driving some API inside Calva? I don't know much about VS Code's APIs around extensions so I'm looking for some "starter code" for me to try to drive some of Clover... Like if a joyride script could cause a code snippet to be eval'd into the REPL, for example 🙂
(if not, I may try to dig into this on Friday night/Saturday while my wife is away judging a cat show)
Do you have a cat in the show?
Not this show. She's just flying up to Seattle on her own. Our cats cannot compete on days she is judging. We took our show cat to Las Vegas at the beginning of April (Jay judged Saturday morning, he competed Saturday afternoon and Sunday).
Awesome! What’s he look like? I’m curious now 😄
I wonder if we have any public photos of him...
https://photos.app.goo.gl/gZM2duvVjEPQmXDP6 -- not really a very good photo but it's recent 🙂
He's a retired stud cat at this point, but he was an international winning kitten and young adult about six years ago. Then he went off to Texas to breed, now he's back as an "alter" (neutered) pet/show cat 🙂
That's a much better photo of him as a youngster -- with his Supreme Grand Champion celebration cake.
(it's two different photos blended together)
Leopardcats Tao Tao of Bangles
Wow, he’s beautiful!
We’ve got a couple of kitties. A female muted tortie and a large long-haired male (I think a Maine Coon mix).
We used to breed as well as show -- all Bengals -- but we stopped breeding about 11 years ago now and so we have a mostly aged population left, including two girls that are over 19. Tao came from Germany originally (Leopardcats cattery, we're Bangles Bengals) as part of our agreement with a friend in Texas to show her cats, because she loved breeding but hated showing (and we loved showing but had stopped breeding).
We work with a couple of purebred rescue groups as well, fostering cats for rehoming -- so we get them from shelters and the rescue groups find new "forever homes" for them. We've fostered a couple of Savannahs and a Bengal so far, since the middle of last year.
Oh interesting. I’ve watched a doc on cat showing but that’s about as much as I know about it. That sounds like fun, and a good deed.
The fostering
Well, now we have a lot fewer cats of our own, we have space to foster others and still keep them all isolated from each other. We used to have to keep each intact (breeding) male in his own "space" and all of those spaces have freed up. And we have three big outdoor runs, fully-enclosed, attached to indoor facilities -- and everyone comes in at night (mostly to keep the noise down for our neighbors, since Bengals can be very loud and vocal).
Oh wow
They’ve got the life over there
They also have one of these to run on: https://onefastcat.com/products/cat-exercise-wheel?msclkid=ce8ddc71c74f11ec9ae1d9872d090fc7&variant=31140866523159 🙂
Oh nice. Got their own gym too. 😄
@seancorfield this requires Calva to export functions that you can use from its extension
Currently these are the only two things Calva exports:
So currently it's not so interesting what you can do with Calva-specific things from joyride, it needs some API love there
But perhaps if you're feeling audacious you could run Calva in develop mode, export things and try them out in joyride and then suggest them in a PR for Calva ;)
I think what @seancorfield wants to do is quite possible without the API. I'll make an example.
As far as Calva is concerned. I haven't looked closely enough at Clover to know if the necessary glue is there.
thanks for this! I will install this week and change my life
stupid question: why does it use SCI?
Do you mean, opposed to self-hosted CLJS or, why does it use SCI at all?
yeah instead of cljs
I have more experience with making scripting in CLJS work with SCI than self-hosted CLJS. SCI works with advanced compilation, making the extension quite small (200kb). SCI is pretty flexible and can be adapted to various environments, e.g. in #nbb it is used to create a scripting environment on Node.js with full support for ES6 modules. The startup time is better with SCI (because the JS bundle is much smaller). But feel free to give self-hosted a try and see what it yields, it would be pretty interesting to compare both approaches.
it wasn't a criticism I am far too ignorant for it to be that, more for my own education
thanks for your answer
Another thing is that macros are first class in SCI, they run similar to how Clojure on the JVM works, without limitations.
is clojurescript still limited in this way if you ship the bootstrapped compiler like you now can?
$ plk
ClojureScript 1.10.914
cljs.user=> (defmacro def-something [x] `(def ~x))
#'cljs.user/def-something
cljs.user=> (def-something my-var)
^
WARNING: Use of undeclared Var cljs.user/my-var at line 1
(def nil)
cljs.user=> my-var
^
WARNING: Use of undeclared Var cljs.user/my-var at line 1
nilself-hosted CLJS is designed to compile CLJS code within a JS environment, but that CLJS still has the same limitations as JVM-compiled CLJS
this blog post seems to imply that bootstrapped cljs can do macros, I'm slightly confused now: https://blog.fikesfarm.com/posts/2016-01-05-clojurescript-macros-calling-functions.html
It can do macros, but the way how you write macros is specific to CLJS.
E.g. the above macro I showed you has to live in .clj file to properly work for some reason
so bootstrapped cljs => first-class macros but now your code is boostrapped-cljs only, SCI => first-class macros + vanilla clj/cljs compatible code? (SCI subset of clj/s)?
sounds about right, but again I'm not an export on self-hosted CLJS. One thing that is better about it is performance since compiled code is generally more performant than interpreted.
OK, trying out joyride for the first time with Calva. I started the Joyride nREPL Server. How exactly do I connect Calva to that? (I've never used Calva's nREPL stuff)
@seancorfield the way I do it currently: connect to repl in project, nbb, then enter the port.
@pez may be able to explain why you need to select nbb and enter the port although there is an .nrepl-port file :)
I don't have nbb installed (I don't have node installed, at least not intentionally)
LOL at the “not intentionally” part 😂
you don't need nbb installed, but the nREPL server in joyride is similar to nbb (so Calva will work with that)
Calva will probably get a joyride option sooner or later
Probably sooner. The Ux right now is horrible.
And how do I discover the port that the joyride server is running on? The popup went away ages ago...
🙈
That will also be fixed soon. But for now you can click the icon where the popup came from and it will be shown again.
(the joyride output panel doesn't display that information 🙂 )
or open the .nrepl-port file that was created on disk
Also .joyride/.nrepl-port
this is awful and will be improved. thanks for trying Sean :)
There's no .nrepl-port file.
> the joyride output panel doesn't display that information That's a thing we haven't properly discussed in the Joyride team, @borkdude likes to popup messages. 😃 But the real problem here is that Calva isn't looking for an nrepl-port correctly.
Oh, in .joyride...
Yeah, we don't want to overwrite any port file created by the project repl.
OK, and what Calva command do I use to eval code into that nREPL session?
But shown popup messages are also here:
I tried "evaluate current block of code" and Calva says there's no REPL connected.
Calva has no such command. That is probably Clover.
(even tho' I have a REPL icon at the bottom that says it's connected to joyride)
Evaluate Current Form or Selection ctrl+enter
Oops, misread the pallette... yeah, got it now...
I use:
{
"key": "ctrl+x ctrl+e",
"command": "calva.evaluateSelection",
"when": "calva:connected"
},
(same keybindings as in emacs :))I can recommend Fire up the Getting Started REPL.
😛 I'm not using nREPL for anything other than joyride
I have confirmed that Clover exports nothing 😞
But it seems to have the command evaluate current block of code , which you can execute via Joyride.
Ah, interesting... and of course I could run a task, and nearly all my VS Code/Clover stuff is done via tasks (defined in Clover's config.cljs which also uses sci)...
Feels a bit inception-ish...
I think @mauricio.szabo is much closer to expose a proper API than we are with Calva. Since there already is a SCI API. But until you have an API, you can use the commands.
(vscode/commands.executeCommand "paredit.backwardUpSexp")
Executes Calva's command for backing the cursor up out of a list.Check the contributions tab of Clover to see a list of its commands. You'll have to check the source code to know what arguments they accept, though.
I mostly have those overridden with tasks defined in my config.cljs but knowing I can invoke those tasks easily is useful. That also means I can use the task-based API for Clover to be able to send text from Joyride to Clover's Socket REPL 🙂
For example:
{
"key": "ctrl+; shift+d",
"command": "workbench.action.tasks.runTask",
"args": "Clover: Tap def var"
},
But I guess I'd need to know how to invoke runTask and not only tell it what to task to run but be able to pass additional arguments to that task...FYI: I think you should try to find another name than tasks describing these. Tasks has a specific meaning in VS Code.
Clover tasks or something. 😃
Not sure what you mean -- that is the API that Clover exposes to be able to run functions in config.cljs
That runs tap-def-var in config.cljs
Yeah, but when I have been checking out your config repo it has confused me a lot because I can't find any tasks there (I was looking for VS Code tasks).
Talk to @mauricio.szabo about that 🙂
The functions in config.cljs get exposed to VS Code as tasks -- hence the workbench.action.tasks.runTask command being invoked.
Haha, yeah, but you can help the reader of your config repo as well. Maybe just establish early what task refer to in the rest of the text.
They are dynamically added to VS Code as "tasks" as I understand it.
😛 The repo assumes folks are using Clover and have read that repo's docs 🙂
Oh, maybe they are. I don't see why they would be, though.
Roger!
TIL.
@mauricio.szabo Can I pass additional arguments to those tasks?
They need to be because it's the only API that VSCode offers that allows definition of custom commands and for these commands to have a keystroke
@seancorfield not right now, but I hope by next week you'll be able to 🙂
Or perhaps have Clover export the editor abstraction so it can be called from joyride?
(so joyride could call editor/eval-and-render, for example)
Hmmm, can you show an example of such a custom command, @mauricio.szabo? Could be something Joyride should be doing as well.
I need to study how, and if, VSCode tasks allow for custom commands.
A second option could be to define a mutable var that I can export from Clover
> Or perhaps have Clover export the editor abstraction so it can be called from joyride?
Yes, much better to expose this in the extension API.
@pez sure, look at the README: https://gitlab.com/clj-editors/clover#custom-commands.
TL;DR; - Clover is customizable with SCI, so you can defn something with no arguments and it'll become a Clover task
Exporting that editor abstraction somehow would be super, super helpful...
(I know you had to expose it via that fancy p/let macro but...)
@seancorfield will look at it for sure! 👍
Calva will do so as well, but as I said before, we're not really close to being able to. Whereas Clover's API is already defined.
Also, Calva has a lot of commands. 😃
@mauricio.szabo I don't see anything on that page that couldn't be achieved by Clover having a command, say, clover.run and let users bind shortcuts to that. Like we do in Joyride with the joyride.runWorkspaceScript command. Here are my current bindings:
{
"key": "cmd+f1",
"command": "joyride.runWorkspaceScript",
"args": "ignore_form.cljs"
},
{
"key": "cmd+alt+,",
"command": "joyride.runWorkspaceScript",
"args": {
"script": "ignore_form.cljs",
"args": [
1,
2,
3
]
}
},
{
"key": "cmd+alt+.",
"command": "joyride.runWorkspaceScript"
},
The cmd+alt+, one is just a test, I received that map as the argument when I tested it.
However, there is probably still something I don't understand about Clover tasks. 😃How do I run this "custom command" with the command pallete? Do I have to type the args?
(There's always the possibility that I didn't know about "args" params on keybindings too... 😄)
That's probably where the solutions differ... This binding of the command does not appear in the command palette. Only the last one will. On that one I haven't configured arguments, which will make Joyride pop up a menu with the scripts found.
When you say "I received that map as the argument when I tested it." -- how exactly are the arguments passed into the command script?
@mauricio.szabo keybindings for Clover tasks:
{
"key": "ctrl+; shift+d",
"command": "workbench.action.tasks.runTask",
"args": "Clover: Tap def var"
},VS Code calls the command, which is a function in Joyride and passes whatever arguments are specified in args. In that experimental case, a JSON object. So if I catch it in the function and then press cmd+alt+, , and then inspect:
You should be able to connect Clover to Joyride.
True, but its nREPL support is less solid than Calva's 😆
For now omnious soundtrack starts 😄
We know you are a proud non-nREPL user Sean ;)
lolz
> I have confirmed that Clover exports nothing 😞 That's sad... also, I have no idea what you folks are talking about 😄. How do I export things on the plug-in? I'm really open to export anything that I can, the same as I do in Chlorine, to have a fully customizable experience 👍
@mauricio.szabo If I'm not mistaking this is what Calva currently exports: https://github.com/BetterThanTomorrow/calva/blob/c5fc70b534febb505166504d9c9941a7e9435a19/src/extension.ts#L645
I think you can export any function there and you can then use this from joyride
@mauricio.szabo Return a map at the end of activate and that will be Clover's VS Code Extension API.
We should probably figure what API Joyride should return there. 😃
So joyride scripts could run joyride's own functions? 😱 🤯
Yes. That would let us relax about a lot of feature requests, I think.
Well, that was why I added customization on Clover/Chlorine too 😄
@seancorfield if you're looking for some stuff to play with, here are some examples: https://github.com/BetterThanTomorrow/joyride/tree/master/examples/.joyride/scripts (I'm figuring out stuff still and any time I learn something, I try to put an example there)
Yeah, that's where I started...
it feels like SCI has started a wild cascade