Fork me on GitHub
#portal
<
2021-09-22
>
djblue17:09:19

@seancorfield would a vscode extension to run portal embedded be of any interest to you?

seancorfield17:09:40

Oh hell yeah!!!

seancorfield17:09:08

Connected to a full JVM backend, not cljs.

👍 2
djblue17:09:31

Yeah, just hosted in your vscode instance instead of chrome

djblue17:09:42

That way I can get all the theme variables from vscode 👌

seancorfield17:09:16

One of my biggest "issues" right now with both Reveal and Portal is that, running on Windows/WSL2, I have a Ubuntu window popping up for the visualizer which I then have to wrangle up alongside VS Code running on Windows -- since WSL/g isn't quite there yet.

seancorfield17:09:33

On macOS, it's not quite so bad since both VS Code and Reveal/Portal run natively and can be full-screen/side-by-side but even there it would be so much more convenient to have Portal run in a regular VS Code tab/window that could be resized, moved around, split, etc all inside VS Code.

seancorfield17:09:02

And I would be super happy to test early versions of it on both platforms 🙂

djblue17:09:38

Good to know, I'll keep you updated with what I come up with 👌

seancorfield17:09:41

(especially since Chrome is not my default browser!)

seancorfield18:09:42

Is ctrl-shift-left just relying on the browser history or is it an actual command inside Portal?

djblue21:09:09

Yes, it's a command in portal but you can't execute them outside of the UI... yet

djblue21:09:28

What runtime api would you expect?

djblue21:09:15

(portal.api/eval instance '(portal.command/history-first))

seancorfield21:09:44

It would be really nice if (some of) the various portal.command functions were exposed via a JVM (backend) API -- not all of them make sense perhaps. What would instance be there?

djblue21:09:00

The result of calling open

seancorfield21:09:30

Ah, makes sense. And it would allow you to eval any configured command/function?

djblue21:09:43

Portal already has bidirectional communication so this would be pretty easy, just a matter of api design

seancorfield21:09:59

Not sure eval is the right name. Perhaps (portal.api/command instance (portal.command/history-first)) as a macro wrapper so you don't forget to quote it?

djblue21:09:00

Yes, I have sci in the client runtime already so I would expose / enable all the commands and some other things to allow some scriptability

seancorfield21:09:37

And you're already considering a nicer API to install new functions?

djblue21:09:36

Kinda, I was thinking you could pass p/open a function like :commands which gets invoked anytime a user wants to run a command with the currently selected value and can return command that would make sense for that value

seancorfield21:09:34

Ah, makes sense. What I've done right now kind of bypasses those checks and makes them "always available".

seancorfield21:09:04

Also... can we get that list of commands in alphabetical order instead of hash-map-random-key order? 🙂

seancorfield21:09:57

My OCD is being traumatized by the non-alpha ordering right now 😆

djblue21:09:03

Yeah, that should be really easy 👌

djblue21:09:15

I wish there was an easier way to run dev versions of portal from git :thinking_face:

djblue21:09:49

Also I think the reason I lean eval is that it enables user provided commands to start doing more. Like get more values from the user before it returns 👌

seancorfield21:09:47

Ooh, nice! OK.

seancorfield22:09:57

I was just looking over the dev/build/test process -- I don't think I could even run that locally. I'm on macOS 10.12 (for reasons) and I know planck won't build/install on that -- and it won't currently build/install on WSL2 (Ubuntu) last I tried either. Plus I don't think I have node/npm/npx on either machine (I may have it on the Mac) and I don't have bb installed anywhere 😐

djblue22:09:29

I wonder if I can save the main.js that is built during CI :thinking_face:

seancorfield00:09:27

Maybe have everything successful CI run deploy a snapshot to Clojars?

seancorfield00:09:24

(I don't know how the Clojars folks would feel about every project publishing every snapshot tho'... I'll go ask them!)

seancorfield01:09:22

Toby Crawley from the Clojars team says that would be fine. Several projects already do it and it isn't an issue -- so there's a possible way for folks to test Portal builds as they happen.

seancorfield02:09:14

I just updated next.jdbc's GH Actions to build a snapshot for every push to the main branch and deploy it to Clojars automatically.

seancorfield18:09:29

By which I mean: is there a function I could execute via the JVM to tell Portal to invoke history-first in the UI portion? I'm wondering how much of the navigation I can "remote control" from my editor, to avoid switching from editor to browser and back?

seancorfield22:09:30

I think I've found a bug. If you tap> an exception into Portal, and then tap> either nil or a different exception, Portal redisplays the first exception.

seancorfield22:09:24

Hmm, nope, that works just fine from the bare REPL.

seancorfield22:09:53

Looks like this might be a bug in Clover.