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"
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
but I was interested if you've already put some thought into how your users might do that
building a test runner as its own fiddle would be pretty cool!
@dustingetz my domain config reset itself again. Although this time auto-transact stayed on
@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.
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.
@dustingetz ok will do if it happens again. So far today it seems to be holding 🙂
Can you screenshot your domain page for me now or next time you work, with the stage open
here it is - https://i.imgur.com/dxj6418.png
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)
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
@dustingetz it seems to be working fine now in any case 🙂
We haven't deployed since i think weds night
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
Ah, the extra tabs maybe
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
it might be the lots of tabs + also I'm using mobile internet so there's probably some network hiccups
anyway if it happens again I'll let you know, but even if it does it's not a huge deal
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@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
@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
I will add cookbooks for this in the next documentation sprint – we have been making improvements and simplifications to the data api this week
(This is basically how select options work, btw, and is related to your question of "how do i sort picklists")
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