This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-04-04
Channels
- # beginners (31)
- # boot (24)
- # braid-chat (17)
- # cider (4)
- # cljs-dev (33)
- # cljsrn (5)
- # clojure (79)
- # clojure-austin (1)
- # clojure-poland (229)
- # clojure-russia (51)
- # clojure-uk (3)
- # clojurescript (68)
- # core-async (1)
- # core-matrix (1)
- # datomic (18)
- # editors (24)
- # emacs (7)
- # hoplon (118)
- # jobs (1)
- # jobs-discuss (1)
- # juxt (7)
- # off-topic (16)
- # om (121)
- # onyx (3)
- # parinfer (224)
- # protorepl (3)
- # re-frame (29)
- # reagent (1)
- # rethinkdb (2)
- # ring (1)
- # spacemacs (2)
- # untangled (182)
@tony.kay: Thanx, nice to hear other people have the same problem. BTW, what you mean by environment bug? You mean some bad combination of Cursive, figwheel etc?
@vmarcinko: Not sure. If I had a better idea I'd report it
can anyone else confirm that the master branch is not loading the client for todomvc? when I start both the server and client repls, I can run the test build, and the server is auto-reloading (fancy! thanks @currentoor), the client just doesn’t seem to want to show up on localhost:3000
Why is it trying to load the min file? This dev we're talking about right?
ah, looks like that did get updated
thanks
yes it is in the instructions, i just didn’t catch it
How do the untangled people feel about sablono? https://github.com/r0man/sablono
I wrote a macro that uses it to give a more concise syntax for defui
.
Any chance you'd want to add that to untangled-client?
I won't be hurt if you say no.
We've gotten a lot of utility out of it so just thought I'd offer to add it here.
So untangled-sablano could have the above macro?
that could work
as a note i’ve started building a defui “wrapper” here: https://github.com/untangled-web/untangled-client/blob/master/src/untangled/client/ui.clj https://github.com/untangled-web/untangled-client/blob/master/spec/untangled/client/ui_spec.clj https://github.com/untangled-web/untangled-client/blob/master/src/untangled/client/ui.cljs - I work with Tony @ Navis
@mahinshaw was a major help, but he is using spacemacs
I’m happy to help anyone who wants to get figwheel running on emacs. There are also some great docs on the figwheel wiki:
@currentoor: this defcomponent macro looks awesome!
@vmarcinko: thanks!
@adambros: do you have an example use of your wrapper?
ive had to switch tasks so all i have is the spec file its not very easy to read so here’s a snippet:
Hmm cool we've done some similar things!
the factory function trick specifically
defui+
was inspired by defscreen
from https://github.com/oakes/play-clj
the main focus of these defui's is to wrap the render method and have some devtools attached
I see, the main focus for me was making it less verbose and making the intent as clear as possible.
the idea for the devtools was to have a way to see what components are on screen, click to go to the source file, and even get their query onto a database overlay
Oh fancy
yeah had conflicting symbols when i would destructure the result of a query
lol nice
pretty good
i'm gonna do a code walk through with my manager later and if he gives the go ahead we'll use it for our product
thanks!
just after tony told us he would open source, i joked that I “suddenly had the urge to clean up my code"
that's good, shame + pride is one of the best motivators
not that there's anything shameful here!
most of my contributions are in untangled-spec, which was a hairball both internally and in how to use it
and i keep using it in every task, and wanting to tweak everything… i have to stop myself from switching and just writing down what i want to fix for later
yeah i know what you mean
I am also interested in this kind of "dev-time component middleware" (if you will) question
defui
in https://github.com/untangled-web/untangled-client/blob/master/src/untangled/client/ui.clj#L76
& wrap-render
in https://github.com/untangled-web/untangled-client/blob/master/src/untangled/client/ui.cljs#L6
actually i’ve since updated wrap-render
to work with figwheel’s source viewer
presumably untangled won't depend on react-motion, so how could I add my highlight animation? not reinventing mixins is on my mind
well if the highlight-on-rerender goes into untangled, then my question (extensibility) goes away
i think @tony.kay might be your best bet on that, but id be interested in that functionality in a defui wrapper
Any suggestions for running migrations on an in memory test db manually? I'm using core.test and I wanted to run them on the setup part. Like so
to be clear I don't plan to use untangled soon (learning om.next by itself first before I look more closely at it) -- but interested in the general question of defui wrappers or other solutions
I guess for 'extensibility' one just creates a new defui wrapper which wraps the next wrapper down
@currentoor: i think https://github.com/untangled-web/untangled-datomic/blob/master/src/untangled/datomic/schema.clj#L224 is what we’re using internally to run the migration/schema
I'm wondering about expressing the various dev-time middleware as separate components which take children, then just having dev-time factories wrap their results in those components
if you can elide the dev-time during production, i dont see the issue if you are careful about being a transparent wrapper
@adambros: thanks I'll check it out!
@tomjack: Dev time concerns are of interest to us, as @adambros said. Highlight on rerender as a dev time option would be nice...as would click to jump to source, db panel, etc. We'll want to define the set we're looking for (feature-wise) and just start chipping away.
I also encourage ppl to think about their real desired outcome, not just a suggested implementation. E.g. highlight on re-render is presumably to debug things not getting re-rendered...might be better ways of debugging that.
but my real interest is in the general problem -- a handy defui dev wrapper which does a fixed set of things would only be moderately interesting to me
yeah, it's a general om problem. just happened to see a related non-solution float by here
Hi, I'm still having trouble getting the db setup for a test working. I'm trying this, am I even on the right track
Or is it not a good idea to use build-database
in my test setup?
@ethangracer: You're working on tests, right? Remind me what we're doing for database setup in integration tests
@tony.kay @currentoor : to write tests against the database i’ve been using untangled.datomic.test-helpers/with-db-fixture)
now I think @currentoor is looking to test migrations
not sure if with-db-fixture
is the place to do that
Um...testing migrations isn't an automated thing so much as proven by the fact that the rest of your integration tests pass
No one should give a rats ass if your migrations fact-check...given that if the real behaviors don't work, then you're SOL anyway
This was the original question https://clojurians.slack.com/archives/untangled/p1459803905000694
Oh I don't want to test migrations, I just wanted to run my tests on a migrated database
with-db-fixture
is a beautiful thing
let me know if you’d like some sample code
awesome! yes please, @ethangracer
lol no worries, takes time
@currentoor: give me a few to pull one together
thanks a million!
@ethangracer: I'm ok with you showing him a production test
planning on it, just want to clean up some variable names for context
@currentoor: We also have protocol testing, which is for writing tests that ensure the complete round-trip is correct
@tony.kay: yeah I started reading your writeup about that, fancy stuff.
you saw this: https://github.com/awkay/protocol-testing/blob/master/ProtocolTesting.md
oh cool
I included a helper function, db-fixture-defs
which helps with testing
essentially, you pass a symbol name that becomes a database component — that component is seeded using the migrations in the directory specified by the string after :migrations
, and is seeded using the :seed-fn
, which for us uses link-and-load-seed-data
@currentoor: Have you seen the seeding tempid support?
from the todo-mvc app?
oh, nope
is a placeholder for a datomic ID...you get back a map from those to the real ids after seeding
hmm, thanks i'll look into that later today
i just double checked, I don’t have an example that doesn’t make extensive use of our helpers
right now I'm getting "Assert failed: :mockdb has no Schema in dbs of app config." when i try to use with-db-fixture
how do i specify the config for the db created by with-db-fixture?
so are you saying I should do (with-db-fixture report-center ...)
?
hmm i'll restart my repl but that doesn't seem to be workign
no, changing the name of the symbol won’t matter
you have to specify the correct :migrations
directory
that’s the only thing I imagine would be causing your error
:migrations
is required, :seed-fn
is optional but recommended
where do i add these entries?
at the bottom of the with-db-fixture
form
it’s included in the snippet but kind of hard to see
oh, didn't notice that 😄
the basic format is (with-db-fixture pick-a-name-here (form to evaluate and write tests here) :migrations “app.migrations.package” :seed-fn (call me to seed the database)
cool, it works now!
thanks guys
wohoo!