This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-06-17
Channels
- # admin-announcements (103)
- # beginners (4)
- # boot (101)
- # cider (64)
- # clojure (126)
- # clojure-australia (1)
- # clojure-berlin (21)
- # clojure-china (1)
- # clojure-dev (11)
- # clojure-germany (13)
- # clojure-india (1)
- # clojure-italy (20)
- # clojure-japan (43)
- # clojure-poland (7)
- # clojure-russia (9)
- # clojure-spain (4)
- # clojure-uk (10)
- # clojurescript (152)
- # core-async (2)
- # css (51)
- # editors (25)
- # events (2)
- # instaparse (17)
- # jobs (1)
- # ldnclj (50)
- # om (7)
- # reactive (7)
- # reading-clojure (1)
- # reagent (1)
- # remote-jobs (1)
michaelr: this is common if you have split your app into multiple files -- it only reloads what has changed so if you don't change the file with om/root it doesn't re-render
you can add a function which figwheel always runs and put om/root in there or i believe there is some metadata you can add to the root ns to always reload that file
Got @maria’s CommonJS ClojureScript compiler support working with Ambly on a device for the first time! One less hurdle. If you are interested, recorded a demo of it: https://youtu.be/CS0RU2oUq7s
Well, it seems I am completely stuck with "ERROR: JSC_DUPLICATE_EXTERN_INPUT. Duplicate extern input" from lein. I only have one file with externs, referenced once in project.clj (as :externs). No matter where I try to place it, I get this message. And it seems to be a lein-cljsbuild problem, because I get it from lein uberjar
, but lein with-profile uberjar cljsbuild once
works and builds correct JavaScript. Sigh.
@thheller: the file, you mean? Currently :externs ["semantic.ext.js"]
, although I tried various locations for it.
@thheller: the file contains a bunch of lines of the form jQuery.fn.checkbox=function(){};
. But I don't think this is the problem — things do work if I just invoke lein with-profile uberjar cljsbuild once
.
Exposition of how Ambly is experimentally using CommonJS lib support (towards React Native): http://blog.fikesfarm.com/posts/2015-06-17-commonjs-libs-in-ambly.html
ah cool @shaunlebron !
@dnolen: Interesting.
Yes, we are aiming to develop the Web’s polyglot-programming-language object-file format.
Bottom line: with co-evolution of JS and wasm, in a few years I believe all the top browsers will sport JS engines that have become truly polyglot virtual machines.
@escherize: definitely a cool development but we’re definitely looking at at likely 3-4 year timeline before there will be anything worth targeting for ClojureScript
https://github.com/WebAssembly/design/blob/master/FAQ.md#is-webassembly-only-for-cc-programmers
anybody that’s ever submitted a patch to ClojureScript or even think they may one day, #C06E3HYPR is a good place to hang
@alexmiller just mentioned a nice patch to unify clojure.string across Clojure/ClojureScript
gains are you can now target places the JVM can’t reach easily (Electron/Atom Shell), hopefully write scripts w/ zero startup time over Node.js, show off your library with a REPL on a public website w/o a separate compilation web service.
yes so Google Closure will supported but it will need to be a separate step if you want to use it
@dnolen: we could achieve macros in cljs, don't we? Do you think there is value on that?
@andrewhr: a bootstrapped thing will never support that and in fact there will be safe guards to make it very, very hard to mix macros and runtime code.
because A) it’s seriously not important B) it would fork the ClojureScript world, i.e. uncompilable stuff for ClojureScript JVM
Does that mean cljs-in-cljs REPLs will have no support for macros? Or can they use macros but not create them?
@aengelberg: you will be able load macros just fine and even properly expand them
@aengelberg: none of safe guards will be unsurmountable
So were you just saying NO for "macros in cljs source code"?
it will just make people trying to mix code & macros into one source have to do ugly hacks
@aengelberg: no the only thing we will prevent is mixing macros and runtime code into the same .cljs or .cljc file
that is as long as the macro files do not interact with the runtime files you’re fine - even if they both actually exist at runtime
this means you have something that will work for ClojureScript JVM and ClojureScript JS
Cool. Captured the naming aspect: https://github.com/clojure/clojurescript/wiki/Differences-from-Clojure#macros
Ahh… I think I got it: The analyzer never sees, for example defn
. Macroexpansion occurs first, and after that, only specials or fns exist to be analyzed and then compiled.
If I’m understanding correctly (+ 1 1)
involves the macro (at least initially), while (reduce + [1 1])
involves the fn.
@dnolen: Thanks! I’ll add some stuff to the Wiki to help others avoid meta-circular meltdown.
Did my best to capture this. Feel free to correct my inaccuracies: https://github.com/clojure/clojurescript/wiki/Differences-from-Clojure#macros
@mfikes, thanks for asking that question, I never made that connection with the naming conflicts between the core macros and functions
@shaunlebron: Yeah. I suppose it caused a question or two when you are generating your doc tooling and you see both.
yeah, I just include both sources, but default to the function implementation: https://github.com/cljsinfo/api-refs/blob/catalog/refs/cljs.core_PLUS.md
@shaunlebron: I bet that’s safe. If you have a name collision then it is probably only sane if the macro and function have roughly the same semantics.
This could be beneficial. In ClojureScript, you could support something like (map or xs)
(ignoring what that really means for now).
In other words, if you define a macro foo
and feel compelled to be a good citizen and provide a foo*
function for use in cases where a macro won’t do, perhaps a foo
function could be defined.
is this slack channel being archived somewhere? I feel like there’s a lot of good information here that I would like to search through someday
ugh, there’s a 10,000 message limit, but that’s a sum limit across all clojurians channels
@shaunlebron: They all are. I’m looking for the links right now.
FWIW, I’ve been trying to take clarifications, etc., and incorporate them into the Wiki.
@mfikes: yeah that’s really the best idea, thanks for doing that
@shaunlebron: I suppose only an extremely small subset of the info here really is suitable for the Wiki. (Things that the Wiki covered, but perhaps not clearly or comprehensively.) But, you are right that some odd side things are best just being searchable.
@shaunlebron: Not a problem.
love the integrated google search, someone gave this some thought
@akiva, added a wiki link to the chat logs, could be useful: https://github.com/clojure/clojurescript/wiki#chat
I wonder if this has supplanted irc
so looking forward to porting this to ClojureScript http://www.amazon.com/gp/product/0262527952/ref=ox_sc_act_title_1?ie=UTF8&psc=1&smid=ATVPDKIKX0DER
@markstang: it works, I haven’t touched it in a while and probably won’t have time to any time soon.
I’ll probably revisit a little bit when CLJS can compile itself as an online CLJS mK would be fun
@akiva: Do you know if Log Bot is a thing that can be leveraged elsewhere? I’m working with another group that’s considering using Slack, but people there really want logging and this looks like it might help a lot.
@dnolen: I am sure the “Dr’s” would love an online ClJS mK. I think they were asking about it a while back...
@nicmcphee: I’m pretty sure it could be. It just needs to be installed and configured.
Is there a way (or roadmap) to get the terminal to recognize clojurescript test suites failing as a nonzero exit code?
Currently CI systems will accept it even if they do lein cljsbuild test
and get failures on the node output e.g.
I'm not even sure which component (clojurescript, cljs.test, lein-cljsbuild) can be improved to make that work properly...
Is there a good reagent example of a reusable dynamic list component, something where items get added/updated/removed, and the values have to bubble up to the parent container? Specifically, is there a clean way to update changes in a vector without contaminating the line components with parent state?
@aengelberg: this seems very specific to the runner you are using and very little to do with ClojureScript. When your tests are done invoke the proper exit (with code).
that's what I'm curious about... how to exit with a code?
maybe there's a way to do that specific to node.
Sweet. So that would be translated to (.exit js/process 1)
?
thanks
Just asked in #C0617A8PQ, perhaps more relevant here; do cider and the figwheel repl play nicely, or do people tend to drop back to inf-clojure?
still haven’t heard many confirmed reports of it working using all up-to-date dependencies
inf-clojure definitely works as does anything that supports inferior-lisp like interaction, Cursive and I assume Sublime
Can't figure out why my defmethod isn't working here (per cljs.test wiki instructions).
cljs.user=> (require '[cljs.test :as t :refer-macros [deftest]])
nil
cljs.user=> (deftest my-test (t/is (= 1 2)))
#'cljs.user/my-test
cljs.user=> (defmethod cljs.test/report [:cljs.test/default :end-run-tests] [m] (println "Look what I found" m))
#<[object Object]>
cljs.user=> (t/test-ns 'cljs.user)
Testing cljs.user
FAIL in (my-test) (at /home/alex/git/instaparse-cljs/.cljs_node_repl/cljs/test.js:384:41)
expected: (= 1 2)
actual: (not (= 1 2))
nil
@aengelberg: try t/run-tests
instead of t/test-ns
cljs.user=> (t/run-tests 'cljs.user)
Testing cljs.user
FAIL in (my-test) (at /home/alex/git/instaparse-cljs/.cljs_node_repl/cljs/test.js:384:41)
expected: (= 1 2)
actual: (not (= 1 2))
Ran 1 tests containing 1 assertions.
1 failures, 0 errors.
nil
Doesn't work on nashorn repl either
cljs.user=> (t/run-tests 'cljs.user)
Testing cljs.user
FAIL in (my-test) (at <anonymous> (.cljs_nashorn_repl/goog/../cljs/test.js:NaN:384)
expected: (= 1 2)
actual: (not (= 1 2))
Ran 1 tests containing 1 assertions.
1 failures, 0 errors.
nil
@aengelberg: what version of ClojureScript ? 0.0-3308?
3165... ick
How are the version numbers determined? I'm just curious since they look rather arbitrary
Now I'm getting:
Exception in thread "main" java.io.FileNotFoundException: Could not locate cljs/util__init.class or cljs/util.clj on classpath: , compiling:(cljs/closure.clj:1:1)
possibly because clojure/cljs/util.clj got moved to util.cljc?or I need clojure 1.7.
yup, that's it.
https://github.com/clojure/clojurescript/commit/87f39511a54d7b91ae86f581fda90f280f985816
@aengelberg the version number is the number of the commit
aha. thanks.
@maria is on a roll! 🎢
Wow, that was fast, I just uploaded the patch 20 minutes ago…thank you for merging @dnolen
Probably a question that has been answered multiple times by now: does AMD/CommonJS support mean we don’t need externs when we have JS in those module formats?
What does “might” mean in that context?
you will need externs if the library is going to do something dynamic w/ strings & Object properties
fortunately that doesn’t seem quite so common as it once was at least for major libraries
Ah, I now remember reading that in the scrollback some day, thanks
@martinklepsch: Here is a simple example for when you would need externs:
greeting["bye"] = function(name) {
return "Bye, " + name;
};
And also reading this might help to understand when you need externs: https://developers.google.com/closure/compiler/docs/limitations
@martinklepsch: thanks to the vagaries of JSPerf abuse there’s now a useful myth that .foo
is faster than [“foo”]