Fork me on GitHub
#fulcro
<
2017-11-05
>
tony.kay04:11:22

@mss you don’t need read-local. That is a hook for ppl that want to do advanced parsing.

tony.kay04:11:22

Please refer to the youtube videos, dev guide, and getting started guide. Don’t assume anything about Om Next….follow the guides and you’ll see it is much much simpler than you’re making it 🙂

tony.kay04:11:43

In fact, Fulcro 2.0 will be dropping Om Next as a dependency.

tony.kay04:11:39

still 1.0 compatible, but with simplified internals that also support some things Om Next can’t currently do

roklenarcic17:11:40

this may be a dumb question, but the fulcro lein template project puts all components into CLJC files. If I don't use SSR, do I need them to be CLJC?

claudiu17:11:57

@roklenarcic cljs should work perfectly, no point if you dont have ssr and are not planning to add it later :)

claudiu18:11:58

@tony.kay In fulcro v2 will having a component (defui) just for querying on the server still be a valid pattern (think there is also something like this in one of the videos) ?

claudiu18:11:21

(defui ^:once ArticleSearchQuery
  static om/IQuery
  (query [this] [:has-more?
                       {:article (om/get-query ArticleListingEl)}]))

roklenarcic18:11:32

thanks claudiu, I was tired of wrapping client specific things in conditional readers

vinnyataide18:11:23

is that an affirmation or a question?

claudiu18:11:32

@roklenarcic ahh yep I have ssr for my projects, can get a bit annoying but really like the end result, the user experience is a lot nicer. 🙂 Think it's a big plus for fulcro since in re-frame for example can't really do it (a few articles about re-frame and nashorn but looked really painful get even simple stuff working )

tony.kay18:11:58

@claudiu none of the patterns change…just new stuff, and a few renames of namespaces to adopt the necessary Om stuff into Fulcro.

tony.kay18:11:49

@roklenarcic That is correct, just use cljs…For that matter, Nashorn-based SSR will do a better job if you use external js libs…clj/cljs-based SSR is just simpler and faster

claudiu18:11:32

ahh ok, remembering something about components that don't have ident 🙂 that's why I asked.

tony.kay18:11:55

if you want it to normalize, you need idents

tony.kay18:11:09

so, your example would need ArticleListingEl to have an ident

tony.kay18:11:20

if you want it normalized

claudiu18:11:22

ahh ok got it now 🙂

tony.kay18:11:40

auto-normalization is all about the idents 🙂

claudiu18:11:56

Feels a bit strange to have a defui just for generating query. If it's a valid common pattern, could this be turned into a macro in fulcro 2.0 ?

claudiu18:11:02

Also in fulcro 2.0 could the defui be with the :once metadata ? 🙂 think somebody said that they do that importing there defui insted of the om-next one 🙂

roklenarcic18:11:30

I need to read up on SSR, I don't even know how it works conceptually for SPAs

claudiu19:11:21

Well basically you only see it in action when you first enter the website and when you refresh. 🙂

roklenarcic19:11:36

If I want to add modal closing to the end of a successful forms/commit-to-entity!, how would I do it?

roklenarcic19:11:57

do I just another transact call to the button handler?

roklenarcic20:11:32

Hm, objects returned by factories return false for om/component????

claudiu20:11:38

think so since factory creates a react class or something like that 🙂

roklenarcic20:11:07

what is component then, other than this in some functions?

roklenarcic20:11:49

I'm trying to commit something that is not this.

claudiu20:11:21

not exactly sure about the internals. What do you mean by commit something that is not this ?

roklenarcic20:11:28

I have a Save button. Form is defined by a subcomponent. I am pretty sure I need to commit with that subcomponent in the call

roklenarcic20:11:07

and this isn't the only case. I would like to know in general, what is a component conceptually, except this in various protocol functions

claudiu20:11:39

Think tony can answer that one. As far as I know, transact needs a this for: get-app-db & to know what component to re-render. I usually send actions from the parent (with it's this). If it's from the child and the parent needs to be refreshed, think fallow on reads is the way to get it working.

claudiu20:11:36

@roklenarcic @tony.kay Might be wrong. Also curious about this one 🙂 As far as I know, component is fulcro/om-next stuff with ident, query etc.. the factory generated one is just a plain react class used for rendering that does not know about fulcro/om-next and that I can basically just drop it with props standalone wherever you need it in.

tony.kay20:11:11

@claudiu Yes on the ^:once….no need to not have that. We could make an alias for it, but defui is sufficient, so it would just be one more thing to think about.

tony.kay20:11:19

defui generates a React class. The factory generates a React Element. See the react docs

tony.kay20:11:49

some operations won’t work until the thing has been mounted on the DOM

tony.kay20:11:54

The reconciler is technically what is needed, and it is “added in” as the tree renders via a dynamic binding. So, you cannot just call the factory.

tony.kay20:11:16

when you transact you can use a component (mounted) or the reconciler. Which you use changes what gets refreshed in the UI

tony.kay20:11:31

reconciler -> root, this -> the component sub-tree

claudiu20:11:16

ahh cool 🙂 got it, thank you (a bit confused since jsx did that, thought it was something special)

claudiu20:11:06

yep. defui is sufficient, was thinking about the aliasing since I usually feel like I'm bending the rules. Might be because I associate defui with something being rendered 🙂

timeyyy22:11:31

i'm following along with the videos and fulcro template. When i start the figwheel with -Ddev i don't get a clojurescript repl. I had to remove it from the dev test cards runtime config

wilkerlucio23:11:19

@tony.kay one thing that I miss in Om.next currently is a formal/shared spec for the query syntax, to use when spec query things, do you think fulcro 2.0 could be a good place to have that?

wilkerlucio23:11:00

I'm asking because I was thinking on writing that in Pathom, but I feel like it should be more downstream