Fork me on GitHub
#fulcro
<
2018-03-24
>
magra11:03:02

I used to get one of these on and off. Now I get 130 of them on startup. Am I doing something wrong here or should I ignore them? WARNING: Use of undeclared Var fulcro.util/conform! at line 202 file:/usr/home/markus/.m2/repository/fulcrologic/fulcro/2.4.2/fulcro-2.4.2.jar!/fulcro/client/alpha/dom.cljs. Or could this be related to having "old style" code that passes nil like in (dom/h1 nil "Title") because that used to be necessary?

wilkerlucio11:03:07

@magra this is a bug with the specs that make the conform, I'm working on some changes to the new dom api, this one is already fixed there

wilkerlucio16:03:17

@magra sorry, I misread your message, I had some issues with conform hitting the wrong spec, but your case seems to be something else

wilkerlucio16:03:39

are you using figwheel or shadow for compilation? just trying to debug if we missed some needed requires or something

tony.kay16:03:00

It’s prob a valid warning either way

wilkerlucio16:03:31

ok, and your app is working correctly?

magra16:03:44

As far as I can tell yes.

tony.kay16:03:46

sounds like the macro is somehow spitting out a conform…but I’m not remembering that in the macro expand

magra16:03:37

I think they showed up when I migrated from client.dom to client.alpha.dom.

tony.kay16:03:48

OH, this is a runtime conversion

magra16:03:52

Today I only got them on startup. I am developing all day and everything works as far as I can tell.

tony.kay16:03:30

Ah, thats the line that expands the macro for generating the functions

tony.kay16:03:01

yeah, and that spits out conforms all over the place 🙂

tony.kay16:03:20

just a missing require. It is harmless (mostly). I’ll fix it

wilkerlucio16:03:46

@tony.kay so fulcro.client.alpha.dom should require fulcro.util, right?

tony.kay16:03:20

the cljs one, yes, because it runs a macro that emits code that uses it

tony.kay16:03:05

if it was an externally usable macro I’d fix it differently, but in this case it’s just internal

tony.kay16:03:30

probably the same problem in the localized-dom

tony.kay16:03:56

pushed 2.4.3-SNAPSHOT

tony.kay16:03:14

This includes Wilker’s new expression support for props with alpha dom, and the require problem @magra just reported.

magra16:03:42

Wow thank you both!!!!

tony.kay16:03:18

thanks for trying the new support and reporting problems. I’d love to get it out of alpha ASAP so we can update the docs and make things look really spiffy 🙂

tony.kay16:03:56

I’m considering promoting i18n and DOM out of alpha for 2.5, which also changes the server stuff to use dynamic lib resolution to limit deps.

wilkerlucio17:03:01

I agree, I just think we need to let the last alpha dom roll for an extra week, to be sure we have all the basis covered and real world tested

eoliphant17:03:13

Hi is there a standard fulcro facility or ‘way’ to handle client config data?

wilkerlucio17:03:54

@eoliphant you can make that part of the state, one thing that can help you is the shared state: http://book.fulcrologic.com/#SharedState

eoliphant17:03:43

yeha that makes sense

wilkerlucio17:03:00

