This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-07-22
Channels
- # announcements (4)
- # aws (1)
- # beginners (82)
- # boot (14)
- # braveandtrue (1)
- # calva (73)
- # cider (7)
- # cljs-dev (7)
- # cljsrn (1)
- # clojure (83)
- # clojure-belgium (1)
- # clojure-dev (3)
- # clojure-europe (4)
- # clojure-france (3)
- # clojure-italy (31)
- # clojure-nl (11)
- # clojure-uk (15)
- # clojurescript (19)
- # code-reviews (9)
- # cursive (16)
- # data-science (1)
- # datomic (16)
- # events (1)
- # fulcro (4)
- # graalvm (1)
- # hoplon (7)
- # jackdaw (5)
- # java (10)
- # jobs (6)
- # jobs-discuss (7)
- # juxt (1)
- # leiningen (6)
- # midje (1)
- # off-topic (2)
- # pathom (18)
- # pedestal (1)
- # reagent (8)
- # reitit (2)
- # ring (1)
- # shadow-cljs (38)
- # spacemacs (5)
- # sql (41)
- # vim (10)
- # xtdb (1)
the problem was that I was still using the pp/profile-plugin
instead of the new p/trace-plugin
, now all works in the card, but I'm still having problems rendering the editor as a standalone app, I tried to adapt the example in the docs ( https://wilkerlucio.github.io/pathom/#_stand_alone_app ):
(fp/defsc Root
[this {:keys [ui/root]}]
{:query [{:ui/root (fp/get-query pv.query-editor/QueryEditor)}]}
(pv.query-editor/query-editor root))
(def root (fp/factory Root))
(defn ^:export init []
(let [app (fc/make-fulcro-client
{:client-did-mount
(fn [app]
(df/load app [::pv.query-editor/id "singleton"] pv.query-editor/QueryEditor
{:target [:ui/root]}))
:networking
{pv.query-editor/remote-key
(p.network/pathom-remote
(pv.query-editor/client-card-parser (http-request-parser "")))}})]
(fc/mount app Root (js/document.getElementById "app"))))
but I guess I'm missing something, since I get multiple warnings and error on the js console@jlle any reason for not switching to trace? and errors are you seeing?
I got this warning: [fulcro.client.primitives] component com.wsscode.pathom.viz.query-editor/QueryEditor's ident ([:com.wsscode.pathom.viz.query-editor/id nil]) has a 'nil' second element. This warning can be safely ignored if that is intended.
and this error when I try to execute a query: [fulcro.client.impl.application] Use of invalid remote(s) detected! #{:remote}
also, the layout seems broken, not as beautiful as the card, and I get an CodeMirror error: Error setting up CodeMirror TypeError: Cannot read property 'split' of null
@jlle for the layout I guess you will have to upsert the css, check fulcro docs on how to do it
and for the load, I see you need a change there, you need to point to the correct remote, add :remote pv.query-editor/remote-key
to do map in the load
call
actually, maybe you don't need this load at all
thanks, I managed to upsert the css, now looks better. But I guess that the component is not properly initialized, apart of the errors I posted, I noticed that the :initial-state
is not applied (e.g.: Request trace checkbox should be enabled, but is not )
I think this error is related, if I click on 'Refresh index` I get Uncaught Error: Assert failed: (or (util/ident? server-property-or-ident) (keyword? server-property-or-ident))
humm, do you have fulcro inspect? not sure if you are familiar with fulcro apps, but inspecting the DB can be helpful to find were the data link is broken
about the initial load, if you want to load the index at start, instead of doing a manual call you can call this fn: https://github.com/wilkerlucio/pathom-viz/blob/master/src/core/com/wsscode/pathom/viz/query_editor.cljs#L65-L71
@wilkerlucio thanks again, fulcro inspect helped me. I think that finally I got the query editor properly working as a stand alone app 🙂 Would you be interested in a PR to pathom-viz to add a build for the standalone app?
sure 🙂
I'm also planning on adding new docs soon for Pathom Viz, following the format in http://edn-query-language.org
so we could have a proper tutorial there, if you like to write something in asciidoc format would be great!