This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # aatree (3)
- # admin-announcements (2)
- # beginners (42)
- # boot (142)
- # cider (12)
- # cljsrn (11)
- # clojure (126)
- # clojure-greece (2)
- # clojure-poland (7)
- # clojure-russia (81)
- # clojure-uk (10)
- # clojurescript (81)
- # component (27)
- # core-typed (2)
- # cursive (18)
- # euroclojure (1)
- # gorilla (1)
- # hoplon (85)
- # immutant (2)
- # jobs (3)
- # leiningen (2)
- # off-topic (49)
- # om (151)
- # onyx (19)
- # parinfer (3)
- # re-frame (36)
- # reagent (2)
- # spacemacs (5)
- # untangled (32)
- # yada (9)
So I'm just getting started with re-frame. What's the best time to load data for a page load?
@bpicolo: So, upon landing on
dispatch an event to load your first foo. Your event handler for loading foo will then return an updated
app-db at some unspecified point in future, at which point your subscribers (that have
reactions) will process the newly-loaded data, which then flow on to your views that use the subscriptions.
@cky I guess the question is, there's many places I can put it such that it will dispatch upon routing. How can I make sure it only runs the one time I need it to?
So, the documentation talks about a special init event you can define, that works just like
@bpicolo: there's a re-frame channel which might be a better forum for this
> Your event handler for loading foo will then return an updated
app-db at some unspecified point in future
That's not really correct. The event handler returns immediately after firing off an HTTP GET. The callbacks for the HTTP GET will run at some point in the future, themselves further dispatching.
To my mind, the best answer to reference is in the books at: https://github.com/Day8/re-frame/wiki/Talking-To-Servers
@danielgrosse: the code above was ok, with the
cljsjs/raven package and a
(:require [cljsjs.raven]) things started working
I was wondering why this implementation of IPrintWithWriter does not work in my tests
make sure you're requiring the namespace where the
extend-protocol is defined in your tests @trikitrok
Thanks @dialelo Sorry I don't understand you The
extend-protocol one is working fine. It's the first one that does not work...
We're changing how the Operation is printed to make the test errors output readable, but only the version in the second snippet works
I've read that
extend-protocol have in common that they extend the protocol dynamically whereas defrecord is creating an object (I think..??)
@trikitrok it seems like defrecord concats default implementations of some protocols to those provided by you in the defrecord, and one of them is IPrintWithWriter: https://github.com/clojure/clojurescript/blob/f057e3cdd7490faeba824920d8b48b80aac69a87/src/main/clojure/cljs/core.cljc#L1693
Thanks a lot @nberger And then that default implementation gets used instead of the one I provided, I see.
Hi! Has anybody tried to use https://github.com/aksonov/react-native-router-flux with Reagent? The router component throws an error:
component property is not set for key=root, but I don’t understand why. I mean, I gave a look at the source and I fund the relevant assertion, but I think I have correctly set the property that causes the assertion fail...
Are there any examples out there on how to setup automated cross-browser testing for cljs projects with services like Browserstack or Sauce Labs?
hi, I've started getting compilation errors with latest clojurescript like
:cause Invalid :refer, var var thing/thing does not exist in file /qweqe/qweqe, which aren't valid because if I delete the target js dir & build it's fine...but then on subsequent builds totally random errors like that
if I use :parallel-build true then I get error on subsequent builds after a first clean one
well you have to be certain that are your libraries are actually requiring things properly
not saying there isn’t an issue - but would need a real minimal case - not going to look at projects
wait a minute...some of these missing var errors are for vars in the same namespace
WARNING: Use of undeclared Var qwe.ui.core/reset-keypath at line 173 src/qwe/ui/core.cljc
@kenzaburo no specific examples that I know of, but I'd go using selenium via clj-webdriver. Browserstack has a guide on setting it up with java https://www.browserstack.com/automate/java that might be of help
@octo221: I have also experienced intermittent problems with
:parallel-build true in my projects 😞 those setups are rather complex and I never got to investigating the root cause
parallel-build sometimes I end up with corrupted builds - for example with figwheel’s hot-reloading when I modify some macro file which triggers long re-compilation and I then modify that macro again before previous build finishes. I assume this triggers another build which gets clobbered by the previous one still running.
this usually happens when I have some library dependency in lein’s checkouts dir and I touch some file there
how can I evaluate several forms in a buffer in emacs TTY and cider (all I really know to do in a buffer is eval the preceding form with C-c C-e)?
I couldn't make
:parallel-build to work on my project either, I couldn't get it to compile correctly even once, but didn't have time to investigate. I usually saw compilation errors with
cljs-time, but also with
core.async. It could be something wrong in our code, of course, I plan to play with it soon
@nberger: more information is always good, I have core.async in a project with
:parallel-build and I haven’t see that
similarly, I'd like at times to eval a nested expression, and not the enclosing expressions.
@dnolen yes, I tried on 1.8.34 a few days ago, similar issues. I'll get better information and come back here
@dnolen I have more information about the
parallel-build issue: it happens in reagent, and I think it's related to some macros there. I created an issue with more details https://github.com/reagent-project/reagent/issues/225. @darwin do you remember if you were using reagent when you got those "intermittent compilation" issues?
@nberger that’s useful information, I have to run but feel free to drop info in #C07UQ678E if it seems like there’s something that could use fixing in ClojureScript itself
I don't have a minimal repro yet, but at least this is smaller than my entire project 😄