This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-07-11
Channels
- # arachne (5)
- # beginners (28)
- # boot (59)
- # cider (10)
- # cljs-dev (10)
- # cljsrn (10)
- # clojure (58)
- # clojure-brasil (2)
- # clojure-czech (9)
- # clojure-miami (1)
- # clojure-poland (2)
- # clojure-russia (12)
- # clojure-spec (16)
- # clojure-sweden (1)
- # clojure-taiwan (1)
- # clojure-uk (77)
- # clojurebridge (3)
- # clojurescript (108)
- # cursive (5)
- # datomic (25)
- # defnpodcast (2)
- # editors (1)
- # events (1)
- # funcool (24)
- # hoplon (37)
- # instaparse (1)
- # lein-figwheel (7)
- # leiningen (7)
- # luminus (3)
- # off-topic (9)
- # om (90)
- # onyx (88)
- # proton (3)
- # protorepl (9)
- # re-frame (30)
- # reagent (23)
- # rethinkdb (2)
- # untangled (33)
- # vim (1)
- # yada (6)
For the following https://apis.google.com/js/client.js i wrote externs.js as var gapi = function () {}; it is working well in development mode ,but in production mode it is not working
@vinodg: looking at the API docs, it doesn't seem that the externs are complete. Thats the most likely cause of the problem. A good guide for creating externs is: https://github.com/cljsjs/packages/wiki/Creating-Externs
its likely you are using functions from the API which haven't been provided in the extern
@vinodg: btw, I think what you are using may already by packaged by #C0E66E1H7 team. Have a look at this: https://github.com/cljsjs/packages/tree/master/google-platformjs-extern
Looks like the extern file is already present for it. So just include this repo as a dependency in your project and you should be good to go if its the right one
Hey I am refering i.e. refer
a record from a cljc namespace into cljs but when I use it ->Foo
it says that the var is undeclared.
According to brave clojure "When you create a record, the factory functions ->RecordName and map->RecordName are created automatically."
@urbanslug: could you share some basic code of how you are using them. For me, they work as expected even from a cljc namespace.
(ns cljctest.core
(:require [cljctest.record :as r]))
(def a (r/map->RecordName {:data 1}))
For me even this works:
(ns cljctest.core
(:require [cljctest.record :as r :refer [map->RecordName ->RecordName]]))
(def a (map->RecordName {:data 1}))
(def b (->RecordName 1))
Because I did try that refer, maybe a different error š let me see. I seem to get the error elsewhere
How do I begin to debug an advanced cljs build that just tells me Uncaught TypeError: Cannot read property 'core' of undefined
? Non-optimized runs fine.
@petrus: are you using any external js libraries for which you haven't provided externs?
@rohit, AFAIK, only using reagent/react. How do know if a dep is an external js lib?
Does unoptimized cljs also look minified?
OK, so Iāve confirmed that :optimizations :none
is fine, but :advanced
breaks with no error or stack trace aside from the above. Is this most likely to be missing externs?
Ooh, I think I know the problem xD I havenāt exported my main function that Iām calling! Thank you @rohit
@eyelidlessness: Iām pretty sure binding
inside of a go
block isnāt going to work - you might want to double check the behavior under Clojure - but I donāt think it will work there either
@denisj: whatever people use for Node.js should work - Iām assuming people have already tried to figure this out for TypeScript, JSX, etc.
@dnolen: is that by design/expected, or just a defect?
@eyelidlessness: expected
er. shouldn't it error rather than corrupting vars?
@eyelidlessness: very debatable
why would it be preferable to silently corrupt state?
@eyelidlessness: Iām not the person to talk to about this
i'm just trying to understand why you said it's "very debatable"
bring it up in #C03S1KBA2, I donāt have anything more to add. I said ādebatable" since most people donāt use binding
in async situtations because it doesnāt work
okay then...
meaning you would have encountered the exact same problem with any async code, core.async not with-standing
Hi all. Would anyone know why source-mapped files won't show CLJS content in Chrome? Source-maps are correctly detected, I can see cljs files in the source tree in dev tools but when I jump to cljs source Chrome shows empty file. Problem seems to concern only files that have &rel=some-long-number
show up in the tooltip when u hover over them. So, for instance cljs/core.cljs
shows up fine, but cljs/reader.cljs&rel=14...07
doesn't show any content. Same goes for my client code. Could anyone help me investigate what's wrong? I don't see any errors in the console. Compilation is done with figwheel.
where is &rel=...
coming from?
if it's being appended to some URL intended as a query string, the query string must begin with ?
, with additional params separated by &
i honestly wouldn't know where those & come from. Source maps are generated elsewhere, right.
presumably from the cljs compiler. but something is appending to those paths.
so I see stuff lieke this there:
"sources":["client.cljs&rel=1468248434134"],"lineCount":15
not deeply knowing how cljs compiler builds source maps, i would suspect that it's being appended before the compilation, somewhere either in configuration or some library
this is timestamp appended by cljs compiler if you use option :source-map-timestamp https://github.com/clojure/clojurescript/wiki/Compiler-Options#source-map-timestamp
but it should be appended with ?
not with &
well, there it is. Although i don't know where :source-map-timestamp is even set. Not in my project.clj that's for sure
So, i don't know how this stuff works but I wonder if this commit created the problem or actually solved it https://github.com/clojure/clojurescript/commit/ad3aa4a403a3024e818902dc7a2e45831bde6dad?diff=split
hello guys! I wanna your sincerely opinions about this: if Iām already good on html + css + js, used to work with ReactJS everyday, should I still learn clojure script or I can keep my frontend with my JS skills? what do you guys think? I mean, for me itās ok to learn that, as Iām already doing the backend in Clojure, but if one day the company decides to keep me only in the backend, I suppose we are going to restrict a lot to hire a frontend guy.
@leo.ribeiro: I think it just depends on whether you want to keep such a strong front/back distinction
I know a lot of instances where yes itās Clojure on the backend and X on the frontend. But lots of people like the conceptual unity of Clojure effectively for both tasks.
got it
anyone know how can foreign-libs
export themselves to the global scope so that they can be accessed by js/
context: I'm building a cljs app which needs few JS foreign-libs, I compile my cljs app with its js lib dependencies to one js file and require that from some large JS application using webpack's require()
function
But this way, webpack's require()
would create a closure around the module, so that my JS dependencies cannot be seen at the global scope
@blance it is something to handle at the Webpack or some other build tool level - Iām assuming libraries can export themselves to the global scope if need be
yes the simplest thing to do is to make a foreign dep of all the various things you want to use from NPM or whatever via whatever build tool you want, exporting whatever you need (if these deps arenāt available on http://cljsjs.github.io)
we do have basic support for integrating ES6 modules and CommonJS modules but this support probably needs more eyes and more work
thereās also been some Closure breaking changes here which I havenāt had time to look into
@blance I do not recommend going down that path unless you have a lot of time on your hands
there are cljsjs packages for the lib I use but it needs to be exported to global scope anyway correct?
I guess I'll just look at the source code of those lib and rebuild them for my project
So all in all, Clojurescript can only use JS libs through global scope? That doesn't seem like a very good design choice?