This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-02-28
Channels
- # announcements (1)
- # beginners (43)
- # calva (7)
- # clojure (48)
- # clojure-europe (19)
- # clojure-nl (1)
- # clojure-norway (24)
- # clojure-uk (4)
- # clojuredesign-podcast (4)
- # clojurescript (11)
- # conjure (15)
- # core-async (1)
- # cursive (1)
- # datomic (33)
- # events (1)
- # fulcro (2)
- # humbleui (21)
- # hyperfiddle (34)
- # introduce-yourself (1)
- # joyride (24)
- # lambdaisland (8)
- # lsp (3)
- # malli (30)
- # meander (2)
- # observability (5)
- # off-topic (2)
- # pathom (3)
- # polylith (26)
- # portal (5)
- # re-frame (28)
- # shadow-cljs (7)
- # spacemacs (2)
- # xtdb (6)
I’m trying execute a portal ui command from a code window.
(ns gbo.portal
(:require
[portal.api :as p]
[portal.ui.commands :as pui]))
returns
> Execution error (FileNotFoundException) at gbo.portal/eval11569$loading (REPL:1).
> Could not locate portal/ui/commands__init.class, portal/ui/commands.clj or portal/ui/commands.cljc on classpath
The normal portal.api works fine.
Im attempting to execute (pui/toggle-shell state)
from code. (so I dont have to focus portal window and go through ui.
If i can load dependency fn… what would state
be in this case? Does the portal instance need to be defined as a def
? Would I need surface the session id? What is the idiomatic way to reference a portal window.So to execute ui commands, you need to send code to the client. https://github.com/seancorfield/vscode-calva-setup/blob/develop/calva/config.edn#L141-L153 is an example of how to do it. I have been thinking about making this easier from the user's runtime, but haven't gotten around to it yet.
https://github.com/djblue/portal/blob/presentation/examples/portal-internals/src/portal/internals/viewer.clj#L110-L121 is an example of how to automatically toggle the shell on page load.
Looks a bit over my head atm. I am familiar w Calva repl snippets and will try some cut&paste to try out. Thanks for the pointers!