This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-06-16
Channels
- # admin-announcements (72)
- # beginners (41)
- # boot (93)
- # cider (50)
- # clojure (173)
- # clojure-berlin (19)
- # clojure-dev (2)
- # clojure-greece (3)
- # clojure-israel (2)
- # clojure-italy (32)
- # clojure-japan (33)
- # clojure-nl (8)
- # clojure-russia (3)
- # clojure-seattle (1)
- # clojure-sg (1)
- # clojure-spain (16)
- # clojure-uk (4)
- # clojure-ukraine (1)
- # clojurescript (170)
- # code-reviews (20)
- # core-async (3)
- # datomic (5)
- # docs (28)
- # editors (17)
- # euroclojure (2)
- # events (7)
- # instaparse (18)
- # jobs (25)
- # ldnclj (11)
- # om (26)
- # overtone (3)
- # remote-jobs (3)
- # sneer (1)
@mfikes, oh man, look at him go: https://github.com/clojure/clojurescript/commits/master
@meow: thanks, just fixed the typo
I wrote that a year ago, but it’s missing a quite a few of things. hope to have a more complete version on the website...
@meow: for a more complete look, you can use the syntax table here: https://github.com/cljsinfo/api-refs/tree/catalog#syntax-api
it doesn’t have description text for each yet, but you can click or edn icons next to each one for external docs
@shaunlebron "Let's go Nolen!" (clap, clap, clap clap clap)
👏 👏 👏
@dnolen @maria @mfikes i’m struggling with a cljs compilation issue
how would i debug this? i’ve narrowed it down this dep being on the classpath when the compiler runs: [io.pedestal/pedestal.service "0.4.0”]
i’d like to avoid splitting class paths for clj / cljs / cljc, but this issue is preventing me from doing so
any ideas?
is this a bug in cljs? https://github.com/clojure/clojurescript/blob/r3308/src/main/clojure/cljs/analyzer.cljc#L2040
ok. tracked it down to mismatched tools.reader
i would like to use cljsjs/google-maps, so i added [cljsjs/google-maps "3.18-1"] to my project dependencies. But i am not able to require it in my ns with (:require cljsjs.google-maps)
and i get an error that the compiler could not locate cljsjs/google_maps.cljs !
created this issue: https://github.com/cljsjs/packages/issues/146
@thomasdeutsch: try requiring google.maps
instead. not sure if that's even needed before using it, maybe just refer to js/google.maps in your code
@thomasdeutsch: "The jar only provides an extern file required for advanced compilation."
@thomasdeutsch: or maybe you need a :foreign-libs
vec like in https://github.com/clojure/clojurescript/wiki/Foreign-Dependencies
acron: are they not compiling or not shown in your browser? i'm having better experiences with chrome than with firefox here
Well, project.clj references "resources/public/js/out.js.map" but this file doesn't exist
I `(let [service (new js/google.maps.places.AutocompleteService) request #js {:input "Hannover"}] (. service getPlacePredictions request cb-fn)))`
I try to call the function getPlacePredictions with 2 arguments, but fail to do so. How can i write this in clojurescript: service.getPlacePredictions(request, cb-fn); ?
it was this: (. service (getPlacePredictions request cb-fn))
Any hints on how to debug cljsjs packages not getting included with advanced compilation? I added [cljsjs/jquery "1.9.1-0"]
and jQuery isnt't there in the resulting app.js file. At the same time, [cljsjs/moment "2.9.0-0"]
works just fine. Where do I start looking?
just because you add a dep doesn’t mean it will appear, you need an explicit require. I’m assuming you do?
[the app still doesn't work in advanced compilation mode, but I'm making progress :)]
Hmm, it seems that cljsbuild doesn't warn about if an externs file I specified cannot be opened… it's kind of hard to even debug this, as I have no idea where it's looking for it. And it seems other people had the same problem: https://github.com/clojure/clojurescript/pull/44 http://dev.clojure.org/jira/browse/CLJS-994
@jrychter: there’s a downstream bug in cljsbuild, we cannot supply a warning without breaking all cljsbuild users.
added a Tip & Tricks section to the Wiki with an entry on Advanced Compilation https://github.com/clojure/clojurescript/wiki/Advanced-Compilation
externs file just needs to be on the classpath. it’s easy to test that it will work by copy and pasting your path into a regular Clojure REPL
@dnolen: thanks, I discovered that a couple of minutes ago when I got a warning for a duplicate extern. Now trying to figure out how to include external js with :libs. Same problem: option gets quietly ignored, I have no idea what lein is trying to do for me and why it doesn't work. Life would be much easier if every bit of software included a "verbose" option that printed what the software is trying to do.
there is a :verbose
mode in ClojureScript though we could probably do something more wrt to externs
:libs
is for Google Closure compatible libraries not provided by Closure itself, do you have those?
I am trying to add Semantic-UI — what I have is semantic.js and a tiny externs that I wrote myself. I thought :libs ["resources/public/semantic"]
in my :compiler
section was supposed to pick up the .js files that are in that directory and include them in the output being compiled. I guess there is more to it.
is there an easy way to rewrite urls server-side in figwheel? or do I have to provide the whole ring handler? I need to serve app page under every url except those related to assets. I've found 'rewrite-urls' but it's client-side option from what I see.
@jrychter: all of this is now covered in detail on the Wiki https://github.com/clojure/clojurescript/wiki/Dependencies
@dnolen: how did I not find this page… I've been googling this for at least an hour now. Thanks, will read carefully now.
(I did discover :foreign-libs in the meantime and managed to include the js, although it doesn't get compiled, just included)
@dnolen: I never thought of looking into the wiki. I thought this is entirely a leins-cljsbuild thing.
@dnolen: and that's what I've been missing. Ok, thanks for your help, I'll read the wiki now.
feedback on the wiki is always welcome, happy to see it become the source of truth https://github.com/clojure/clojurescript/wiki
works under ClojureScript master , still more work to do around macros but color me impressed that the core bits of ClojureScript require so few changes to compile itself.
That's fantastic 😄
@dnolen: so, to prove I really did read the wiki docs now, I suggest s/ClosureScript/ClojureScript on the Dependencies page.
great job @dnolen !!
@jrychter: yeah if you’re going to use a random library it really cannot be done as an after thought
you need to build production periodically as you develop otherwise you end up where you are.
@dnolen: no, my problems are much more basic than that. I'm finally getting somewhere, but I've wasted I'd say about two hours today on silly mistakes like pointing :externs to non-existent files (which there is no warning about). The second problem was that if one places the externs.js file in src dir, the compiler will abort with "SEVERE: ERROR - Duplicate extern input" — which would seem to indicate that one can place externs in src dir and they will be automatically read.
@jrychter: Have you seen this: https://github.com/cljsjs/packages/issues/3 ? That might give you some pointer.
I use it because I want lein's declarative deps -- what's the recommendation going forward?
@jeluard: yes, I actually grabbed their externs file finally (it's almost complete), thanks
> cljsbuild is broken, and it’s one of many ways in which it is broken. I’m pretty happy with my boot-cljs setup but also Figwheel is probably an alternative
@dnolen: well, I guess for now I should write the experience up somewhere, so that at least it's googlable. And I did finally get this to work — by moving externs out of src dir and getting the path in :externs right. I'd say that the lack of warning/error for nonexistent extern files is the major culprit here, but I understand this isn't easily fixable.
@zoldar: yes you would have to provide a ring handler. But I'm really trying to steer folks away from using that option. I know its convenient but the sooner you are on your own server the better.
@jrychter: Packaging a JS lib as a CLJSJS package is probably the best option if you don't want to rely on lein-cljsbuild conf.
Perhaps I should switch to boot. Now I'm still getting ERROR: JSC_DUPLICATE_EXTERN_INPUT. Duplicate extern input, even though the file is out of the src dir, and I have only one.
(be aware that boot also won’t magically solve problems )
@jrychter: btw, you can build cljsjs packages very easy on your own machine using the tooling that is part of the cljsjs project
@martin: yes, I realize that (about boot), we're using it in another project. I think the problem is systemic, and not specific to cljsbuild. Our software systems get more and more complex, and we spend more and more time setting up files/dirs for them. Software should tell us more about what it is doing, without resorting to tools like strace/truss. Can't find a file? Tell the user. Looking for a file? Tell the user where you're looking.
I think ClojureScript could also do more — with :verbose, I'd like to see which extern paths are provided to the Closure compiler, for example.
Also you can use CLJSJS packages with lein. Having all JS related plumbing in CLJSJS packages helps reducing the complexity of your lein conf.
I'd kill for Semantic-UI in CLJSJS, but until it's there (and it isn't obvious how to get it there, as Semantic normally requires configuration and building), I have to make do.
@dnolen: yes, I'll try to find a moment and look at it. Perhaps I'll be able to contribute an improvement.
@jrychter: it's not that much work really plus it might be almost there https://github.com/exicon/hoplon-semantic-ui/blob/master/build.boot
weird question with low context, but... what could be the reason that Om does not update component implementing IRenderState after om/set-state! even should-update is not called. I guess I've done smth bad in my app provoking this behavior, but can't understand where to look
hmmm... the same code worked well earlier. may be core.match is not compatible with the latest cljs?
but i had no problems earlier with setting state from go block, including exactly this code which is doesn't work now
@dnolen: excuse me, but how could om/set-state! fail being called from go-loop? where to look at to fix/workaround it?
@ul: printlns can be helpful -- make sure errors aren't being thrown -- have a peek at the generated js perhaps
@nullptr: thanks, will go into sources. no errors thrown, any other function placed instead of set-state! (e.g. print) is called in normal way
i had an issue once where set-state was called successfully but didn't update due to raf issues (now fixed) -- esoteric issue, but see https://github.com/omcljs/om/issues/253
@maria: I've attempted to create a minimal setup to try CommonJS, but get a failure. I put it here: https://github.com/mfikes/test-commonjs
@maria: I fixed one silly thing (passing :foreign-libs) to REPL but got a different error. Updated that repo. Thanks for helping! I bet I'm close to getting it working. (Take your time, I'm just messing around with it. :) )
@mfikes: thank you for putting the repo together, but not sure yet, what the problem is. Will need to investigate this now 😉
If I want to use core.async with CLJS, is it best to use lein to manage the dependencies?
@erichmond: yes, lein will work.
@dnolen: does Om component update after set-state! rely on assumption that (swap! app-state identity) will trigger watches?
i see that -set-state!
calls -queue-render!
, which implementation adds component to render-queue
https://github.com/omcljs/om/blob/master/src/om/core.cljs#L1065
but render-queue
is local to setup
, and accessed in outside world through -get-queue
, which is used only here https://github.com/omcljs/om/blob/master/src/om/core.cljs#L1163
and that place is inside rootf
which is called only being added to refresh-set
inside state
watcher
thus i suppose that update goes in that way: when state
trigger its watchers, rootf
is added to refresh-set
and render-all
is scheduled on next animation frame, where rootf
is executed and, particularly, updates components in render-queue
#C06DT2YSY channel? 😉
@aengelberg: thank you, missed it, it was created today
@ul you’re getting into the nitty gritty details of Om which are likely to change, but I answered in the #C06DT2YSY channel.
Just posted some simple thoughts on composable build scripts for cljs to see what folks think: https://gist.github.com/bhauman/5c50a25f28598d954eba
@bhauman: having more generalized watch function would be nice, but I like it a lot! Go go boot!
> This system would not require buy-in just adhearance to a simple interface. Doesn’t “adhereance to a simple interface” lead to the same “buy-in” requirement?
A message based approach is definitely interesting I think, esp. for parallelism.
I think buy-in is referring to a different problem in the Clojure(Script) build tool space (and I may be inaccurate here), but people don’t often supply Lein plugins and Boot plugins as a l carte reusable bits separate from the integration bits.
while deps.cljs
is not a generic mechanism for what’s described here, the fact that anyone can use it is a plus over something that works with a specific build tool.
observing how things have gone in the JS world, seems like declarative or imperative … you might not end up some place good
> as a l carte reusable bits separate from the integration bits. Could you elaborate?
as @bhauman has already alluded, even when they do the interface is ad-hoc and not necessarily composable w/ anything else.
In my experience Boot provides such interface (the Fileset) and almost all tasks use it, thus they are easily composable. Have you made any contrary experiences?
I think some really good points are being made here. I recently learned boot and started using it on a couple of projects. While boot is quite composable and was definitely designed with that in mind, most of the boot-based tools that I found "in the wild" took advantage of that composability but were themselves monolithic tools that made far too many assumptions about what combination of "stuff" I wanted to use in my project. So what did I do? I learned from their examples but ended up using boot at a low-level, composing all my own boot tasks. If I'm not alone then that seems to indicate that something in this realm could be improved. And if the guy who wrote figwheel (a tool that appears to be universally loved by all) has something to say about it that certainly gets my attention.
Which browser versions does ClojureScript support? I had a look and couldn’t see anything specific for ClojureScript. Does it just follow Closure browser support?
@danielcompton: we generate the same JS that was shipped in 2001 browsers