Fork me on GitHub
#fulcro
<
2020-06-20
>
daniel.spaniel16:06:24

Is there a simple way to turn off DEBUG logging ? our production fulcro app is logging all the timbre debug level logs, and we are not sure how to set that log level ( in our shadow-cljs.edn ? )

zhuxun216:06:29

@dansudol I think you could simply do (timbre/merge-config! {:level :info}) somewhere before the start-up of your server

zhuxun216:06:41

In UI state machine, how do I say clear everything in an actor? For example, when logging out, I want to clear everything in :actor/session, instead of simply setting :session-valid? to false. (Isn't the latter still leaking the username etc.?)

tony.kay19:06:35

1. Get the ident of the actor uism/actor->ident 2. (uism/apply-action env assoc-in actor-ident {})

👍 3
daniel.spaniel17:06:18

i guess your right @zhuxun2.. i was just trying to avoid that .. and use the config files

zhuxun217:06:11

@dansudol fulcro supports a config pattern. If you put your config in an EDN file under <classpath>/config/defaults.edn, there's a function com.fulcrologic.fulcro.server.config/load-config! that can load it

zhuxun217:06:50

I don't know if it's possible to load config from shadow-cljs.edn though. I am curious as well.

tony.kay19:06:36

if you’re talking server-side: of course you could…it’s just an EDN file. But you should configure your logging for client and server differently IMO: different blacklists etc are almost always needed. A single logging config is just going to end up needing split up as your app grows

solussd18:06:43

welp, there it is, in the documentation. picard-facepalm , thanks

dvingo18:06:57

fulcro friends, I have been building a fulcro 3 app over the past months and it took some time to get things setup. I went to start a new fulcro project and just didn't want to copy paste over and over again so I put together a fulcro template using clj-new. https://github.com/dvingo/dv.fulcro-template Feel free to try it out. it reflects one project layout - basically what I landed on after some iterating on a project layout and after getting more comfortable with fulcro, but will most likely change as I continue to get a better understanding of fulcro and related tech. I made it to address my own issues, but I figure others will find it useful also. It's my first template, and it's surprisingly easy to add more options, so future additions of other frontend routers (currently uses reitit) and backend servers (currently uses pedestal and crux for db) can be added later. Cheers!

👏 15
👍 6
lgessler23:06:42

awesome! I'm just starting a project and was looking for something like this. Thanks for your work :)

dvingo13:06:26

that's great! yea I saw your comment before and thought it was auspicious timing!

murtaza5216:06:56

@U051V5LLP I made a new project using the template, and then ran the make command, it gives me the following error -

Exception in thread "main" Syntax error compiling at (com/sevenolives/hisaab/server/task_resolvers.clj:35:42).

dvingo17:06:57

Thanks for the report - looking into it now

dvingo18:06:10

ok should be good now - missing a fn in my helper lib

murtaza5219:06:44

@U051V5LLP still getting the error, is the latest version on clojars ?

dvingo20:06:11

hey, I just pushed and validated a new version, there were some other FE changes needed too.

dvingo20:06:27

blurgh, I think it's not pulling the latest. will update when it's done

dvingo21:06:29

I'm on a crash course on how maven sorts version numbers. I am deploying new versions to clojars, but not seeing them being picked up when I try on another machine. In the meantime you can use this format:

clj -A:new  my-user/my-app +all

dvingo22:06:34

copying from the tools-deps channel - deps downloads from maven a couple times a day. if there are multiple version releases in a day you can clear out your local mvn repo and force the latest:

rm -rf ~/.m2/repository/dv/fulcro-template

murtaza5206:06:54

yup its working now, thanks

tony.kay19:06:37

@dansudol You should be setting the TIMBRE_LEVEL env variable on shadow-cljs’s server for release builds (and optionally dev if you want to just eliminate debug overhead): https://github.com/ptaoussanis/timbre#log-levels-and-ns-filters

tony.kay19:06:55

i.e. TIMBRE_LEVEL=:warn shadow-cljs release my-app

daniel.spaniel19:06:18

thanks tony, we saw that setting in the timbre repo .. but were not sure that it would work in shadow-cljs.edn .. doing now 🙂

murtaza5221:06:07

I keep getting this warning on the rad form - Renderer not found: :decimal :USDwhile I have the semantic-ui controls installed, and they also render correctly in the report. The warning comes on the rad form, any ideas what could be missing ?