This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-12-10
Channels
- # admin-announcements (32)
- # announcements (4)
- # aws (25)
- # beginners (296)
- # boot (1)
- # cider (87)
- # clara (16)
- # cljs-dev (7)
- # cljsrn (41)
- # clojure (121)
- # clojure-art (26)
- # clojure-japan (4)
- # clojure-miami (190)
- # clojure-russia (168)
- # clojure-sg (3)
- # clojure-sweden (13)
- # clojurescript (138)
- # clojurex (7)
- # cursive (98)
- # data-science (2)
- # datomic (129)
- # devcards (10)
- # editors (5)
- # funcool (1)
- # hoplon (31)
- # jobs (1)
- # ldnclj (4)
- # lein-figwheel (3)
- # off-topic (2)
- # om (213)
- # onyx (33)
- # parinfer (7)
- # portland-or (1)
- # re-frame (19)
- # reagent (2)
- # ring-swagger (27)
- # slack-help (3)
I'm trying to pull the html for a website into my app with a GET request using cljs-http, but I'm getting these CORS errors No 'Access-Control-Allow-Origin' header is present on the requested resource.
I'm not 100% sure if this is because I should be GET
ing this webpage using cljs.http
but am doing it wrong or if I should be grabbing the html in a different way (like through the server). Any input would be much appreciated.
@codonnell: it means the HTML is located on a different domain than the server you are initiating the request on
Yes, that is intentional. I'm scraping a page from a different website.
You would need to allow the header on the site where you would like to get your resources from
It is not my website, so I can't do that. I'm scraping because there is no API to use.
That's a problem.
I can scrape just fine from clojure--just not clojurescript.
So I suppose the solution is to do it on the server, then!
Ok, thanks @trancehime
if you’re doing it from the client, you’re using their cached cookies or other credentials, which means that it could make private information available to your script (i.e. gmails, facebook friends, etc.)
@danielcompton: Descriptions of the implicit macro loading behavior, as well as :include-macros true
sugar have made it into (doc ns)
in newish REPLs.
Is it documented anywhere?
The same docs appear in the Wiki here: https://github.com/clojure/clojurescript/wiki/Differences-from-Clojure#namespaces
I want to pass a url to my clojurescript per environment, like something in the project.clj .... dev has different endpoint than production ... can't find anything so far to help with this in clojurescript.
Hi guys, I'm learning om next. Checking through this example : https://github.com/omcljs/om/wiki/Components%2C-Identity-%26-Normalization. I have some questions : where is :person/by-name
defined, is it defined through :keyfn :name
passing as parameter when we create the Person component. Thanks
I’m willing to take on the issue @dnolen mentioned earlier (https://clojurians.slack.com/archives/clojurescript/p1449702186005954) I wrote a ticket that I believe accurately captures it: http://dev.clojure.org/jira/browse/CLJS-1507
I suppose the :rename
issue can be sorted by someone as well. https://clojurians.slack.com/archives/clojurescript/p1449702009005943 I saw Brandon Bloom makes good use of it to avoid a collision here: https://github.com/brandonbloom/fipp#printer-usage
in case anyone else was wondering about my question earlier ... http://www.martinklepsch.org/posts/parameterizing-clojurescript-builds.html .. does what I want
someone with really in-depth node.js knowledge arround? got a few questions about require('vm')
?
Hi, am using reagent and notice a difference between passing around a reference to a state atom or directy referencing it. The difference is, by directly referencing it, updates on it work otherwise not. Is this expected? Should'nt it work too if I just pass a reference to the function and use that?
I have a question for those who have tried using a library like createjs or phaser to build a game in clojurescript, and then using cocoonjs to build it into a mobile app. Does clojurescript's heavy need for garbage collection kill mobile performance, or does mobile perform just fine?
is there something like a newsletter or twitter account that informs about clojurescript developments, news, tutorials etc?
Yeah, that's the closest you'll get to Ruby/Javascript weekly this side of FP divide ; d
@sveri: From the reagent docs:
The easiest way to manage state in Reagent is to use Reagent’s own version of atom. It works exactly like the one in clojure.core, except that it keeps track of every time it is deref’ed. Any component that uses an atom is automagically re-rendered when its value changes.
@jstew: Thanks, not sure how I missed that, given the fact I already implemented it several times^^
@sveri: I think it doesn't update because you do not dereference the atom inside this function. You should be able to pass atoms as arguments in general.
@jaen: I think I did it correct, the problem was, like jstew said, that I used a cljs atom instead of ratom^^
Indeed, especially as everything was working until I refactored my functions to take the state as a parameter instead of directly referencing it
Hm, is there a way to combine a prismatic schema definition with reagents ratom? It seems like schema does not recognize the ratom as a map if I red that error message correctly
What does your annotation look like?
@sveri https://github.com/Prismatic/schema/blob/master/src/cljx/schema/core.cljx#L654-L671
@angusiguess: thx, I look at it
Anybody know if there’s a functional/technical difference between using an anonymous function for the :on-click of a component versus defining a function outside of the component and using partial
for :on-click?
@snowell: as long as the function returned from the call to partial
has proper arity, it shouldn’t matter
Is that better/worse than just defining an anonymous function, as far as performance?
think it was an issue w/ a cleaning the build. had an old version of utils.js hanging around
(if-let [[_ value] (find st key)]
is the "_" common idiom for a destructured variable we don't care about?
Yep, _
is frequently used as a wildcard pattern in functional languages. Fortunately Clojure went along with that instead of something odd like *
. I remember seeing that in some language and being surprised as to what it meant.
does anyone have any experience reports for using the compile time typechecking mentioned here? https://github.com/clojure/clojurescript/wiki/Compile-Time-Type-Checking
@johannjohann: it’s an experimental thing, not finished - somebody will need to wrap up what I started
@dnolen: best place where i can read up on what needs to be done?
@johannjohann: Google Closure Compiler error logging needs to be source mapped, then somebody needs to kick the tires with it to determine what works and what doesn’t.
@aav: that's quite possible; Prolog's old enough to be it. From what I can google about ISWIM and SASL they didn't seem to have a wildcard pattern and ML's younger than Prolog.
Does anyone have a link to some good examples of how to do interop between native iOS objects/functions and Om/React/ClJs?
Everything I've found is out of date or assumes I'm just trying to write my entire app in cljs. Which would be cool but I need to touch core data at some point
There is a dedicated channel #C0E1SN0NM for mobile development, many folks are there already
Oh cool thanks :)
Is anyone aware of a cljs project (looked at prismatic/dommy) that will take a string of HTML and help let me select elements from the HTML string?
@tom something like https://github.com/ckirkendall/enfocus ?
Is there a was to pass in different variables in the project.clj file? I was to inject a dev security token when dev but nothing when it’s compiled for production.
@puppybits if this is for clojure, you can specify different
:resource-paths
in the different profiles and then: (load-file (.getFile (resource "config.clj")))
, for examplei don't know of anything that would work out of the box, but worst case, you could script the builds from clojure
ok. i’ll try that. I was hoping cljsbuild had something built in. But I wasn’t finding anything.
@cfleming: I asked a pretty unreasonable question there on your HN thread; but to me that would be the cljs IDE experience I would want, as a frontend dev
Right now there’s nothing like that, although I’d like to add it. I’m actually planning to run a REPL over the debug connection at some point, which might provide better information.
@cfleming: the project that makes it possible is https://github.com/skeeto/skewer-mode
It was this I believe: https://github.com/ScottyB/ac-js2
It sounds like that uses js2 mode for completion (i.e. static like Cursive), and Skewer for evaluating
I may be wrong about that, given the example there, but I remember when using it that there was a ton of network communication going on...
Cursive does something similar for Clojure, but even there I’m thinking about dialing it back because it’s problematic (i.e. mostly slow).
@cfleming: IMO, but not being very familiar with IntelliJ/cursive, the major value proposition from cursive is mostly derived from the fact that it is JVM native
and in that sense, I wonder, if the best CLJS/browser dev experience would be something integrated into Chrome DevTools itself
As a beginner, the main value prop is that its much easier to setup than the other options, and I don't have to learn emacs.
@rantingbob: That too
Yeah sure, Emacs is emacs @rantingbob
Hey @cfleming I’m working on an update to ClojureScript’s ns
form and it occurs to me that it might affect Cursive with respect to symbol resolution.
I actually need to update the CLJS resolution for some cases that don’t work right now, like implicit :require-macros
@cfleming: I can write a Cursive ticket for it if you think it does indeed affect Cursive.
@mfikes: You could add a comment to https://github.com/cursive-ide/cursive/issues/775 perhaps, which I’m planning to fix soon.