Fork me on GitHub

Is there a way to get the last active selection on the Portal UI without using the atom returned from "p/open"?


Do you mean via something like Joyride in VS Code? Or do you mean via code hosted on the JVM?


I mean code hosted on the JVM


For the latter, I don't think there's any way except via the atom. Is that a problem?

👌 2

I currently have this custom REPL snippet in VS Code to start Portal: -- and that creates dev/portal which can be accessed by any code on the JVM

👍 2

Because I use vagrant for my development and normally I will ssh into the vm. If I use the p/open, it will not pop up correctly.


I normally access the portal UI from browser by typing URL directly (something like vagrant.mydev:8080)


Not currently, but I wonder if portal exposed some thing like p/sessions so you can get all the active sessions :thinking_face:


then deref any of them


I think one thing I need to add is setting up a session automatically when hitting the ui directly


yup, that's one way that I am thinking of


Do you want to give it a shot? Not sure when I'll get to it


yes, I am interesting to do that


Sweet, let me know if you run into any issues :thumbsup:

👍 2

I will find some time to implement. thanks!


@UNKNGH2EL I'm curious why you run your dev env in a VM? I see this pop up from time to time here (on Clojurians, not #portal) and people are nearly always running into problems with it and the responses are typically "all you need is a JVM" and your REPL etc is already "virtualized"...


I use Docker to run services that my code needs, but I always run my REPLs on the host machine, using just a JVM (and a Clojure CLI install -- but for work, that's part of our repo so that we can guarantee a fixed version for all devs and all tiers).


I have many different projects running with many different stacks, I found if I keep all stacks on the host, eventually it will get bloated easily. But you're right, I found this causes many problems and I am thinking how to redesign my dev env.


Everything I work on is JVM-based -- but I suspect if I had to work with certain other stacks, I might resort to VMs for them 🙂


Maybe the best solution is I should focus on one project only. (I will choose Clojure) 😊


Cool! Thank you!


Has anyone created some Portal magic with Neovim, specifically It would be great to be able to send some / all of the evaluation results from Conjure to Portal (without having to explicitly wrap forms and expressions in tap> in the source code. I usually start Portal automatically by adding it to the user namespace (in a dev/user.clj file) but then I have to wrap code in a tap> expression each time (unless I have missed something obvious). Ideally it would be great to have a key binding that works like the cider inspector, where I can eval something and send the result to portal as well. It would also be good to toggle a state where every expression evaluation is sent to portal (but I have a lot to learn about hacking neovim / lua / fennel before I know how to do that myself)


I haven't seen anything but you could try the middleware and see if it works for your use case :thumbsup:


Ah, that does seem promising. Thanks. I used something a bit like that to send Cider evals to Cognitech REBL successfully. I will give this a try at the weekend (or whenever the UK heatwave is over)