Fork me on GitHub

Added some docs around timbre for those interested in viewing their logs in portal.

❤️ 3
Luke Johnson03:04:47

Awesome! I will be making changes to add those sweet new stacktraces!

awesome 1
🚀 1

Also, thinking about writing some docs around utilizing the new test-report viewer, but I'm curious how most people develop their tests. At the repl? Or in a separate watch/test process? Editor supplied command?


I hate the "watch" workflow with a pink and purple passion! I develop and run tests initially in the REPL from my editor (I never type into my REPL -- I have hot keys to run: the current tests, all tests in this namespace, all tests in what should be the companion test namespace to the current (`src`) namespace.

👍 1

I used to run the kaocha watcher more often, but now that I figured out how to use it in my repl I rarely run it in a separate process any more. I would like to hear more about what you have in the with-redefs stub code.


I'm interested in exploring these custom viewers. I need to see about sending my apps logs into portal with tap.


How easy is it to add a viewer on the same level as the tap or log viewer?


I only use Kaocha from the command line after a long REPL session to make sure I didn't shadow any functions etc.


I'm trying to setup my workflow (again!) with Portal and I managed to figure out how to open the portal VSCode extension and send code to it from CLJ: I added some calva commands that run a custom snippet that will eventually read .portal/vs-code.edn and submit results there via the HTTP api. Is this unnecessarily convoluted? I don't want to bring in portal as a JVM dependency, so the remote HTTP API is all I have to work with.


I still can't figure out how to do this from CLJS though - I can obviously use fetch or some other browser API to send commands to Portal, but I've no clue on how I can read .portal/vs-code.edn from a browser context.


Remind me again what stops portal from running integrated in the editor for ClojureScript? People in the <!subteam^S03BGSAUPTQ|@calva-team> asked me and I realized I couldn’t answer. Solving that would also solve this thing, I take it?


Oh, sorry, I somehow managed to think it was @U1G869VNV who answered in this thread. 😂


@U7PBP4UVA This is a use case I hadn't considered but is still valid :thumbsup:


What I do for cljs is open the portal with a fixed port number, so then I don't need to coordinate the port.


But since you can't specify the port with the vs-code extension, not sure :thinking_face:

Lukas Domagala17:04:54

Not sure if integrated would help here. The problem is that portal needs something inside the runtime. If you don't want to add that dependency calva can't help. That would be like not injecting cider-nrepl


Like injecting. 😀


We have a branch of Calva where the portal dependency is added to the jack-in command line if the portal extension is installed and active. I’ve put it on ice until I understand if ClojureScript can get the same nice support as Clojure has. But anyway, portal is important enough to get special treatment from Calva.

❤️ 2
Lukas Domagala17:04:58

Injection works. I just have it as extra :dev dependency, together with some other stuff


@U02EMBDU2JU, how do you coordinate the server port to a cljs client such that web taps can be sent to the ui hosted by the extension?

Lukas Domagala17:04:06

Sorry I meant for clojure. Didn't use cljs for a bit now

👍 1

I think an interesting solution to this problem would be having the portal extension provide the data to calva, perhaps by adding a notion of a repl context, and have the info propagated into the evaluation environment. 1. The portal extension calls a calva api to register context info {:host "localhost" :port 12345} 2. The user evaluates some code, and the registered extension contexts get propagated {:portal {:port ...} :other-extensions ...} 3. The user can leverage said context in their code via:

(js/fetch (str "http://"
               (get-in *calva* [:portal :host])
               (get-in *calva* [:portal :port]))
          {:body "hello, world"}) 
Is this something the <!subteam^S03BGSAUPTQ|@calva-team> would want?

Lukas Domagala17:04:14

My mind is blanking right now, need to eat and sleep 😅 But I’ll try to give some feedback tomorrow. Maybe @U0ETXRFEW has a better grasp on the cljs side anyway


I would be happy if I could provide the vscode-integrated portal a fixed port.


Again, I don't want the portal dependency in my main project classpath - in principle :)


We're going to give you the option to do that thing easy, anyway 😃 But yes, it is an optional feature in the spike branch for this.


@U1G869VNV would an API where Calva makes the repl connection available, say via en eval(some-code) function, solve things from the portal end of things?

wow 1
Jose Varela03:04:39

oof out of the box integration between portal and calva would be killer… i know yall know that just wanted to cheer from the sidelines 😂

metal 1
😂 1
👍 1

@U7PBP4UVA, not sure if you've solved this issue yet, but if you are already reading the .portal/vs-code.edn file, you can also inject it into your index.html as a global js variable 👌


Oof - not sure if my colleagues will appreciate that 😅 perhaps a .portal/config.edn with a static port would sidestep a lot of these issues?


@U7PBP4UVA Would something like work for your use case?


I think that's a necessary step @U1G869VNV - I've commented on a Calva issue, explaining my desired workflow: