This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-12-17
Channels
- # adventofcode (25)
- # announcements (2)
- # babashka (16)
- # babashka-sci-dev (16)
- # beginners (213)
- # calva (15)
- # clj-kondo (126)
- # clj-on-windows (1)
- # cljdoc (5)
- # cljfx (1)
- # cljs-dev (6)
- # clojure (230)
- # clojure-europe (38)
- # clojure-nl (3)
- # clojure-uk (3)
- # conjure (10)
- # core-async (15)
- # cursive (33)
- # fulcro (58)
- # hyperfiddle (4)
- # jobs-discuss (1)
- # kaocha (5)
- # lsp (46)
- # meander (3)
- # off-topic (30)
- # polylith (10)
- # portal (9)
- # re-frame (5)
- # reitit (7)
- # releases (2)
- # ring (17)
- # sci (8)
- # shadow-cljs (6)
- # specter (1)
- # sql (1)
- # testing (9)
- # tools-deps (4)
- # vim (12)
Sounds great! I look forward to enough of an example to actually try it out 🙂
a minimal example would be this:
(launcher/eval-str (str '(ns mine
(:require
[portal.ui.inspector :as inspector]))
'(defn register-viewer! [viewer-spec]
(swap! inspector/viewers conj viewer-spec))
'(register-viewer! {:predicate string?
:component (fn [val]
[:portal.ui.styled/div
{:title "Time"
:style
{:display :flex
:align-items :center}}
val])
:name :portal.viewer/testing5})
'1))
the ’1 at the end is just so you don’t blow up transit with the return value.Ah, an explicit eval
call. And how to reach from sci
into the VS Code APIs I wonder?
you can’t since that ns is not passed to sci
My main interest in customization here is being able to have Portal invoke commands in the host editor (well, VS Code, but I suspect the IntelliJ folks would like this too).
If @U1G869VNV is busy I can try to find some time for a quick prototype, although I've only build custom versions of the standalone ui till now