untangled

NEW CHANNEL: #fulcro
grzm 2016-09-01T17:39:25.000087Z

'lo all. I'm attempting to build my untangled-client project with advanced compilation for the first time today. Any known gotchas I should watch out for?

grzm 2016-09-01T17:40:04.000088Z

One I worked around was:

WARNING: Use of undeclared Var clojure.walk/prewalk at line 61 resources/public/js/untangled/client/impl/om_plumbing.cljs
WARNING: Use of undeclared Var clojure.walk/prewalk at line 247 resources/public/js/untangled/client/impl/om_plumbing.cljs

2016-09-01T17:40:15.000089Z

We had a lot of issues with lazy sequences

2016-09-01T17:40:33.000090Z

If you use map to build parts of the dom, for example.

grzm 2016-09-01T17:41:07.000091Z

Added [clojure.walk :as walk] to :require at the top of of a local checkout of impl/om_plumbing.cljs fixed that

2016-09-01T17:41:15.000092Z

Could be that we're using sablono to render though: https://github.com/r0man/sablono

grzm 2016-09-01T17:41:30.000094Z

therabidbanana : worked around with that with doall ?

2016-09-01T17:41:51.000095Z

Depends on the situation - often mapv or into []

grzm 2016-09-01T17:42:33.000098Z

Cool.

2016-09-01T17:42:45.000099Z

I highly recommend having something in your build that will check advanced compilations for you, as well

grzm 2016-09-01T17:42:56.000100Z

Now seeing java.lang.NoSuchMethodError: com.google.common.base.CharMatcher.javaUpperCase()Lcom/google/common/base/CharMatcher;

grzm 2016-09-01T17:43:14.000101Z

You mean running tests against the advanced build?

2016-09-01T17:43:40.000102Z

Yes. Especially verifying that your components can render

grzm 2016-09-01T17:43:55.000103Z

What are you using for that?

2016-09-01T17:44:01.000104Z

We have a part of our build process that goes to the devcards page and screenshots each devcard and compares against expected screenshots

grzm 2016-09-01T17:44:06.000105Z

ah

grzm 2016-09-01T17:44:59.000106Z

Looks like that error might be due to guava

2016-09-01T17:45:03.000107Z

Saved us a few times from pushing something bad into prod (which is generally the only place we ever actually see the site with advanced compilations)

grzm 2016-09-01T17:45:24.000109Z

Sounds like you've got a pretty smart team, Musa 🙂

2016-09-01T17:45:34.000110Z

Well, it bit us a few times first

grzm 2016-09-01T17:45:35.000111Z

With the testing, and all

2016-09-01T17:45:36.000112Z

😄

grzm 2016-09-01T17:46:49.000113Z

I like the idea of devcards: I just wish there were some way of automating the testing other than the screen-shotting you're doing.

2016-09-01T17:46:50.000114Z

The screenshotting of the devcards thing actually was mostly about appeasing other people at the company that were mad we weren't using their UI library (built for Ember)

2016-09-01T17:47:10.000115Z

But it has proven to be remarkably useful.

grzm 2016-09-01T17:47:45.000116Z

Hey, it solved your problem.

2016-09-01T17:47:58.000117Z

(Our UIs will get inconsistent! If you build it not in Ember you must have tests to verify you stay in sync with the main UI library)

2016-09-01T17:48:51.000118Z

We also have started building some actual automated tests that click around too though

2016-09-01T17:49:06.000119Z

We use clj-webdriver: https://github.com/semperos/clj-webdriver/wiki/Introduction%3A-Taxi

grzm 2016-09-01T17:49:06.000120Z

What tools are you using for that?

grzm 2016-09-01T17:49:21.000122Z

Damnnit, @therabidbanana you're reading my mind!

2016-09-01T17:50:02.000123Z

Heh, I'm planning on writing a blog post about how we test our untangled app within the next week, so it's been on my mind.

👍 4
grzm 2016-09-01T17:50:11.000124Z

I'll be sure to read it! I'm pretty happy with my server-side testing, but pretty much have nothing on the front end. I've taken a look at the untangled spec stuff, but it doesn't grab me.

2016-09-01T17:53:46.000126Z

We use untangled spec too - both frontend and backend. The auto refreshing unit tests for the frontend are pretty useful

grzm 2016-09-01T17:54:44.000127Z

Glad to hear it's working for you 🙂

grzm 2016-09-01T18:00:21.000128Z

ZOMG! It compiled!

grzm 2016-09-01T18:01:02.000129Z

695K

grzm 2016-09-01T18:01:57.000130Z

169K gzipped

anmonteiro 2016-09-01T18:09:03.000131Z

@grzm: for fronted testing (not specific to Untangled at all), React’s own TestUtils should prove useful, no?

grzm 2016-09-01T18:09:31.000132Z

@anmonteiro I'll take a look. Thanks for the recommendation!

anmonteiro 2016-09-01T18:10:02.000133Z

ShallowRenderer can be used in non-DOM environments

anmonteiro 2016-09-01T18:10:27.000134Z

others that require a DOM can be used with phantomjs or something, I believe

anmonteiro 2016-09-01T18:10:43.000135Z

@grzm for reference: https://facebook.github.io/react/docs/test-utils.html

grzm 2016-09-01T18:11:35.000138Z

I was also looking at LadderLife's full-stack testing stuff. I think using that would require porting untangled-client to cljc using cellophane.

anmonteiro 2016-09-01T18:12:02.000139Z

@grzm not at all

grzm 2016-09-01T18:12:33.000140Z

Wouldn't the network stack stuff need to run on the JVM?

grzm 2016-09-01T18:12:59.000141Z

granted, that wouldn't need cellophane, just any JS-specific stuff ported to clj

anmonteiro 2016-09-01T18:13:04.000142Z

well, it depends on what you want to test

anmonteiro 2016-09-01T18:13:15.000143Z

the Ladder fullstack testing stuff started without cellophane

anmonteiro 2016-09-01T18:14:24.000144Z

@grzm you can start testing your client parser by just converting it to .cljc

anmonteiro 2016-09-01T18:14:31.000145Z

shouldn’t need cellophane for that at all

grzm 2016-09-01T18:14:56.000146Z

I learn so much when I hang out here. Thanks, @anmonteiro

grzm 2016-09-01T18:15:08.000147Z

it's definitely not slacking at all

👌 1
grzm 2016-09-01T18:37:28.000148Z

Looking at the property-based testing material (https://github.com/omcljs/om/wiki/Applying-Property-Based-Testing-to-User-Interfaces), would I want to remove the references to :remote in the mutate functions?

grzm 2016-09-01T18:38:31.000150Z

I guess this is more of a general Om question, isn't it? Switching channels

2016-09-01T21:42:10.000151Z

if I call (df/load-data :X) (transact! reconciler [(app/choose-tab :tab-which-reads-X-in-query)]) is this guaranteed to work? i'm seeing it seems like when my tab is loaded :X is nil because it hasn't been loaded yet

2016-09-01T21:42:59.000152Z

my tab has query [:X], it's initial state is {:which-tab :tab-which-reads-X-in-query :id :tab}

2016-09-01T22:04:24.000153Z

@jasonjckn load-data is designed to return immediately so it doesn’t block the UI

2016-09-01T22:04:41.000154Z

so you’re correct, that transaction immediately after the load-field can’t assume the data exists

2016-09-01T23:10:57.000155Z

kk

2016-09-01T23:11:10.000156Z

thanks ethan, just rendering nothing in nil case seemed to work quite well

👍 1