Fork me on GitHub
#fulcro
<
2019-07-11
>
tony.kay00:07:49

Fulcro 3 book now describes the new router (mostly): http://book.fulcrologic.com/fulcro3/#_dynamic_router

souenzzo01:07:38

http://book.fulcrologic.com/fulcro3/#_live_router_example

(defsc Main [this props]
  {:ident         (fn [] [:component/id ::main])
   :query         [:main]
   :initial-state {:main "stuff"}
   :route-segment ["main"]
   :will-enter    (fn [app route-params]
                    (log/info "Will enter main" route-params)
                    (dr/route-immediate [:component/id ::settings ;;<<<<
should be ::home ?

tony.kay15:07:15

it should be ::main

👍 1
tony.kay00:07:01

there is also a very simple running example that will be expanded at the end of that chapter.

tony.kay00:07:36

there could be inaccuracies in the text, but the working demo is authoritative (as far as it is written)

souenzzo01:07:31

Can I propose to move com/fulcrologic/fulcro/dom.clj to com/fulcrologic/fulcro/dom-macros.clj and com/fulcrologic/fulcro/dom-server.clj to com/fulcrologic/fulcro/dom.clj With this, will be easier to develop cljc dom files.

tony.kay15:07:20

I don’t feel like analyzing that problem…I spent a ton of time making that work…if you want to do that, and test it in all scenarios, and prove the macros work when possible, etc, etc, then I’m open

tony.kay15:07:51

the problem is it is really easy to fool yourself that you got it right, when in fact you’re no longer using the macros.

currentoor17:07:08

oh yeah i remember wrapping my head around that macro mess…

bbss14:07:23

@tony.kay Thanks for the tips on the tempid merge yesterday, it was very useful to have the :local/root installation with shadow-cljs. The issue was that I wasn't properly encoding the tempid from the server. I added the handlers but didn't properly test them. Seems to work well now! Thanks, I like the improvements fulcro 3 has added.

thheller14:07:53

@tony.kay where do I find the source for the fulcro lein-template? confused a bit about the fulcro3 or legacy stuff. which one is the current?

thheller14:07:21

I changed something related to deps.edn in shadow-cljs and now you need to add thheller/shadow-cljs manually to deps.edn instead of the auto-inject

thheller14:07:45

via the typical :dev profile or so

tony.kay15:07:37

@thheller https://github.com/fulcro-legacy/fulcro-lein-template I’m not at the moment planning on moving that forward. Fulcro 3 has a template in progress that could be lein-en-ized I guess, but 3 is still alpha

thheller15:07:19

I guess both would need to be adjusted accordingly

thheller15:07:27

otherwise the latest shadow-cljs won't start properly anymore

thheller15:07:50

the auto-inject was becoming a problem when importing deps.edn projects into Cursive and so on

thheller15:07:00

since Cursive never learned about the shadow-cljs dependency

tony.kay15:07:02

ah, thanks for the tip @thheller. Should we drop a direct dep on clojurescript (should we depend on the transitive dep from shadow?)

thheller15:07:41

direct is safer I think. otherwise some other dependency might bring in a different CLJS version

tony.kay15:07:52

ok, sounds good

thheller15:07:01

can't guarantee that its the shadow-cljs preferred version

thheller15:07:19

that way the template can kinda ensure they at least are compatible

tony.kay15:07:32

Fulcro 2 lein template updated with explicit dep on 2.8.40. Seems to work.

👍 1
tony.kay15:07:40

pushed to clojars