This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-04-09
Channels
- # admin-announcements (1)
- # boot (225)
- # braid-chat (1)
- # cider (25)
- # cljs-dev (35)
- # cljsrn (1)
- # clojars (6)
- # clojure (81)
- # clojure-berlin (1)
- # clojure-dev (21)
- # clojure-france (2)
- # clojure-japan (6)
- # clojure-poland (1)
- # clojure-russia (10)
- # clojure-uk (3)
- # clojurescript (121)
- # code-reviews (1)
- # core-async (4)
- # core-logic (2)
- # cursive (15)
- # datomic (8)
- # hoplon (4)
- # jaunt (112)
- # jobs-discuss (35)
- # om (41)
- # parinfer (8)
- # re-frame (3)
- # reagent (4)
- # ring (2)
- # untangled (38)
@lwhorton: I usually do something like this: https://github.com/binaryage/chromex/blob/master/src/lib/chromex/logging.clj
(clj->js args)
should not be needed if you use cljs-devtools: https://github.com/binaryage/cljs-devtools
Does anybody know how to get static typechecking into ClojureScript? Typed clojure doesn't work with CLJS. I found a dialect of lisp called Shen which transpiles to JS but is evidently horrendously slow. You can interop with Haskell from CLJS via GHCJS or Haste (which I'm experimenting with now). I was curious if anyone here had tried anything else.
@george.w.singer: you probably already know Schema, which is runtime schema validation
@george.w.singer: do you want to embed a statically typed piece of JS into cljs?
I am familiar with it, yes; however, I was under the impression that it couldn't catch pre-compilation errors, and -- in addition -- adds a performance hit to your program since it runs at run-time
But perhaps the performance hit shouldn't worry me; and maybe it could be good enough?
@george.w.singer: it's either run time checks or a type system (core.typed)
@george.w.singer: you could also look into Google Closure Compiler annotations, it is usable, but must be done on javascript level, so you have to know how cljs compiler emits stuff.
@george.w.singer: you can however disable the checks in production if performance worries you
I have a project in mind, which would provide a clojurescript-ish DSL which would emit closure externs annotations
this is an example of an annotated externs file: https://github.com/binaryage/dirac/blob/devtools/front_end/externs.js
this is an example of annotated js file: https://github.com/binaryage/dirac/blob/devtools/front_end/console/ConsoleViewMessage.js
it is gradual type checking, you don’t have to use it everywhere, where you do Closure Compiler then gives you additional feedback and error checking
@borkdude: core.typed doesn't work with clojurescript AFAIK
@darwin: thanks for the GCC suggestion. It's a deal breaker for my use case if I have to annotate at the JS level.
@george.w.singer: there's also PureScript if you are looking for non-CLJS alternatives
@octo221: a bit late here But no, I don't think Reagent updates derived atoms. If you want global undo with Reagent, I think the simplest (and possibly only really viable) solution is to use one global atom. Re-frame ( https://github.com/Day8/re-frame ) is a pattern that makes the concept of a single r/atom more elegant, I think, though I haven't had the chance to use it yet. But depending on the size of your application, you may get by with just "vanilla" Reagent
Smaller than GHCJS, and also a subset of Haskell
Hi friends, I'm adding an :optimizations advanced build script to my project. Most things seem normalish but...the compiled code includes comments
@george.w.singer: I've also seen people be enthusiastic about ScalaJS, but if you're not using Scala already, then I'd go for something else
it's also 436k for what I believe is still a pretty small project, which seems high (but might not be)
@bpicolo: I'm seeing that too: http://michielborkent.nl/reagent-drag/drag.js
On another note: I'm using lein-figwheel for dev reloading and such. It seems when I set a trace on the frontend, I can't actually execute code in the repl during the breakpoint
@bpicolo: at least I think so: https://developers.google.com/closure/compiler/faq#license
externs just make sure the references to the library don't get mangled under advanced optimization
@borkdude: I mean, I need -something- to hash my assets and dump them to s3 at some point
> CSS files that reference images are rewritten so that they point to cache busting URLs.
@bpicolo: some libraries can have comments with special annotation @license which prevents their removal, those licenses should stay there, not sure if it is the case of your build, but react license should stay there
@bpicolo: now when I think about it, it probably was simply prepended before your advanced build as is. it came directly from https://fb.me/react-13.0.1.min.js
is there something special I need to do to get goog.history to actually update the location bar in the browser?
I'm also using the latest code from http://yogthos.net/posts/2014-08-14-Routing-With-Secretary.html
Hola cljs'ers, I have a polyfill that won't work when the html is produced by cljs+figwheel+react+reagent
Do you guys have an idea where that might come from? (if I copy the generated html and put it in a "dummy page" it works)
(polyfill is from http://codepen.io/sdras/pen/43c9d13b23bc34a85bb3a5e2ea985958 )
Does anybody know why ClojureScript fails to load a foreign lib if it is ES6 module which imports CommonJS module? Closure Compiler allows mixing of different module types https://github.com/google/closure-compiler/wiki/JS-Modules I actually tried to compile this directly with GCC and it compiles fine with —process_common_js_modules
flag specified. Not sure, but it seems like compiler settings in ClojureScript lacks this flag.
it also fails to compile CJS module which imports ES6 module
I need help with replumb
I’m trying to require macros
@roman01la: let’s move that conversation into #C07UQ678E
@viebel: Are you encountering an issue loading macro namespaces, or are you just trying to figure out how to do it?
@mfikes: I’m trying to figure out how to do it when the macros are defined in a clj
file
e.g. core.async
or core.match
@viebel: importing core.async
in bootstrapped doesn't work for now, @mfikes tried a port but it was not complete IIRC
what about core.match
?
Usually you need the classic clj
files wish macros in the class path for it to work (in replumb it is :src-paths
)
I am not aware of any port for core.match
But I totally agree that they should be supported
Mike last post on macros brought to the light a possible simplification of macros calling macros (the towering problem) in bootstrap
and what about importing macros that are implemented in a file that is part of my project?
In replumb, you macro files must be on src-paths
Ok. I’m trying
I'm aware of a port of core.logic
that was working, but not core.match
or core.async
. I ported cljs.test
(but didn't make the port generally available).
why a port is required?
@viebel: the main reasons have to do with Clojure macro code making use of facilities only available to Clojure. In self-hosted ClojureScript, macro code is compiled as ClojureScript. Some of the things encountered in the port of cljs.test
are documented here: https://gist.github.com/mfikes/4e9e78753a0d406da873 (but as @richiardiandrea indicated, a recent discovery that a tower is not always required simplifies things).
That last point is expanded upon here http://blog.fikesfarm.com/posts/2016-03-04-collapsing-macro-tower.html
thanks @mfikes I will look at the articles and gist
how can i create a future in clojurescript?
@sbondaryev: there's only one thread, this drives what's possible and available
@mfikes: actually, I need to make 2 async calls and wait for result
Otherwise, you can roll your own solution with callbacks and a little state management.
yes, I hoped to avoid solution with core.async by using something from clojure.core
You could potentially use http://funcool.github.io/promesa/latest/ -- though it is also not in clojure.core
Thanks for the link, I think i will try to make a simple/custom solution with goog.Promise