that can make easier to access that part of the state anywhere on your views, but you can also use root ident queries, something like [{[:app/settings '_] [:setting/size]]}]

wilkerlucio17:03:13

the later is better if your settings change a lot

tony.kay17:03:14

it also matters what you mean by config. cljs and CLosure have some options you can configure through the compiler

tony.kay17:03:32

and also if you mean “ways of loading config”

tony.kay17:03:43

kind of an accidentally broad question 🙂

😂 4
eoliphant17:03:11

ah sorry, i meant application stuff. for instance i’m porting an app that uses auth0 and Stripe. So the client ui needs keys and what have you to invoke their APIs

eoliphant17:03:18

And I’d like to just piggyback on the server config managment as there are say dev vs production keys

tony.kay17:03:20

a lot of that kind of stuff ends up in the low-level networking layers…so I’m not sure I’d use shared or app db

tony.kay17:03:10

or are you embedding their components, and need to pass those things through UI code?

eoliphant17:03:32

ah, yes, that’s the case. It’s the need to leverage their components in the client UI, properly initialized with stuff for your account, which again, might also involve prod vs dev/test configurations.

tony.kay17:03:53

right, and management of secrets that you don’t want lost to the interwebs

tony.kay17:03:30

So, I agree with Wilker that the shared support in Fulcro is the best way to carry them to the UI in arbitrary places.

tony.kay17:03:46

Getting them into the code: Fulcro has nothing special.

wilkerlucio17:03:06

but the root query example has some advanges, you get a better render optimization using those

wilkerlucio17:03:15

to refresh shared you have re-render from root

tony.kay17:03:25

I assume these are sstatic values

tony.kay17:03:35

keys for stripe don’t change at runtime

eoliphant17:03:37

sure, will play with both, but yeah this stuff is pretty static.

wilkerlucio17:03:45

ah, cool, so yeah 🙂

tony.kay17:03:59

So, how about this: 1. Use server tricks, like the environ lib 2. Make a fulcro root query that pulls them from the server 3. Put them in the app db or an atom….if an atom, then shared-fn could add them in

tony.kay17:03:51

assuming https, of course

eoliphant17:03:13

yeah I was just looking at something like just adding a ‘:client’ key to the existing config setup then just dropping that map into the shared state?

tony.kay17:03:36

that is fine too…it supports ENV

tony.kay17:03:44

too early…I forgot about the env support in server config 😜

eoliphant17:03:03

exactly, i’m trying to do this in the laziest manner possible lol. Meteor does something similar, anythign under a “public” key in their config map goes to the client

tony.kay17:03:38

yeah, no need for anything that automatic…add :config to your parser injection for queries…3 lines of code. done.

eoliphant17:03:26

ah heck. sorry bear with me, I’m about 3 days into playing with fulcro lol. So ok, Shared state is a purely client concept, but i still need to get this map or whatever into it. You’re referring to the :parser-injections option on make-fulcro-server? I’m using a recent lein template, so think that’s already there

(defn build-server
  [{:keys [config] :or {config "config/dev.edn"}}]
  (make-fulcro-server
    :parser-injections #{:config}
    :config-path config))
but doing this allows me to then grab that stuff as part of the root query….

tony.kay17:03:44

yep, now config will be in env of the defquery-root

tony.kay17:03:55

and it has a :value member which is your config

tony.kay17:03:29

so on your client you’ll issue a load during startup

tony.kay17:03:52

put that in app state or an atom…shared is just a way of getting the values to components without having to query

tony.kay17:03:55

(defquery-root :app.client/config 
  (value [env params]
     (-> env :config :value :client-config)))

tony.kay17:03:23

then on the client issue a load for it in :started-callback.

(load app :app.client/config nil)
Now it’s in app state. If that same keyword (which is a function that can extract itself from a map) is your :shared-fn, then it’ll pull that newly loaded value into shared and all components can see it through (prim/shared this)

eoliphant17:03:02

ok ok, cool, i think i’ve got it now

eoliphant18:03:09

Hi, I’m running into a weird issue, I’m using Cursive/Intellij, and have setup a remote REPL to point to the nREPL port 9000 that the shadow-cljs config exposes. Connects fine, but it seems to be a clojure, not clojurescript repl. No ‘js/’ vars, clj->js func, etc. anyone seen this?

eoliphant18:03:26

ah crap didn’t RTFM lol. looking at the shadow docs

eoliphant18:03:03

just saw this

(require '[shadow.cljs.devtools.api :as shadow])
(shadow/watch :the-build)
(shadow/nrepl-select :the-build)

magra18:03:06

Can anybody point me to an example of a dropdown that does not live in root and does not get build from initial-state but with data from a server read? So far my tries show up in state without the items. The scenario is a list of people to select from that gets read from the server.

eoliphant18:03:49

though.. I just did that. and i’m now getting a no connected JS runtime error

👍 4
thheller18:03:49

@eoliphant its all in the docs 🙂 this means that you have not loaded your app in the browser

eoliphant18:03:45

that appears to help lol

tony.kay18:03:24

@magra see the cascading dropdown demo in dev guide