This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-06-18
Channels
- # aws-lambda (3)
- # beginners (57)
- # boot (3)
- # bristol-clojurians (1)
- # cider (38)
- # cljs-dev (23)
- # clojure (35)
- # clojure-italy (32)
- # clojure-nl (6)
- # clojure-spec (35)
- # clojure-uk (132)
- # clojurescript (34)
- # cursive (22)
- # data-science (1)
- # datomic (54)
- # devcards (1)
- # duct (5)
- # editors (7)
- # euroclojure (4)
- # fulcro (40)
- # graphql (1)
- # hoplon (6)
- # immutant (5)
- # jobs (1)
- # off-topic (22)
- # om (1)
- # planck (17)
- # portkey (1)
- # protorepl (12)
- # re-frame (97)
- # reagent (67)
- # reitit (16)
- # ring-swagger (1)
- # shadow-cljs (98)
- # spacemacs (8)
- # sql (20)
- # tools-deps (60)
@tony.kay what do you think about supporting second-arity versions of transit-str->clj
, transit-clj->str
and initial-state->script-tag
to accept writer/reader opts to allow custom types to be transit encoded?
@levitanong they already do, you can use the fulcro.transit/writer
, the second argument is for customization
https://github.com/fulcrologic/fulcro/blob/develop/src/main/fulcro/transit.cljc#L27-L41
yeah, but there’s no way for the aforementioned functions to pass them to writer.
which means if i want to pass something to writer, i have to implement those three
ah, ok, so this is more high level, I never used the fulcro server thing
@levitanong Sure, send a PR.
@tony.kay will do!
awesome, will do that too 😄
:thumbsup:
@tony.kay hello, I've find something that contradicts how I though rendering works, when we call the factory method, the return of it is the result of rendering, or something else?
I'm trying to write generative tests for views, in the hope I can make it trigger some error if it gets unexpected input
I was expecting the render code to run when I call the factory method, but I'm seeing that is not really like that
if I call ReactDOM.render, then I see the render code been triggered, but just running the factory doesn't run the render, is that correct or I'm missing something?
@levitanong I’ve put that up as 2.5.10-SNAPSHOT on clojars. I have not had the chance to test it as a release, but will release it once I do (or you verify it is working ok)
@wilkerlucio it ultimately calls React createElement
yeah, and I guess that doens't trigger a render immediatly
its fine, and btw, I think those tests work great (assuming you have good specs)
generative tests for component rendering, I'm experimenting with tests approaches, and this is one of then
latest pathom (unreleased yet) as a fn comp-props-generator
this returns a proper generator given a component (and some settings)
then I run a prop that calls the factory and mount the component, and then unmount it
it only tries to detect if any error happens during it (maybe you pass nil
to (name)
call)
and it leverages test.check shrunk, if something breaks it gets you the smallest prop configuration for it
@levitanong Tests didn’t pass…there was an old API incompat in the transit stuff. I fixed it, but would appreciate a live run-through verification.
That's odd, I ran the tests on my end and they passed. 😮 Thanks, will use on my project and see if there are any problems.
yup! Perhaps I just didn’t see the error being thrown.
ahh that would explain it