hyperfiddle

http://hyperfiddle.net
miridius 2018-08-10T03:06:13.000149Z

I was thinking on the lines of testing my app's functionality, for example test cases like "when a user opens the start page, inputs search term X and presses enter, they should see results page Y"

miridius 2018-08-10T03:08:12.000053Z

I think the fact that a) you guys already have written functionality for forking the datomic DB to do speculative writes and b) all fiddles are data (even when rendered, I think?) should give a nice head start when it comes to implementing tests for an app

miridius 2018-08-10T03:08:44.000050Z

but I was interested if you've already put some thought into how your users might do that

miridius 2018-08-10T03:09:19.000087Z

building a test runner as its own fiddle would be pretty cool!

miridius 2018-08-10T03:22:10.000113Z

@dustingetz my domain config reset itself again. Although this time auto-transact stayed on

2018-08-10T12:19:19.000276Z

@miridius We thought we fixed that yesterday so maybe I misunderstood what was happening, can you screenshot your domain config, with the staging area open? I have a feeling this is a problem of unclear UX or maybe a UI bug BTW we look at analytics to know when the coast is clear to deploy, so if you do whitelist us in your adblocker that will help us not deploy while you are in the middle of stuff.

2018-08-10T14:19:28.000412Z

middle click has caused all sorts of problems on windows and linux so I am gonna remove it. We will just have alt-click for "inspect source". We will make data mode better to get the "show me the admin interface" use case back.

miridius 2018-08-10T14:55:16.000109Z

@dustingetz ok will do if it happens again. So far today it seems to be holding 🙂

2018-08-10T15:06:24.000434Z

Can you screenshot your domain page for me now or next time you work, with the stage open

miridius 2018-08-10T16:24:05.000266Z

miridius 2018-08-10T16:24:35.000021Z

here it is - https://i.imgur.com/dxj6418.png

miridius 2018-08-10T16:25:26.000148Z

it was a bit different back on Wednesday though in that the stage button was yellow (Even though staging area was empty and auto-transact turned on)

miridius 2018-08-10T16:26:22.000303Z

what I think is quite possible is that I just had too many different hyperfiddle tabs open for too long (like almost a week) and caused some weird quirk

miridius 2018-08-10T16:26:38.000400Z

@dustingetz it seems to be working fine now in any case 🙂

2018-08-10T16:51:19.000096Z

We haven't deployed since i think weds night

2018-08-10T16:52:09.000226Z

Looking at that screen, i dont understand how it is possible to lose any info from domain under any circumstances, since it is all transacted, so let me know if something weird happens again. I can't explain your data loss

2018-08-10T16:52:19.000357Z

Ah, the extra tabs maybe

2018-08-10T16:52:59.000162Z

As of weds night we don't wipe the staging area on deploy anymore to prevent this kind of issues you had, so this should not be an issue again, i just wish i understood what happened thursday night

miridius 2018-08-10T17:04:49.000052Z

it might be the lots of tabs + also I'm using mobile internet so there's probably some network hiccups

miridius 2018-08-10T17:05:15.000089Z

anyway if it happens again I'll let you know, but even if it does it's not a huge deal

miridius 2018-08-10T17:06:36.000390Z

is there another way to pass arguments (parameters, props, whatever) to a nested fiddle besides assoc-ing some keys to the ctx map? For example, I have a :footer fiddle which looks like this:

(letfn [(footer-link [title link first?]
          [hyperfiddle.ui/browse :footer/link []
           (assoc ctx :footer.link/title title
                      :footer.link/link link
                      :footer.link/first? first?)])]
  [:footer.fixed.bottom-0.w-100.bg-ivy-blue.white.pv1
   [:<http://div.w-80-ns.center.mv3.cf|div.w-80-ns.center.mv3.cf>
    (footer-link "About Us" "/:index/:about-us" true)
    (footer-link "Contact" "/:index/:contact" false)
    (footer-link "Impressum" "/:index/:impressum" false)
    (footer-link "Terms" "/:index/:terms" false)]])
And then :footer/link looks like this:
(let [{:keys [:footer.link/title
              :footer.link/link
              :footer.link/first?]} ctx]
  [:div.fl.w-25.tc.f7 (when-not first? {:class "bl"})
   [:a.white.no-underline.underline-hover
    {:href link} title]])
That works perfectly, but it's quite a lot of code just to pass some static arguments. Perhaps I'm over-engineering things by making a separate footer fiddle in this case and I should just use a function. But there's probably situations where you do want to pass arguments to a child reagent component so it would be a nice to have (not a requirement) if that were easy

2018-08-10T19:37:20.000085Z

@miridius If the footer doesn't have data dependencies, I would recommend you just use clojurescript functions here, the fiddle datamodel is meant to model the API and pass parameters into datomic arguments

2018-08-10T19:41:43.000369Z

@miridius I think if you have datomic arguments AND render arguments (the what-if you describe), you would want the data API – basically the parent fiddle, instead of "iframing" the child fiddle, will call hyperfiddle.data/browse to just get the child api results as EDN and then render it from the parent render function

2018-08-10T19:42:44.000308Z

I will add cookbooks for this in the next documentation sprint – we have been making improvements and simplifications to the data api this week

2018-08-10T19:43:53.000268Z

(This is basically how select options work, btw, and is related to your question of "how do i sort picklists")

2018-08-10T19:50:04.000419Z

Actually, in master I see that iframes have props now which will work too – but this is an area of churn as we tighten up the clojurescript ui programming model