Fork me on GitHub
#fulcro
<
2017-08-24
>
roklenarcic15:08:17

is it normal that when my code reloads I get 2 rerender console messages

roklenarcic15:08:35

I get 2 messages each code reload

roklenarcic15:08:36

[ 32.447s] [om.next] RERENDER: NOTE: If your UI doesn't change, make sure you query for :ui/react-key on your Root and embed that as :key in your top-level DOM element

tony.kay15:08:13

yes, I’ve seen that. I think I have the template set up where it triggers the refresh twice by accident. It is harmless, though, so I haven’t bothered to fix it.

tony.kay15:08:10

could also get that when using devcards, since multiple cards running apps could be refreshing.

roklenarcic15:08:36

hm is it a problem if my initial state uses idents?

roklenarcic15:08:31

should I denormalize my initial state?

tony.kay15:08:05

Use InitialAppState….it is much much much easier in the long run. Hand-coded initial state works just like stock: atom is assumed to be pre-normalized by you, map is tree that will get auto-normalized.

tony.kay15:08:30

unions for ui routing are also automatically handled by initial app state mechanism, so it should really work for like 99% of initial app state needs.

tony.kay15:08:57

If you are using the initial-state mechanism, then it is incorrect to use idents

tony.kay15:08:10

because you are making a tree, and that will confuse things.

tony.kay15:08:53

it is ok to have duplicate state in your initial state mechanism tree…the copies will get merged into the same final table in the client db…that is harmless

tony.kay15:08:15

(e.g. you need two UI components to initially point at the same normalized thing)

gardnervickers15:08:18

@tony.kay Should this be checking to see if fallbacks have run before calling om/force-root-render!? https://github.com/fulcrologic/fulcro/blob/master/src/main/fulcro/client/impl/data_fetch.cljc#L427

roklenarcic15:08:22

I'll try denormalizing

roklenarcic15:08:32

because right now it doesn't work

gardnervickers15:08:07

I think that should be (when @ran-fallbacks (om/force-root-render! reconciler)) right?

roklenarcic15:08:11

now it just fails to create idents

tony.kay17:08:54

@roklenarcic All of that stuff is well-tested, so I’m not sure if you’re trying to ask a question or just venting 🙂

tony.kay17:08:14

@gardnervickers You mean you’d like to not force a rerender if there were not fallbacks? I think I removed that because there is already short-circuiting in React for doing much work, and errors are not common

tony.kay17:08:54

changes are present: global loading marker, other loading markers

gardnervickers17:08:14

That makes sense

currentoor18:08:17

When I try to build the test build with figwheel I get this error> > WARNING: Bad method signature in protocol implementation, fcn/FulcroNetwork start does not declare arity 2 at line 522 resources/public/js/test/fulcro_spec/renderer.cljs Any ideas?

currentoor18:08:56

When I try to load http://localhost:3449/fulcro-spec-client-tests.html, I see an exception with message Component :test/renderer was nil in system; maybe it returned nil from start or stop

currentoor18:08:15

and the html page just shows Loading “js/test/test.js”, if you need to name that something else (conflicts?) make your own test html file

roklenarcic19:08:53

is there some way in REPL to see if normalized tables have been created

roklenarcic19:08:53

nvm, figured it out

currentoor20:08:10

oh cool, we’re at 100 😄

tony.kay22:08:51

@roklenarcic You are aware of the new video series I’ve been building? That can be very helpful for getting started, perhaps as much or moreso than the docs. Esp the core concepts ones.

devo23:08:37

Is there any documentation on how to use the stuff in the fulcro.client.routing namespace?

tony.kay23:08:46

in the dev guide

tony.kay23:08:51

and in doc strings

tony.kay23:08:57

and in the template as an example

tony.kay23:08:16

and there is an Untangled YouTube video that shows how it was basically designed

tony.kay23:08:42

the dynamic routing is shown in a demo in the demos on the fulcro repo itself

devo23:08:48

Didn't realize the devguide was seperate documentation. Thanks!

jhorwitz23:08:23

in

(let [{:keys (person/name person/age) (om/props this)}])
What is :keys doing?

devo23:08:42

Syntactic sugar for extracting values from a map by key.

tony.kay23:08:52

not much there…you ahve a typo

tony.kay23:08:10

(let [{:keys [a b]} (om/props this)] …)

tony.kay23:08:32

would extract the values of keys :a and :b from the map returned by props into local symbls a and b

sundarj23:08:27

^ is essentially sugar for (let [{a :a, b :b} (om/props this)] ...), @jhorwitz