This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-10-05
Channels
- # announcements (9)
- # babashka (7)
- # beginners (190)
- # calva (5)
- # cider (12)
- # clara (1)
- # clj-kondo (26)
- # cljdoc (3)
- # cljsrn (5)
- # clojure (15)
- # clojure-australia (2)
- # clojure-czech (1)
- # clojure-europe (34)
- # clojure-germany (2)
- # clojure-nl (6)
- # clojure-spec (20)
- # clojure-uk (7)
- # clojurescript (6)
- # cloverage (2)
- # conjure (10)
- # core-async (18)
- # core-logic (1)
- # cursive (22)
- # data-science (1)
- # datalog (26)
- # datomic (35)
- # docker (1)
- # emacs (4)
- # etaoin (4)
- # fulcro (51)
- # jobs (2)
- # jobs-discuss (2)
- # joker (1)
- # leiningen (4)
- # mid-cities-meetup (1)
- # off-topic (22)
- # pathom (15)
- # re-frame (14)
- # reitit (5)
- # remote-jobs (1)
- # shadow-cljs (37)
- # specter (2)
- # tools-deps (43)
- # xtdb (2)
hey there, is there another way to add no-value attributes (like disabled
) to HTML tags aside from (dom/div {:disabled ""} ...)
? I combed through the book and this seems to be the only way to do so, but honestly it looks kinda… weird so is there a more elegant way to do it?
Use: {:disabled true}
This might be more of a pathom question, but is the typical way of setting up a resolver where you might not know all the outputs from the api response something like:
Our resolver returns :stuff
(not the actual name) which is a hash-map of all the stuff we're not sure will be returned and which we have little control over (just enough control to coerce everything under the stuff keyword)
(pc/defresolver some-resolver
[__ {:keys [resource/id]}]
{::pc/input #{:resource/id}
::pc/output [:id]}
(let [resource (get-resource-by-id id)]
resource))
where I could still query other parts of the response like: [{[:resource/id 1] [:id :name]}]
anyway, no, the output needs to include :name
if you want to be able to query for :name
hmm, might be a feature of a newer version? or i'm misremembering
it would be tricky for me to know all the properties the api will respond with, I.e. a new field is added to the response
I recalled Tony saying something (in the videos) about how ::pc/output
helps w/ auto-complete but you can query other fields - but I could also be misremembering
output is used to build indexes in Pathom, so autocomplete won’t work without that info. You can return stuff from a resolver that isn’t advertised, but treat that as an optimization since pathom itself would not know to ask for it from that source. For example, say you have a resolver for fact A that can be retrieved via some ID, but another route can also give A if it is hit. If that route does not advertise it can return A then it will never be asked for A; however, if it is hit first and provides A anyway, then Pathom will detect that is already has A and won’t go looking to resolve it if it then finds that it needs it.
totally could be correct 😅
Hmm, did something change/break with Fulcro and/or the Inspect tool? The tool loads an initial state, but then is "stuck" on it. Even a tab refresh doesn't un-stuck it. Meanwhile, I get about two dozen copies of this error in the console:
Do you get the warnings logged also in a browser without Inspect, eg Firefox?
@U2APCNHCN versions?
I would recommend using the latest Inspect (which requires 3.4.3-SNAPSHOT of Fulcro). They depend on each other.
it definitely works for me, so you’ll have to provide much more context if you want further help: OS Versions involved Errors from your console Errors from Inspect’s console (right click on Fulcro Inspect and choose Inspect)
Well, since I also get the same errors in Firefox without Inspect, I am not even sure if Inspect is the cause
Okay, latest Inspect, Fulcro 3.4.3-SNAPSHOT. Console errors: see screenshot above. Errors from Inspect's console: none.
the console errors you’re showing me have to do with your routing and application startup mistakes (they are harmless, though), nothing to do with inspect.
(which is harmless, but deserves a warning because that could be a problem in non-startup scenarios)
I’d recommend quitting/restarting Chrome. You must at least start a new tab to get a newly installed inspect.
Hmm, quitting/restarting Chrome helped. Also, good to know where the warnings are from (a bit odd though that they get repeated so many times). As always, thank you a lot!
sure. In terms of repeating: yeah, they will repeat on every render until the SM starts, so that really depends on how many animation frames you cause before a route gets triggered to start the SM. You can use app/set-root!
with initialize state, then dr/initialize!
or dr/change-route!
, then app/mount!
with NO initialize state to get rid of most or all of those. Basically: Make sure you’ve explicitly routed to a leaf (target) before mounting.
When developing locally for a full stack application, how do we tell the client the location of the server? POST
Ok, so deving from 3000 make sense. But why do I get this error when trying to go to a page that fetches data from the API?
core.cljs:159 WARN [com.fulcrologic.fulcro.networking.http-remote:184] - Transit decode failed!
core.cljs:159 ERROR [com.fulcrologic.fulcro.networking.http-remote:344] -
#error {:message "Remote Error"
strangely enough, I can go to the server localhost:3000/index.html and navigate to that page via a link and the page loads, data renders..
I’ll restate it in case anyone missed it: The current Chrome Store release of Inspect will not work with Fulcro 3.4+. There are pre-release versions of the new Inspect that you can manually install here: https://github.com/fulcrologic/fulcro-inspect/releases