Fork me on GitHub
#fulcro
<
2017-08-16
>
currentoor00:08:18

@tony.kay in my :started-callback, the :post-mutation is not causing the root to re-render

currentoor00:08:42

it should because it modifies the part of app state that root queries for

currentoor00:08:48

any ides what could be wrong?

tony.kay00:08:00

there is no way for fulcro to know what you need re-rendered on post mutation. Use the :refresh option (it adds follow-on reads)

tony.kay00:08:13

old versions just used to do a root re-render, I think.

currentoor00:08:41

yeah i remember seeing that in the code base, thanks

tony.kay00:08:50

remember, Om Next does not do dirty checking for refresh. It does dirty checking to short-circuit refreshes it thinks might be needed. A little different

tony.kay00:08:02

in your case it doesn’t even think to check

currentoor00:08:33

yeah that worked like a charm

tony.kay01:08:11

Just pushed on develop: the module support for i18n is finished, and there is a demo in demos, and improved docs in devguide. This won’t work until the next cljs release, but if you wanted to play against the tip of master clojurescript, you can. Pro Tip: To play with latest cljs compiler:

git clone 
cd clojurescript
script/build
Look at the version that gets installed into your local maven repo, and use that for your cljs version in your deps.

wilkerlucio18:08:50

maybe worth adding Fulcro there

tony.kay18:08:54

that was fun 🙂

edward.scott18:08:01

I am building my first fulcro app and I am very pleased so far. I am struggling with something that may be obvious... I have a page showing a table with an edit button on each row. I want the edit button to replace the table with an form for editing the data represented by the row (no problem with getting the row data). How would you suggest I structure this in fulcro?

tony.kay18:08:21

I’d put a UI router above it. One route is the table, the other is the editor. Switch the UI route with a mutation that also tells the form what it is editing (e.g. overlay the form component (via ident) with the entity representation, use init-form on it, and point the router at the ident of the form)

tony.kay18:08:36

UI routers can use parameters, which can set the ident to a specific table/id in the db: [:entity/by-id :param/id]

tony.kay18:08:20

I just added a demo (on develop branch of fulcro) that might help…it is side-by-side, but the concepts are similar:

tony.kay18:08:10

it is also hetero on type…e.g. it allows editing one of many kinds of things

edward.scott18:08:33

Excellent. I will look at the demo. Keep up the good work! Thank you.

tony.kay18:08:49

Oh, @mandor2017 develop is currently pinned to a non-released version of cljs

tony.kay18:08:23

see my comments from yesterday if you want to run it….I think that demo is also on master (the current release). If so, that would be easier to use.

tony.kay19:08:04

If any of my instructions above are unclear to you, feel free to ask. I just threw a lot of things at you that you may not know yet 🙂

tony.kay19:08:19

is the actual cards, and it has more exposition on the technique being used

edward.scott19:08:51

OK. Thanks again.

claudiu20:08:41

just wondering. Looking at fulcro-css, I see {:keys [items-wrapper]} (css/get-classnames ListComponent) inside the render function.

claudiu20:08:38

For performance, should (css/get-classnames ListComponent) be outside of the render ?

claudiu20:08:27

Also finding I end up with 10-20+ classnames for some components (page layout mostly). Is there a more elegant way than doing (def css (css/get-classnames ListComponent)) and then {:className (:mystyle css)} ?

tony.kay23:08:00

It’s low overhead. not worth worrying about (@claudiu )

claudiu06:08:23

Yep. But I think I will use it as a map, render let is getting to big with destructuring 🙂 So while rewriting thought would move it outside of render. Not sure if there are any cases where I will want it to be there.

tony.kay23:08:54

clojurescript 908 just dropped. I’m pushing a beta9-SNAPSHOT to clojars

tony.kay23:08:05

all the dynamic stuff should be working there.