Fork me on GitHub
#fulcro
<
2017-11-18
>
tony.kay01:11:59

2.0.0-SNAPSHOT updated on clojars. History refined. There is a feature/2.0 branch of todomvc that works with the new version and can show a couple of the features of the new history support (compressed transacts, tx tracking)

tony.kay03:11:04

@wilkerlucio So, the factory “fix” (apply) does break things a bit. It changes how children appear

tony.kay03:11:20

When making defui components that expect children, they used to always appear as a vector, whereas not if there is just one, for example, then children will no longer be a vector…just an element. This will break existing code for 2.0. Not sure which way to go…breakage of existing code, or elimination of an annoying react warning

tony.kay03:11:40

I think it might be fixable by changing how the prim/children function works to this:

(defn children
  "Returns the component's children."
  [component]
  (let [cs #?(:clj (:children component)
              :cljs (.. component -props -children))]
    (if (coll? cs) cs [cs])))
Thoughts?

tony.kay03:11:16

that way existing users that are pulling children always get a collection (as before), but the factory change can stay in place for when React pulls them

cjmurphy03:11:12

Using Fulcro 2.0. The :started-callback function has app as a parameter. But an assert on (prim/reconciler? (:reconciler app)) is failing.

tony.kay03:11:38

let me look…

tony.kay03:11:53

dump app itself…is it an atom or something?

cjmurphy03:11:20

function (config,state,meta,extmap,hash){ this.config = config; this.state = state; this.meta = meta; this.extmap = extmap; this.hash = hash; this.cljs$lang$protocol_mask$partition0$ = 2229700362; this.cljs$lang$protocol_mask$partition1$ = 139264; }

cjmurphy03:11:44

That was from (type reconciler)

tony.kay03:11:16

not using devtools?

cjmurphy03:11:57

Well I thought I was, on Chromium? not Chrome.

tony.kay03:11:21

I’m not sure why it would be working, but would lose its type

tony.kay03:11:46

the code looks right to me, and most of that hasn’t changed…just my call to the construction of the Reconciler now uses mine, but it implements the protocol

tony.kay03:11:00

and a lot of internal asserts on reconciler? are working

cjmurphy03:11:02

I'll clean everything again...

tony.kay03:11:23

make darn sure you don’t have Om Next around

tony.kay03:11:56

if you accidentally end up with both, things might compile and give you strange errors because some of your namespaces might have gotten missed or something

cjmurphy04:11:46

I will invalidate caches on IntelliJ this time.

tony.kay04:11:50

I guess none of the internal asserts are pulling reconciler from the app. It is in the app for your external purposes…so it could be broken I guess. I just don’t see how

tony.kay04:11:17

Yeah, I’m running a 2.0 devguide, and started callback gets a proper reconciler

tony.kay04:11:24

type returns Reconciler

cjmurphy04:11:43

My bad, still had [org.omcljs/om "1.0.0-beta1"] in the project file.

tony.kay04:11:10

yeah, I’m guessing you’ve got some compiler errors now

tony.kay04:11:24

probably were still pulling in some Om code somewhere

tony.kay04:11:17

My renaming stuff is naive…it assumes you followed the pattern of requires [om.next :as om]

tony.kay04:11:24

if you did it any other way, it won’t find them

cjmurphy04:11:31

My misconception before was that namespaces will change with Fulcro 2, so it is more than a fork, which might keep the same namespaces??

cjmurphy04:11:25

No compile errors. I think fulcrologic/fulcro-spec and fulcrologic/fulcro-datomic also ought to be upgraded to 2.0 - they might be pulling in om??

tony.kay04:11:41

spec has a 2.0 snapshot

tony.kay04:11:55

fulcro-datomic, unfortunately, does not yet

tony.kay04:11:15

at least I don’t remember making one….maybe I did

tony.kay04:11:27

hold on…I’m using that in todomvc, and I got that working today, so it must be ok

tony.kay04:11:28

fulcro-datomic has no dep on Om or Fulcro

tony.kay04:11:31

it is standalone

tony.kay04:11:47

so bump spec to 2.0.0-SNAPSHOT and you should be ok

tony.kay04:11:57

make sure to scan lein deps :tree for Om, though

cjmurphy04:11:29

Yes, keeping "1.0.0-SNAPSHOT" for fulcro-datomic

cjmurphy04:11:59

getting compile errors now thanks 🙂

tony.kay04:11:16

you saw the renaming guide in the new readme, right?

tony.kay04:11:19

I supply a script

tony.kay04:11:02

It is not a fork, per se, no. It is a completely new thing that keeps the same function names, but does create new namespaces for them. This is because they are technically different things.

tony.kay04:11:27

so, the code looks pretty much the same, except for the requires

cjmurphy04:11:32

I'll look at the renaming guide now.

tony.kay04:11:57

yeah, if you copy/paste that (assuming OSX or Linux) it should get you most of the way there

tony.kay04:11:42

might also work in something like cygwin for winders….is that even a thing, or did they make something new…so long since I’ve touched windows…like since version 7 or something

cjmurphy04:11:10

I'm happily on Linux, left it at Windows 7 too. Never seen Windows 10!

tony.kay04:11:50

curious if you use perl for that kind of stream editing, or something else. sed is ok but I really prefer perl regex support 😉

cjmurphy04:11:42

I used to use sed for things. Been a very long time since needed to do shell scripting. My professional existence has been very much Windows for last 7 years.

cjmurphy05:11:58

`Call to #'fulcro.cli … ailure :instrument↵" Call to #'fulcro.client.impl.data-fetch/place-load-markers did not conform to spec:↵ In: [1 0 :fulcro.client.primitives/ident] val: nil fails spec: :fulcro.client.primitives/ident at: [:args :items :fulcro.client.primitives/ident] predicate: ident?↵`

cjmurphy08:11:14

I changed the spec for ident to s/or nil? to get by that one.

cjmurphy08:11:14

Next is a stack trace of many Uncaught TypeError: Cannot read property 'call' of undefined, all for factory calls, starting with my TopRouter then going down to DropdownItem (bootstrap3 line 517) and finally ShadowDOM (elements line 82).

cjmurphy08:11:02

Problem happens when doing the swap! that mounts the Root component: No protocol method ISwap.-swap! defined for type undefined.

tony.kay16:11:03

Hey @cjmurphy So, instrument should not be turned on just yet I think, if you’re turning it on (for spec)

tony.kay16:11:07

that is strange…are you building thedev guide?

tony.kay18:11:59

I’ve started adding more specs, but I’m not enforcing them yet because there is a bit of refactoring to do to get them to all pass via instrument

cjmurphy22:11:15

@tony.kay: I never tried building the dev guide, just went straight to my application. The culprit for why specs would be turned on is in my user.cljs - I added a (ts/instrument) in there then promptly forgot about it 😜