Fork me on GitHub
#fulcro
<
2017-08-19
>
bbktsk21:08:02

How do I create the initial state manually? If I take a working app and just add (defonce state (atom (fc/get-initial-state Root nil))) and then add :initial-state state to new-fulco-client, that should work exactly the same (except for the warning message about explicit and InitialAppState), right?

tony.kay22:08:40

@bbktsk Yes, if you use an explicit option (as of like beta 6 or 7) it should let you manuallyt set it

tony.kay22:08:23

Release of spec beta8. beta7 server tests rendering in the browser was broken due to the change in networking.

tony.kay22:08:45

Also pushed an update to develop on fulcro that adds an embedded CSS demo

bbktsk22:08:00

@tony.kay If I do that, I get error from the router complaining about unknown screen. But I’m looking at my routing code and I think it may have been working only by accident before that. Is M15_Routing_UI up-to-date? I see no r/routing-tree or r/make-route calls there, instead it seems to use raw clojure maps. Are these functions phased out or is M15 just out of date?

tony.kay22:08:26

Oh, yeah, you’re using a union

tony.kay22:08:44

so, your initial state isn’t complete…Fulcro does extra work for you

tony.kay22:08:52

see merge-alternate-unions in core

tony.kay22:08:56

you’d have to use that

tony.kay22:08:08

the server-render namespace has a helper (for SSR, but it works on both)

tony.kay22:08:16

called build-initial-state

tony.kay22:08:25

@bbktsk The docs are not out of date. Those are there. Check you ns aliasing

tony.kay22:08:16

oh wait, I see what you mean

tony.kay22:08:35

Yes, docs are out of date 🙂

tony.kay22:08:41

that is all routing-tree the funciton does

bbktsk22:08:16

@tony.kay good, thanks 😎

tony.kay22:08:37

I should fix that

tony.kay22:08:47

updated on develop

tony.kay22:08:29

updated develop again…I had cljs set to a future version