Re: [ClojureScript] JS natives referenced via `this` do not dispatch on protocols properly

2013-12-17 Thread Thomas Heller
FWIW I had some troubles with native types before, mine were related to IE though. The culprit for your troubles is goog.typeOf (which is a basic wrapper arrount js/typeof). If you run this via phantomjs - console.log("typeof", typeof(5)); Number.prototype.foo = function() { console.lo

[ClojureScript] Re: ANN: Om, a ClojureScript binding to Facebook's React

2013-12-19 Thread Thomas Heller
Hey David, looks really interesting although I have to be a little critical of your benchmarks. Add a download of 200 todos via xhr and then do the render, you will most certainly lose to other JS Framework out there (especially if you choose EDN over JSON) cause of the extra overhead associate

[ClojureScript] Improving cljs.closure :none vs other

2014-01-02 Thread Thomas Heller
Howdy, I wrote a build library https://github.com/thheller/shadow-build which replaces cljs.closure and I'd like the see some of the stuff I did flow back into core cljs. I wanted to start discussing some of the stuff I did since I feel the current situation is "bad" for ClojureScript in gener

Re: [ClojureScript] Improving cljs.closure :none vs other

2014-01-02 Thread Thomas Heller
Now if I could only convince everyone that closure JSModules should be used always since they are way more flexible. @david: I'll look into creating a patch but unfortunately I realized that cljs.closure is missing the extra part that you currently don't define "main" namespaces and everything

Re: [ClojureScript] Improving cljs.closure :none vs other

2014-02-13 Thread Thomas Heller
On Tuesday, February 11, 2014 12:20:53 PM UTC+1, dead...@gmail.com wrote: > Hello Thomas, > > sorry for bringing up this old topic, but having endured hours of frustration > while trying to configure a build as a recent clojurescript adopter, I got > curious how you are using closure JSModules?

[ClojureScript] Re: Help with javascript / clojurescript interop

2014-03-10 Thread Thomas Heller
Hey, there are many ways to get the properties of a javascript object, but if you want to rely on advanced compilation and might miss some externs its probably best to use aget. (let [name (aget req "params" "name")] ...) But these work too (.. req -params -name) (-> req .-params .-name) If

[ClojureScript] Re: Help with javascript / clojurescript interop

2014-03-10 Thread Thomas Heller
don't recognise it from my readings. > > Cheers, > Mark > > On Monday, 10 March 2014 09:22:06 UTC, Thomas Heller wrote: > > Hey, > > > > there are many ways to get the properties of a javascript object, but if > > you want to rely on advanced compilat

Re: [ClojureScript] are Vars available for macros? Println from macros?

2014-05-31 Thread Thomas Heller
Hey, not sure what you are trying to achieve, since the compiler should already warn you if a var is not found. Might not do so when nesting defs. def/defn are top level forms und should not be nested, especially no def in a defn. As for your question: the CLJS compiler supports vars in macros,

[ClojureScript] Compilation failures

2014-06-30 Thread Thomas Heller
Your project.clj is missing a closing paren ")", thats why you are getting the EOF error with lein. HTH -- Note that posts from new members are moderated - please be patient with your first post. --- You received this message because you are subscribed to the Google Groups "ClojureScript" gr

[ClojureScript] Re: pr-str and #{} sets

2014-07-06 Thread Thomas Heller
On Saturday, July 5, 2014 9:53:33 PM UTC+2, Andrew Nguyen wrote: > I am using a combination of pr-str cljs.reader/read-string to communicate > between the front and backends. Everything has been working as expected but > I'm now trying to send data that contains a clojure set and pr-str seems to

[ClojureScript] Re: Understanding Dead Code Elimination

2014-07-14 Thread Thomas Heller
I've got no compiler-fu to speak of but the increase in size is due to schema.core defining a lot of Protocols/Types on "native" types. They are checked at runtime and therefore require basically the rest of cljs.core (I guess). But I wouldn't worry about it, the size is due to cljs.core (persi

[ClojureScript] Re: goog undefined error from clojurescript version 2197 and up

2014-07-16 Thread Thomas Heller
Hey, didn't try to reproduce with your example, but I know the cause. ;) http://dev.clojure.org/jira/browse/CLJS-826 goog is undefined cause the third party goog/base.js is used which just contains // This is a dummy file to trick genjsdeps into doing the right thing. // TODO(nicksantos): fix t

Re: [ClojureScript] Re: goog undefined error from clojurescript version 2197 and up

2014-07-16 Thread Thomas Heller
Excellent. Thanks! /thomas -- Note that posts from new members are moderated - please be patient with your first post. --- You received this message because you are subscribed to the Google Groups "ClojureScript" group. To unsubscribe from this group and stop receiving emails from it, send an

[ClojureScript] Re: Trying to compile calls to new google analytics API fails with advanced compilation

2014-07-17 Thread Thomas Heller
Hey, the problem is not that closure munges the window.ga function, it is that closure creates a var named ga which can be anything but is not the analytics ga. At least it was in my case. My solution was to use the renaming feature of the analytics snippet to use a name closure won't generate

[ClojureScript] Re: Uncaught Error: Assert failed: No more than 1024 pending puts are allowed on a single channel.

2014-07-17 Thread Thomas Heller
Not an Om user here but sounds like you are receiving messages faster than you can handle them. A "slow consumer" is a common problem in a messaging situation and core.async has 2 built-in ways to deal with that. You can either use (async/chan (async/slliding-buffer n)) or (async/dropping-buffe

[ClojureScript] Re: ANN: ClojureScript 0.0-2277

2014-07-26 Thread Thomas Heller
Hey David, CLJS-826 is only partly resolved in this release since it only takes effect with a new closure-third-party release since the current jar is causing the problem. Would be nice if you could build a new closure release and bump the dependency in clojurescript. Thanks, /thomas On Fr

[ClojureScript] Re: Om project download size

2014-07-26 Thread Thomas Heller
What does your build look like? Those sizes don't look like advanced compilation. Also you there is no reason to ever serve any javascript without gzip compression but first look into advanced compilation. {:optimizations :advanced} with lein-cljsbuild for example. Not using Om myself, but I h

[ClojureScript] Keyword Hashing

2014-07-28 Thread Thomas Heller
Hey, I'm running into alot of java.lang.IllegalArgumentException: Duplicate key: :display-as at clojure.lang.PersistentHashMap.createWithCheck(PersistentHashMap.java:67) at clojure.lang.RT.map(RT.java:1462) at clojure.lang.EdnReader$MapReader.invoke(EdnReader.java:631)

[ClojureScript] Re: Script tags in Html for different environments

2014-07-28 Thread Thomas Heller
Hey, if you are feeling adventurous you could try https://github.com/thheller/shadow-build, it is an alternate build "library" to lein-cljsbuild that I wrote that doesn't have that problem. But its quite alot more complicated to get started compared to lein-cljsbuild, never tried figwheel so n

Re: [ClojureScript] Keyword Hashing

2014-07-28 Thread Thomas Heller
se as soon as we have a patch. > > > > David > > > > On Mon, Jul 28, 2014 at 8:16 AM, Thomas Heller wrote: > > > Hey, > > > > > > I'm running into alot of > > > > > > java.lang.IllegalArgumentException: Duplicate key: :dis

Re: [ClojureScript] Keyword Hashing

2014-07-28 Thread Thomas Heller
Not much closer but some log output keyword a, keyword b, hash a, hash b :tags :tags 250931621 1771418977 :contract-type :contract-type -585196394 580786577 :voice-de-o2 :voice-de-o2 1348274488 1352616807 :voice-de-telekom :voice-de-telekom 475690556 2143804784 :voice-de-eplus :voice-de-eplus -167

Re: [ClojureScript] Keyword Hashing

2014-07-28 Thread Thomas Heller
Thought it might be related to https://github.com/clojure/clojurescript/commit/e92e8064813ed9a74c6dcf5bfd3adf5b85df1aea but can confirm that that is not the issue. At least the (imul 0x 5) outputs the correct -5. -- Note that posts from new members are moderated - please be patient wit

Re: [ClojureScript] Keyword Hashing

2014-07-29 Thread Thomas Heller
Gave up yesterday, will try more today. Last thing I tried (hash :test) (hash (keyword "test")) (hash (reader/read-string ":test")) and comparing those hashes, the error didn't show this way even when tried with several different test strings. Running out of ideas to test, but its reasonable t

Re: [ClojureScript] Keyword Hashing

2014-07-29 Thread Thomas Heller
Yes, I'm only testing Safari on iOS. Which looking at my logs seems to be the only one affected. Only Mobile Safari User Agents were sending maps with duplicate keys. No luck producing a more compact example though. -- Note that posts from new members are moderated - please be patient with you

Re: [ClojureScript] Keyword Hashing

2014-07-29 Thread Thomas Heller
Hmm it might be related to the way keywords are generated. The compiler will emit ":test" as new cljs.Keyword(null,"test","test",577538877) where the hash is precomputed in Clojure, if now for some reason ClojureScript generates another Hash for that keyword we have our problem. I'm not a math

Re: [ClojureScript] Keyword Hashing

2014-07-29 Thread Thomas Heller
Created a patch to address that :emit-constants issue. http://dev.clojure.org/jira/browse/CLJS-829 Can't say wether its related to the issue at hand but less duplicate code is always good. -- Note that posts from new members are moderated - please be patient with your first post. --- You rec

Re: [ClojureScript] Keyword Hashing

2014-07-29 Thread Thomas Heller
Thanks. I give up. I have no more ideas what to test, whats even more annoying is that when I attach the remote debugger BEFORE navigating to the page producing the faulty maps the bug doesn't show. If I do the exact same steps but attach the remote debugger AFTER loading the page the bug happ

Re: [ClojureScript] Re: ANN: ClojureScript 0.0-2277

2014-07-29 Thread Thomas Heller
Uhm small hint on how I'd do that? My maven-fu is weak. But given that https://oss.sonatype.org/content/repositories/orgclojure-1311/org/clojure/google-closure-library-third-party/0.0-20140718-946a7d39/google-closure-library-third-party-0.0-20140718-946a7d39.jar does not contain a goog/base.js o

Re: [ClojureScript] Keyword Hashing

2014-07-29 Thread Thomas Heller
No I don't. The smallest "test" I was able to come up was my production app. I was not able to isolate the issue and the app does way too much stuff to pinpoint anything. I can give you an URL and the steps to reproduce the issue but thats about it. Sorry, /thomas -- Note that posts from new

Re: [ClojureScript] Re: ANN: ClojureScript 0.0-2277

2014-07-29 Thread Thomas Heller
0.0-20140718-946a7d39"] Confirmed to resolve CLJS-826. On Tuesday, July 29, 2014 10:30:21 PM UTC+2, David Nolen wrote: > > Just add sonatype to your :repositories project.clj entry > https://github.com/technomancy/leiningen/blob/master/sample.project.clj#L79 > > David >

Re: [ClojureScript] Re: ANN: ClojureScript 0.0-2277

2014-07-30 Thread Thomas Heller
David its probably best to hold off on that release. It seems the closure-library HEAD version depends on a newer closure compiler version than the one available via maven. At least I'm seeing some renaming issues for advanced compilation. -- Note that posts from new members are moderated - pl

[ClojureScript] Re: ANN: ClojureScript 0.0-2277

2014-07-30 Thread Thomas Heller
Sorry, I would be if I could. Trying to track it down, but debugging an optimized build is not exactly easy. :( When using 2277 I have no errors, when using 2277 with the new closure lib release I have some "undefined" errors. That usually means some sort of renaming gone wrong. Error: Cannot

[ClojureScript] Re: ANN: ClojureScript 0.0-2277

2014-07-30 Thread Thomas Heller
Geez, 2277 actually works just fine. 2234 doesn't work, but it actually doesn't work with either closure-library version. Forgot that I reverted to 2234 due to the keyword issue. 2277 + [org.clojure/google-closure-library "0.0-20140718-946a7d39"] seems fine, except for that keyword issue. Sorr

Re: [ClojureScript] Re: ANN: ClojureScript 0.0-2277

2014-07-30 Thread Thomas Heller
affected. > > David > > On Wed, Jul 30, 2014 at 11:11 AM, Thomas Heller > wrote: > > Geez, 2277 actually works just fine. 2234 doesn't work, but it actually > doesn't work with either closure-library version. Forgot that I reverted to > 2234 due to the ke

[ClojureScript] Re: help ! modal control from clojurescript does not work

2014-08-06 Thread Thomas Heller
Looking at the code it seems like you are calling jquery style code without actual jquery. (.modal modal "show") .modal is a method provided via bootstrap.js/jquery and usually called as $('#div-modal').modal('show') I'm not sure on how you'd interface bootstrap with Om but I doubt that there

[ClojureScript] Re: How to catch exceptions that occur inside a go block

2014-08-24 Thread Thomas Heller
Since a go block is async you cannot try/catch from outside. You need to either try/catch inside the block and return the exception as the result of the go block or use an extra channel to handle errors. (def errors (async/chan)) ;; exception handler (go (loop [] (when-let [ex (! errors e

[ClojureScript] Re: cljs compiler implementation of function call

2014-09-10 Thread Thomas Heller
On Tuesday, September 9, 2014 11:06:07 AM UTC+2, Yehonathan Sharvit wrote: > I am wondering why the cljs compiler emits code that calls functions using > call and not straight js function call. > > > for instance:  > > > (defn foo []) > (foo) > > > is compiled to: > user.foo = function() { >

[ClojureScript] Re: Newbie advice on cljs + om?

2014-10-20 Thread Thomas Heller
As the author of shadow-build [1] and shadow [2] I'm obviously a bit biased on what to use on the CLJS side of things so I'll skip that part. As for CSS and other "static" assets (images, fonts, ...) I found it is best to make it a build/compile step and deploy it seperately from the application

[ClojureScript] Re: ClojureScript Browser REPL and Advanced Optimizations

2014-11-05 Thread Thomas Heller
In general the REPL is the development feature and advanced compilation is for production quality builds. I do not think it is possible (or even a good idea) to use a REPL with optimized builds as they do not allow for any kind of incremental updates. HTH, /thomas On Wednesday, November 5, 201

[ClojureScript] Re: javascript to clojurescript transpiler

2014-11-08 Thread Thomas Heller
On Friday, November 7, 2014 12:24:36 AM UTC+1, Tom Connors wrote: > I've got a project right now that uses javascript on the client and server > and I'd love to be able to migrate to clojurescript. I'm wondering whether > anyone is aware of any software that will transform the js into > clojures

[ClojureScript] Re: Password field issue inside a form in firefox

2014-11-09 Thread Thomas Heller
My guess would be autocomplete, stored in your browser. You can try (dom/input #js {:type "password" :id "test-password" :autocomplete "off"}). HTH, /thomas -- Note that posts from new members are moderated - please be patient with your first post. --- You received this message because you a

[ClojureScript] Re: alts!! (and alt!!) still make sense in CLJS when a :default is specified

2014-11-10 Thread Thomas Heller
That is a limitation of Javascript not core.async. Since you cannot block in Javascript (only one thread) you have to take the "callback"/async route for everything. Emulating blocking by running a loop is a bad idea since you cannot even pause/sleep and while that loop is running nothing else

[ClojureScript] Re: Standard way to provide externs for library authors

2014-11-10 Thread Thomas Heller
> and nothing works). > > On the other hand, conceptually, externs are part of a library, not my user > code. So, if library author thinks his library needs externs, he specifies it > and packs externs along with library code, and they’re automatically used > when I add depen

[ClojureScript] Re: Enforce a source file to be compiled first

2014-11-10 Thread Thomas Heller
That SHOULD be handled via the dependency graph of your namespaces, that means if one namespace requires code from another to be loaded it should list it in its (:require ...) declaration. This way you ensure that it was loaded in the right order. init.cljs: (ns init) (enable-console-print!)

Re: [ClojureScript] Re: Enforce a source file to be compiled first

2014-11-11 Thread Thomas Heller
Yes, but I would recommend using the require. It is much cleaner from the dependency graph perspective and tooling can support you way better. Also it is not that much work, maybe a couple seconds. I also tend to have a "util" namespace with general helper functions which is a good fit for the i

Re: [ClojureScript] Standard way to provide externs for library authors

2014-11-18 Thread Thomas Heller
Hey, had a bit of time thinking about things. "deps.cljs" seems like a band aid to be honest, it might be better than without but I imagine we run into all sorts of issues in the future. In my projects I use CodeMirror quite frequently with a handcrafted (sort of incomplete) externs.js. To get

Re: [ClojureScript] Standard way to provide externs for library authors

2014-11-18 Thread Thomas Heller
le reason I created shadow-build [2] in the first place was to save bandwidth for the user. /thomas [1] http://codemirror.net/ [2] https://github.com/thheller/shadow-build On Tuesday, November 18, 2014 3:18:57 PM UTC+1, Martin Klepsch wrote: > With what Thomas Heller described here it might

[ClojureScript] Re: Standard way to provide externs for library authors

2014-11-19 Thread Thomas Heller
Well yes, the compiler only needs to produce .js from .cljs. The "second phase" is "packaging" everything together, this is where Closure kicks in. That part needs externs, preamble and the like. I would agree that does not need to be in ClojureScript itself, the whole Closure part ist not act

Re: [ClojureScript] [ANN] shin — ClojureScript implementation in Ruby minus the JVM & Google Closure parts

2014-12-02 Thread Thomas Heller
Hey, good luck with your efforts. It seems to be that is was motivated by alot of frustration due to lein-cljsbuild and Google Closure. Most of the issues mentioned in "S-exps in your browser" are actually addressed in shadow-build [1], part of the reason I wrote it due to some frustrations I

[ClojureScript] [ANN] shadow-build 1.0.0-alpha1, now beginner friendly

2014-12-03 Thread Thomas Heller
Hello everyone, shadow-build picked up some users of the past few months which is great, but I still consider it way too hard to use for beginners. I now included some default build configurations to make it easier to get started and basically provide what lein-cljsbuild offers. Out of the box

[ClojureScript] Re: [ANN] shadow-build 1.0.0-alpha1, now beginner friendly

2014-12-03 Thread Thomas Heller
Hi Julien, headless tests probably fall into the category of advanced configuration but I'd consider creating a "standard" configuration for it if we can achieve consensus on how that should look and work. I basically test my CLJS code the way ClojureScript does itself [1,2] which can hardly b

[ClojureScript] [ANN] shadow-build 1.0.0-alpha2, now with live-reload (ala lein-figwheel)

2014-12-06 Thread Thomas Heller
Hello again, I added basic live reloading of js (ala lein-fighwheel) to the default "build-dev" configuration of shadow-build. I updated the example project to include this feature. See: https://github.com/thheller/shadow-build-example https://github.com/thheller/shadow-build-example/blob/maste

[ClojureScript] Re: Defining defmethod used at macroexpansion time

2014-12-07 Thread Thomas Heller
Hey, I'm honestly not quite sure what you are asking but maybe I can shed some light on the way the ClojureScript compiler handles Clojure code (ie. macros). Whenever the cljs.analyzer reads a (ns ...) form and encounters anything that mentions a macro, like (:require-macros [some.ns :refer (m

Re: [ClojureScript] Re: [ANN] Hipo 0.2.0 - a DOM templating library based on hiccup syntax

2014-12-09 Thread Thomas Heller
I've been using my own DOM library for a while now which always was fast enough for me. I started a new-ish implementation for my react/om experiments and I started using a simple memoization trick to do the "parsing" bit at most once. Basically its just (pseudo-ish code, not the actual code)

Re: [ClojureScript] Re: [ANN] Hipo 0.2.0 - a DOM templating library based on hiccup syntax

2014-12-10 Thread Thomas Heller
I got curious, think I found a way to get closer to the macro. Only does element contruction no attributes are set except id/className but that happens later anyways. Uses element.cloneNode https://gist.github.com/thheller/7faf1c28ca14c9865376 See the related js-perf (not by me) http://jsperf.c

[ClojureScript] Re: Possible require duplication issue with optimizations :none?

2014-12-14 Thread Thomas Heller
I noticed this a while back [1]. I ended up not caring anymore since it doesn't hurt and is removed by :advanced anyways. FWIW it is caused by the alias (:require [clojure.string :as str]) which ends with goog.require for 'clojure.string and 'str (which resolves to 'clojure.string). Without an

[ClojureScript] Re: Possible require duplication issue with optimizations :none?

2014-12-14 Thread Thomas Heller
Ah, I stopped looking at the .js a while ago. Never noticed that :as didn't cause this anymore. Anyways, this time I submitted the patch. :) http://dev.clojure.org/jira/browse/CLJS-908 Feel free to jump in there. Cheers, /thomas -- Note that posts from new members are moderated - please be p

[ClojureScript] Re: cljsbuild/closure compiler options

2014-12-24 Thread Thomas Heller
Hey, I just looked at the warnings code and it seems like a mistake that disabling one warning actually disables 3 by accident. Anyways, the warning definitions [1] are all pretty self explanatory, more so if you look at the actual text the produce in the error functions below [1]. You could

[ClojureScript] Re: Updating sorted set inside go block

2014-12-24 Thread Thomas Heller
Cannot say without the rest of the code but I what is in (:transformations resp)? sorted-set doesn't work if one item doesn't compare to another (eg. numbers vs maps). Suppose: (def a (atom #{})) => (var user/a) (reset! a (into (sorted-set) [1 2 2 2 3])) => #{1 2 3} (conj @a {:name "test"}) Cla

[ClojureScript] Re: Updating sorted set inside go block

2014-12-24 Thread Thomas Heller
-format) >:response-format (ajax/transit-response-format) >:handler (fn [resp](put! ch resp))}) > ch)) > > The error message indeed seems weird, but everything I tried so far indicates > a bug or a missing feature in core.async. > > In the meant

[ClojureScript] Re: Updating sorted set inside go block

2014-12-25 Thread Thomas Heller
d the second aspect is that updates outside of the go block always work, no > matter if it is a set or not. > > If it's still hard to follow I might put together a small example. > > Best Regards, > Sven > > > > Am Mittwoch, 24. Dezember 2014 22:14:02 UTC+1 schri

[ClojureScript] Re: Updating sorted set inside go block

2014-12-25 Thread Thomas Heller
re.async? > > Best Regards, > Sven > > Am Donnerstag, 25. Dezember 2014 11:34:50 UTC+1 schrieb Thomas Heller: > > Hey, > > > > I figured it out. Fun puzzle. ;) > > > > As expected core.async is not the real villain here, the behavior sure is > &

[ClojureScript] The Future of ClojureScript Tools

2014-12-30 Thread Thomas Heller
Hey, First of all, huge thanks to David Nolen for all your work on ClojureScript. TL;DR: I want to help, but I'm sort of "stuck". With all the recent CLJS commits going into tooling related issues (cljs.test, caching, ...) I find a lot of overlap to what I have done in shadow-build. I either f

Re: [ClojureScript] The Future of ClojureScript Tools

2014-12-30 Thread Thomas Heller
On Wednesday, December 31, 2014 12:17:11 AM UTC+1, David Nolen wrote: > > Supporting both Node.js and the Browser has been a goal since the > initial release. There's nothing new going on here except more & > better. What is tooling and what is CLJS? At which point does it make sense to address

[ClojureScript] Re: How to integrate clojurescript macros into the build

2015-01-03 Thread Thomas Heller
Can you run this? lein repl (require 'pts.macros) If not you are probably missing a classpath entry since macros have to be on the classpath for Clojurescript (Clojure) to find them. Your project should have (defproject ... :source-paths ["src/clj"] :cljsbuild {:source-paths ["src/cljs"]})

[ClojureScript] Re: [ANN] CLJSJS

2015-01-06 Thread Thomas Heller
FWIW there is absolutely no need to ship a production/development version of the code. The Closure Compiler is perfectly capable of minifying any JS source (NOT advanced optimize, just minify). Therefore the full JS + externs would be enough. As a build tool author I don't quite agree with usin

Re: [ClojureScript] Re: [ANN] CLJSJS

2015-01-06 Thread Thomas Heller
> > That's right but for some projects the assumption that .min.js means > "minified" is just not true. E.g. React ships with different logging levels > enabled based on wether you're including the development or production build. > I'm sure there are more projects that include extra debugging

[ClojureScript] Re: Using `not` for keywords

2015-01-15 Thread Thomas Heller
On Thursday, January 15, 2015 at 5:08:27 PM UTC+1, Yehonathan Sharvit wrote: > Because in my app , it is clearer from a semantic point of view, it is > clearer as the value stands for a question asked to the user. How about (ns my-ns.util) (def YES true) (def NO false) (ns my-ns (:use my-ns

[ClojureScript] Re: Using `not` for keywords

2015-01-15 Thread Thomas Heller
Boolean is not a protocol. It is a native datatype, just like in Clojure. -- Note that posts from new members are moderated - please be patient with your first post. --- You received this message because you are subscribed to the Google Groups "ClojureScript" group. To unsubscribe from this gr

[ClojureScript] How do you / would you like to "test"?

2015-01-27 Thread Thomas Heller
Hello everyone, I recently started working in adding support for testing in shadow-build. I have my own testing workflow but wanted to ask how everyone else does it? ClojureScript AND Clojure because I'd like them to be as close as possible. My CLJ workflow is opening a REPL and use "Run test u

[ClojureScript] Re: Need help with advanced optimization

2015-01-30 Thread Thomas Heller
1) The main js file is empty because of the closure compiler error. The circular dependency is somewhere in your code, usually :none should detect it as well but difficult to tell without the source. 2) I do not think the cljsbuild config should be in a profile. https://www.refheap.com/96682 T

Re: [ClojureScript] Re: Need help with advanced optimization

2015-01-30 Thread Thomas Heller
countered performing task 'cljsbuild' with profile(s): 'prod' > > java.lang.Exception: All [:compiler :output-dir] options must be distinct. > > > > On Fri, Jan 30, 2015 at 10:21 AM, Thomas Heller wrote: > >> 1) The main js file is empty because of th

[ClojureScript] Re: Path names in :advanced compile

2015-02-03 Thread Thomas Heller
Can you look at the pre-optimized js sources and grep for that string? It might be a macro of a library. Hard to tell without knowing what that thing actually is. It looks like something var-ish (ie. :line, :column, :file, ...). Anyways look at the js files to see the full context, should make

Re: [ClojureScript] Trying out the new :modules support

2015-02-18 Thread Thomas Heller
That is probably dead code removal in action. Since none of your code is actually called it all will be removed. :) Try to ^:export a function that will keep it from getting removed or just call one of the functions. (ns com.foo.editor (:require [com.foo.common :refer (blah)])) (defn ^:exp

Re: [ClojureScript] Trying out the new :modules support

2015-02-19 Thread Thomas Heller
> > Also, about the explicit module dependencies declarations: it seems like it > should be possible to automatically generate these by analyzing the namespace > metadata. Is there a reason to force this to be explicitly declared instead? > The reason the declaration is necessary is quite si

Re: [ClojureScript] Re: ClojureScript Google Closure Module support

2015-02-19 Thread Thomas Heller
> > In ClojureScript any namespace not enumerated in an explicit :entries will > get moved into the base (common/shared) module. But this isn't as bad as it > sounds because Google Closure supports cross module code motion at the > function and method level. That is any code (even a single fun

Re: [ClojureScript] Re: What is the up to date summary of cljs macro definition/usage as of 2850?

2015-02-26 Thread Thomas Heller
If you change it to ;; In src/cljs/fancy/fancy.cljs: (ns fancy.fancy (:require-macros [fancy.fancy :as m]) ;; In src/cljs/fancy/core.cljs: (ns fancy.core (:require [fancy.fancy :as fancy])) (fancy/fun 123) should then always equal the macro version (unless you use apply). The name

Re: [ClojureScript] Re: What is the up to date summary of cljs macro definition/usage as of 2850?

2015-03-02 Thread Thomas Heller
You are going to need to talk to David Nolen about that. He decided that this should be handled in a separate issue than [1]. The implementation in shadow-build [2] (and my original patch) properly support :refer but I currently do not have the time to create a revised issue/patch for CLJS core

[ClojureScript] Re: Detecting ":target :nodejs"

2015-03-10 Thread Thomas Heller
IMHO that is not something you should handle at compile time. I would suggest creating a proper API and a "main" namespace that serves as an entry point to your application and configures it before starting. For example: (ns my-app.log) (defprotocol ILog (-log [this msg])) (def logger (atom

[ClojureScript] Re: dependency ordering without :modules?

2015-03-13 Thread Thomas Heller
You should have a "main" namespace where your app is started and this namespace should "require" all component namespaces you are going to use. (ns project.main (:require [project.components.contacts])) (start-the-app) This way you ensure that all your namespaces are loaded in the proper orde

[ClojureScript] Re: dependency ordering without :modules?

2015-03-13 Thread Thomas Heller
On Friday, March 13, 2015 at 4:10:04 PM UTC+1, Tyler Solomon wrote: > I think perhaps you have already given me the answer, but I do not see it. > I should require all of the component namespaces so they are available when > rendering the root of application. Later when the code is split for produc

[ClojureScript] Re: dependency ordering without :modules?

2015-03-13 Thread Thomas Heller
On Friday, March 13, 2015 at 6:19:29 PM UTC+1, Tyler Solomon wrote: > Thanks, I will have a look at shadow-build. Am I correct to say that the root > of my difficulty is google closure-compiler not supporting modules in any > compilation level below `simple`? > > Potentially relevant link: > http

Re: [ClojureScript] Mac OS X Classpath issue in Getting Started?

2015-03-19 Thread Thomas Heller
> Caused by: java.io.FileNotFoundException: Could not locate > cljs/closure'__init.class or cljs/closure'.clj on classpath: Is it possible you are trying (require 'cljs.closure')? That trailing ' should otherwise not be there. ' means quote in Clojure and is not a String. -- Note that posts f

[ClojureScript] Re: Macros and type hints

2015-03-24 Thread Thomas Heller
> > Question: why exactly is this type hint needed when js/goog.DEBUG is used in > an "if"? As far as I can see, js/goog.DEBUG is a boolean already. > Short answer: We don't evaluate or parse any Javascript when compiling ClojureScript. That means we don't know about goog.DEBUG and what ty

[ClojureScript] Re: Clojurescript Protocol Usage

2015-03-26 Thread Thomas Heller
The general advice is to use Protocols if you need more than one implementation of a function (ie. different targets). If there is only one, use a function. I found myself always starting with a simple function and eventually refactor to a protocol if needed (which is quite rare). It is generall

[ClojureScript] Re: Let bindings not resolved in go block

2015-04-02 Thread Thomas Heller
I think you are using the wrong (async/go ...). Make sure it is (cljs.core.async.macros/go ...) not (clojure.core.async/go ...). On Thursday, April 2, 2015 at 8:14:07 PM UTC+2, Chris Perkins wrote: > I'm having trouble with this macro, and wondering whether I am doing > something wrong: > > (de

[ClojureScript] Re: [ANN] cljs-pikaday, a reagent date picker

2015-04-05 Thread Thomas Heller
Hey Tim, I have no real feedback for you since I don't use Reagent or Om but thought I should mention that it might be better to leverage what the Closure Library has to offer before grabbing external Javascript. The Closure Library comes with a full fledged DatePicker that is fully internatio

[ClojureScript] Re: [ANN] cljs-pikaday, a reagent date picker

2015-04-05 Thread Thomas Heller
tuff, so I'll definitely look into it. > I've also been thinking about using cljs-time in the public interface, and > that uses goog.date.* libraries, so that's another nudge in the Closure > direction. > > Also, thanks for publishing those demos, they are quite hel

[ClojureScript] Re: [ANN] cljs-pikaday, a reagent date picker

2015-04-05 Thread Thomas Heller
On Monday, April 6, 2015 at 12:11:28 AM UTC+2, Shaun Mahood wrote: > Thomas, have you got any good resources for working with Closure in Cljs? > I've tried to figure it out and read a decent amount but have found it > difficult to get the hang of. Apart from the docs I linked not really. The dem

[ClojureScript] Re: Closure locale

2015-04-09 Thread Thomas Heller
Been a while since I used that stuff, so I'm just guessing. Are you on :none? IIRC cljs only supports defines in anything higher than :none. You can however include CLOSURE_DEFINES={'goog.LOCALE':'de'}; in your HTML BEFORE including any other javascript. Pretty sure the locale is only "de" for

[ClojureScript] Re: Using Google Closure-compatible JS files in CLJS project

2015-04-13 Thread Thomas Heller
If you feel like trying a new build setup you could try shadow-build [1,2]. None of this should be an issue with it and :libs is not required, just make sure the .js files are in some listed source path and the rest should just work. Might have a whole lot of other issues though so YMMV. ;) Not

[ClojureScript] Re: cljs compiler options :closure-defines {:goog.DEBUG false}

2015-05-04 Thread Thomas Heller
No idea if this is still current but closure defines only used to work in anything but :optimizations :none. Are you testing in :none? On Tuesday, May 5, 2015 at 12:13:12 AM UTC+2, Jamie Orchard-Hays wrote: > Can't figure out what I'm doing wrong here: > > project.clj: > > {:compiler > :closu

Re: [ClojureScript] cljs compiler options :closure-defines {:goog.DEBUG false}

2015-05-05 Thread Thomas Heller
http://dev.clojure.org/jira/browse/CLJS-1014 makes me think that defines should work in :none, not sure why they don't. If you want to use Closure defines in :none while developing you can put them into your HTML manually before including the javascript (or use shadow-build). For standard CLJS j

[ClojureScript] Re: Compiling multiple apps from single source tree/debugging closure advanced mode

2015-06-08 Thread Thomas Heller
Hey, you could take a look at shadow-build [1]. I wrote it for exactly the use case you describe since I had that issue myself. CLJS itself will always include all source files it can find in a build which leads to your issues. shadow-build will also discover all source files but will only incl

[ClojureScript] Re: Clojurescript async not yeilding for CPU intensive work

2015-08-25 Thread Thomas Heller
This has nothing to do with core.async or the go macro. If you block the CPU you will block the UI. The browser does not support threads so neither can core.async. What the timeout achieves is that you give some control back to the browser so instead of 1sec "blocking" you get 5x200ms blocking.

Re: [ClojureScript] Re: Clojurescript async not yeilding for CPU intensive work

2015-08-25 Thread Thomas Heller
On Tuesday, August 25, 2015 at 10:59:53 AM UTC+2, Daniel Kersten wrote: > "The browser does not support threads so neither can core.async." > > > To expand on that, core.async uses cooperative multitasking, which means you > have to give control back every so often so it can schedule other go bl

Re: [ClojureScript] Re: Clojurescript async not yeilding for CPU intensive work

2015-08-26 Thread Thomas Heller
Well, while we are on the topic perhaps we should mention the downside of using Web Workers. For me it has been Data Transfer. Since you can only transfer JSON type data between workers that usually meant you had to pr-str/read-string to roundtrip CLJS data. If you only have very small amounts

Re: [ClojureScript] Re: Clojurescript async not yeilding for CPU intensive work

2015-08-26 Thread Thomas Heller
On Wednesday, August 26, 2015 at 1:29:38 PM UTC+2, Daniel Kersten wrote: > > If you can use newer browser, you've got Transferrable Object to transfer > binary data with zero-copy. >   True but I was talking about CLJS data which isn't binary. > > Agreed, its probably a bit of work. I guess t

[ClojureScript] Re: Bug in :optimizations :advanced

2015-09-03 Thread Thomas Heller
This is not a bug as David said. To expand a little more about why this happens. String.prototype.startsWith is not part of ES3 or ES5. Only with ES6 will it become standard. The default language level for the closure compiler is ES3 which is why it doesn't know startsWith. You can check the d

Re: [ClojureScript] Extending protocol to an existing JavaScript type

2015-09-07 Thread Thomas Heller
For a little JavaScript WTF and one reason why things are the way the are: Number.prototype.whatAmI = function() { return typeof(this); }; var x = 1; x.whatAmI(); "object" typeof(x) "number" Fun times debugging that ... Cheers, /thomas -- Note that posts from new members are moderated - please

  1   2   3   >