Fork me on GitHub
#fulcro
<
2018-03-14
>
cjmurphy00:03:54

@magra I guess if (:company/_offices params) is not returning nil, but an id for an ident, then you are fine. I was surprised to see Datomic underscore syntax being used on the client.

magra07:03:01

@cjmurphy Did you write a tool that checks state sanity?

magra10:03:26

@cjmurphy default-db-format gave me a vector expected. And I sqashed the bug!

cjmurphy10:03:16

That's good to hear. It is so easy to do wrong things to your state.

cjmurphy10:03:10

That seems fair enough if there was nil in the field in the first place. fnil to conjure something up. I guess the alternative would be for that field to be [] from initial-app-state, or state created on initial-load. But I'm guessing you want the most dynamic/flexible way which is what you've done with fnil.

tony.kay18:03:36

Just pushed 2.4.0-SNAPSHOT again. It turns out that the DOM functions from Om Next are broken with respect to inline optimizations. They’ve been broken since the addition of server-side rendering. They “work”, which is why no one noticed, but never general inlined code via macros. The only way to fix this is to add a namespace. So, when I release the new DOM “for real” there will be a small amount of porting required if-and-only-if you use CLJC for your UI.

tony.kay18:03:32

The trick for isomorphic is (in a cljc file):

(ns app
  (:require #?(:clj [fulcro.client.alpha.dom-server :as dom] :cljs [fulcro.client.alpha.dom :as dom])))
...

tony.kay18:03:27

That allows for: - Macro inline expansion in cljs, when you don’t use the dom elements as values (e.g. with higher-order functions) - Function versions (slower) in cljs when you use them in contexts where a function is required - Function versions for server-side rendering

tony.kay18:03:45

I actually plan on releasing this new DOM work as fulcro.client.dom after a relatively short period of verification, since it fixes what I see as an existing bug with optimization, and should be drop-in compatible with the public API (other than the conditional require in cljc, but since that’s the bug fix, it’s going to be necessary no matter what).