This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-11-10
Channels
- # asami (41)
- # babashka (24)
- # beginners (48)
- # calva (41)
- # cider (10)
- # clj-commons (20)
- # clj-kondo (2)
- # cljdoc (8)
- # clojure (131)
- # clojure-australia (4)
- # clojure-europe (17)
- # clojure-hungary (2)
- # clojure-india (2)
- # clojure-nl (3)
- # clojure-uk (1)
- # clojurescript (12)
- # community-development (6)
- # core-logic (4)
- # cursive (11)
- # datomic (22)
- # emacs (25)
- # events (1)
- # exercism (2)
- # fulcro (30)
- # helix (5)
- # honeysql (6)
- # hugsql (3)
- # integrant (12)
- # introduce-yourself (4)
- # lsp (5)
- # malli (5)
- # nextjournal (31)
- # off-topic (4)
- # pedestal (3)
- # portal (51)
- # reitit (33)
- # remote-jobs (1)
- # shadow-cljs (12)
- # sql (10)
- # vim (7)
- # xtdb (37)
is it possible from the client side to extend Portal to support other custom views? I would like to try to embed Pathom Graph Viz inside portal, all I need is a way to inject an iframe and do a postmessage to it (I would be using the embed client of Pathom Viz, which is hosted and compiled, making it easier to embed in web environments)
This plus some jump to source magic would be awesome!
I haven't considered what a client side extension api would look like, would be interested in your ideas.
@U2845S9KL I would checkout the portal.runtime.jvm.editor/goto-definition
command, or the g
d
shortcut ๐
Should work with strings, files, namespaces, symbols and maps generated by https://github.com/djblue/portal/blob/master/src/portal/console.cljc#L20-L28
@U1G869VNV sorry, missed the responses here. about the API, I think an initial thing could be aroudn the currenct Hiccup renderer, since it allows some arbitrary HTML, what I'm missing at this point is how, from inside the hiccup also re-use the renderers available from Portal, maybe there is a way to make them accessible from the hiccup, maybe something like:
(tap> ^{:portal.viewer/default :portal.viewer/hiccup}
[:div "custom thing here" [:portal.viewer/inspector {:complex :data-structure}]])
ups, actually, it already works ๐
this is so cool! now I can have log messages like these ๐ here I'm using logs that are like event maps, instead of text strings, using this custom hiccup I can have both the event name kw isolated, while have the log details in another separate thing (so I can always see the event names, but only expand the details when I need it)
this is the code for it:
(defn portal-logger []
(fn [{::l/keys [event level line column timestamp namespace] :as log}]
(tap>
{:level (l/level-unqualified-kw level)
:result (with-meta
[:div
[:portal.viewer/inspector event]
[:portal.viewer/inspector (dissoc log ::l/event ::l/level ::l/line ::l/column ::l/timestamp ::l/namespace)]]
{:portal.viewer/default :portal.viewer/hiccup})
:ns 'some.ns
:line line
:column column
:time timestamp})))
https://github.com/djblue/portal/releases/tag/0.18.0 ๐ Thanks for all the feedback!
Installed the new IJ plugin and updated library and now when passing in {:launcher :intellij}
it's not starting up in the tool window now. I'll try a restart in case to confirm...
Ignore me. The restart did it. It's late; maybe I just forgot to restart after installing the new plugin.
But, it still seems to have the problem @U066U8JQJ reported earlier with styling.
The plugin only acts as a way to launch the UI hosted by your clojure process in your editor.
Steps to reproduce (for me, running v21.2.3 Ultimate on JDK 11 on Big Sur) 1. Start REPL with IJ (NREPL, using the Cursive/IJ standard launching process) 2. Start Portal 3. Stop REPL 4. Restart REPL 5. Start Portal On restart, the theming is going back to Portal defaults.
Can you verify that if you call open again after step 5 it goes back to the correct theme?
It did go back to correct theming if I open a second time.
I think the /
shortcut still has a few edge cases, but it should work a little better. I need to rethink implementation.
BTW, those arrow characters are still unrenderable on my old Mac - I wasn't sure whether you were planning to change them?
(and the four history ones as well)
https://github.com/djblue/portal/commit/1f1049eb488b8640ab04f1222299aac091e8f76e should fix it. Just switched to using icons so I don't have to worry about fonts ๐
Hi! It appears portal window is on top of the intellij buttons that appear on the right side of the screen (figure 1: the portal window covering the buttons, figure 2: just my repl and the buttons appearing):
btw, I leave these buttons hidden and only show them when I press cmd
twice
I will try to switch themes to see if it still happens (I use the Material theme in intellij)
do you mean bottom right? If I click on the repl button they continue to be hidden
sorry,
Nope, if I click on that button they will show up
btw, changed my theme to darcula just to be sure it wasnโt the Material theme
I would try resizing the tool window real quick. I wonder if there is a bug related to resize for https://plugins.jetbrains.com/docs/intellij/jcef.html
the resizing behavior is very different between the repl and the portal window. when resizing the window, for portal appears a white background, while the repl is more smooth the buttons also show up for a moment during resize
I canโt find this in keymap, but it is not custom: https://youtrack.jetbrains.com/issue/IDEA-203999
This is the only resource I found talking about this shortcut though. I donโt remember how I learned it ๐
This is a very low priority thing, if you donโt want to pursue this anymore it is fine for me! Thank you for the attention I agree with you it looks more as a bug on intellij side than on Portal
I might look more into it after I get some higher priority items done. If you are feeling adventurous, you can run the plugin from the https://github.com/djblue/portal/tree/master/extension-intellij directory from intellij. You can even enable a https://github.com/djblue/portal/blob/master/extension-intellij/build.gradle#L27-L28 server into intellij for some repl driven development ๐
this is so cool! now I can have log messages like these ๐ here I'm using logs that are like event maps, instead of text strings, using this custom hiccup I can have both the event name kw isolated, while have the log details in another separate thing (so I can always see the event names, but only expand the details when I need it)