Fork me on GitHub
#fulcro
<
2019-05-23
>
daniel.spaniel15:05:58

@j1mr10rd4n I tried using fulcrologic/semantic-ui-wrapper and got babel compile errors. I added fulcrologic/semantic-ui-react-wrappers {:mvn/version "2.0.4"} to deps.edn and then have semantic-ui-react in my package.json ( yarn added that ) and i get >>

daniel.spaniel15:05:59

babel failed? {:resource-name "node_modules/semantic-ui-react/dist/es/lib/AutoControlledComponent.js"}

daniel.spaniel15:05:29

any ideas on how I can get semantic ui react working in current fulcro version ?

daniel.spaniel15:05:54

i have the same versions ( old ones 8.4.0 ) that you have in the semantic-ui-wrapper but maybe babel compiler used in current shadow / fulcro has changed and wont compile these anymore ?? me puzzled

j1mr10rd4n15:05:47

hi @dansudol, can you try using semantic-ui-react-wrappers version 2.0.5-SNAPSHOT please, and see if you get the same problem… I’m using that in a current project with up-to-date fulcro/shadow

j1mr10rd4n15:05:50

the dependency is

[fulcrologic/semantic-ui-react-wrappers-shadow "2.0.5-SNAPSHOT"]

daniel.spaniel15:05:36

still get failure ..

daniel.spaniel15:05:59

i put cljsjs/semantic-ui-react {:mvn/version "0.87.1-0"}

daniel.spaniel15:05:04

in deps.edn as well

daniel.spaniel15:05:21

should i change that ? to 0.8.4 or ?? put in package.json ?

daniel.spaniel15:05:20

wait .. hold the phone .. i put wrong name on fulcrologic/semantic-ui-react-wrappers-shadow was using fulcrologic/semantic-ui-react-wrappers ( trying again )

daniel.spaniel15:05:38

ok .. it compiles now 🙂

daniel.spaniel15:05:33

but .. when i require "fulcrologic.semantic-ui.factories" [fulcrologic.semantic-ui.factories :as f] i get

daniel.spaniel15:05:33

The required namespace "fulcrologic.semantic-ui.factories" is not available,

daniel.spaniel15:05:31

[fulcrologic.semantic-ui.icons :as i] works though

daniel.spaniel15:05:25

my deps.edn has

daniel.spaniel15:05:26

fulcrologic/semantic-ui-react-wrappers-shadow {:mvn/version "2.0.5-SNAPSHOT"} cljsjs/semantic-ui-react {:mvn/version "0.87.1-0"}

j1mr10rd4n15:05:54

if you’re using shadow, you can require the components individually - this can reduce the size of your compiled js output - have a look in https://github.com/fulcrologic/semantic-ui-wrapper/tree/develop/semantic-ui-wrappers-shadow/src/workspaces/fulcrologic/semantic_ui/workspaces for some examples if you want to use the monolithic factories, you can depend on [fulcrologic/semantic-ui-react-wrappers "2.0.5-SNAPSHOT"] instead and follow the examples in https://github.com/fulcrologic/semantic-ui-wrapper/tree/develop/semantic-ui-wrappers/src/cards/fulcrologic/semantic_ui/cards

j1mr10rd4n15:05:40

you shouldn’t need to include the cljsjs/semantic-ui-react dependency in`deps.edn`, it will be pulled in transitively

daniel.spaniel15:05:44

ok .. got it .. are you doing the monolith ?

j1mr10rd4n15:05:13

in my current project i’m using the individual components

exit216:05:07

Is it a default behavior for Fulcro to create the app state for all idents for all components on initial load? Of course if you have initial values you have populated on app load, those should be there. But in my case my app-state has all idents populated (which could be empty because that page hasn’t been loaded). I’m trying to determine if this is something we setup, or is part of Fulcro

tony.kay16:05:35

@njj You declare (and compose) initial state via :initial-state on components. All Fulcro does is (tree->db root-query your-initial-state true) and make thta the db.

tony.kay16:05:38

no real magic

tony.kay16:05:52

you make the tree and query…all fulcro does is turn it into a db

tony.kay16:05:24

you could literally do it with:

(reset! state-atom (tree->db (prim/get-query Root) (prim/get-initial-state Root) true))
(it also does a bit with unions, but it is essentially that)

exit216:05:46

I’m trying to track down why my app locally, loads 3 times on initial load - was wondering if it has something to do w/ this

tony.kay16:05:36

3x has to be your logic, not Fulcro’s

tony.kay16:05:42

The startup is a lot clearer in F3's source…F2 was working around a lot of Om Next requirements. Here’s the new logic: https://github.com/fulcrologic/fulcro3/blob/develop/src/main/com/fulcrologic/fulcro/application.cljc#L136

tony.kay16:05:54

works the same as F2, but a heck of a lot easier to follow

tony.kay16:05:09

lines 136-142

souenzzo17:05:06

Can transact! return a channel or call a callback after a success?

tony.kay18:05:05

See pessimistic mutations in incubator and ptransact

tony.kay18:05:10

also in the book

tony.kay18:05:26

in Fulcro 3 these will be more tightly integrated

tony.kay18:05:04

Basically like the incubator version, but more extensible (Incubator version lets you define an ok-action and error-action on the mutation itself)

👍 4
daniel.spaniel20:05:23

forgot to thank you @j1mr10rd4n from this morning for the help on semantic-ui .. i am using the snapshot for doing individual component imports ... the monolithic one did not work, ( same compile error as other one ) but I don't mind since I just fine doing individual require for each component

😃 4