Re: [ClojureScript] A "cljs" command and compiler GUI

2014-09-29 Thread Shaun LeBron
On Monday, September 29, 2014 11:03:16 AM UTC-5, adam...@spottedfoobar.com 
wrote:
> As a complete newbie, i was a lot more interested in ClojureScript before I 
> tried to get it installed and use it on Windows. Is there some reason why I 
> can't have a true command line compiler experience eg 'cljs -i foo.cljs -o 
> foo.js' that i can easily use without buying into a larger 
> compilation/project environment?
> 
> 
> 
> On Monday, September 29, 2014 8:39:22 AM UTC-7, Gary Trakhman wrote:
> 
> > This is much needed. Great work!
> 
> > 
> 
> > 
> 
> > On Mon, Sep 29, 2014 at 11:36 AM, Shaun Williams  
> > wrote:
> 
> > I built some things this weekend to explore the idea of lowering friction 
> > for ClojureScript newcomers:
> 
> > 
> 
> > 
> 
> > 
> 
> > Details here:
> 
> > 
> 
> > https://github.com/shaunlebron/welcome-to-cljs
> 
> > 
> 
> > 
> 
> > 
> 
> > TL;DR
> 
> > 
> 
> > 
> 
> > 
> 
> > - a "cljs" wrapper command (so ClojureScript doesn't feel like a second 
> > class citizen)
> 
> > 
> 
> > - a cljsbuild GUI subtask (for launching a webapp for proper error 
> > formatting and build buttons)
> 
> > 
> 
> > - an immediate blank browser cljs REPL (like running `lein repl` outside a 
> > project)
> 
> > 
> 
> > 
> 
> > 
> 
> > I think small improvements like this can go a long way.  I work with people 
> > who are trying ClojureScript, so I'm trying to address some of their pain 
> > points.
> 
> > 
> 
> > 
> 
> > 
> 
> > --
> 
> > 
> 
> > 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 
> > email to clojurescrip...@googlegroups.com.
> 
> > 
> 
> > To post to this group, send email to clojur...@googlegroups.com.
> 
> > 
> 
> > Visit this group at http://groups.google.com/group/clojurescript.

You can do `cljsc foo.clj > foo.js`.
https://github.com/clojure/clojurescript/wiki/Quick-Start#clojurescript-compiler

-- 
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 email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


[ClojureScript] can't use :refer and :refer-macros together

2014-10-01 Thread Shaun LeBron
The following issue states that using both should be supported:
http://dev.clojure.org/jira/browse/CLJS-721 

But this fails:

(ns foo.core
  (:require
[foo.bar :as bar :refer [hello] :refer-macros [hi]]))

Compiling "foo.js" failed.
clojure.lang.ExceptionInfo: Each of :as and :refer options may only be 
specified once in :require / :require-macros; offending spec: (foo.bar :as bar 
:refer [hello] :
refer [hi]) at line 1

-- 
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 email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


Re: [ClojureScript] can't use :refer and :refer-macros together

2014-10-01 Thread Shaun LeBron
Patch posted: http://dev.clojure.org/jira/browse/CLJS-866

On Wednesday, October 1, 2014 7:14:17 PM UTC-5, David Nolen wrote:
> Please open a ticket. As usual patch welcome :)
> 
> On Wednesday, October 1, 2014, Shaun LeBron  wrote:
> The following issue states that using both should be supported:
> 
> http://dev.clojure.org/jira/browse/CLJS-721
> 
> 
> 
> But this fails:
> 
> 
> 
> (ns foo.core
> 
>   (:require
> 
>     [foo.bar :as bar :refer [hello] :refer-macros [hi]]))
> 
> 
> 
> Compiling "foo.js" failed.
> 
> clojure.lang.ExceptionInfo: Each of :as and :refer options may only be 
> specified once in :require / :require-macros; offending spec: (foo.bar :as 
> bar :refer [hello] :
> 
> refer [hi]) at line 1
> 
> 
> 
> --
> 
> 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 
> email to clojurescript+unsubscr...@googlegroups.com.
> 
> To post to this group, send email to clojurescript@googlegroups.com.
> 
> Visit this group at http://groups.google.com/group/clojurescript.

-- 
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 email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


[ClojureScript] Re: ANN: ClojureScript 0.0-2371

2014-10-10 Thread Shaun LeBron
(:require [secretary.core :as secretary :include-macros true])
; desugars to add=>  (:require-macros [secretary.core :as secretary])

(:require [secretary.core :as secretary :refer-macros [defroute])
; desugars to add=> (:require-macros [secretary.core :as secretary :refer 
[defroute]])

This changed to its original intended behavior so we can use :refer and 
:refer-macros together in the same require spec, without using a redundant 
`:include-macros true` as a separator to distinguish what we're referring.

On Friday, October 10, 2014 8:29:07 AM UTC-5, Julien Eluard wrote:
> Hi David,
> 
> 
> 
> thanks once again for the continuous effort to improve the ClojureScript 
> compiler.
> 
> 
> 
> Some warnings are now printed when using a specific `include-macros` syntax. 
> I wanted to confirm that this syntax was indeed incorrect.
> 
> An example is: [secretary.core :as secretary :include-macros true :refer 
> [defroute]]
> 
> 
> 
> Is the proper way to include macros to rely on the top-level `require-macros` 
> keyword?
> 
> 
> 
> Thanks,
> 
> Julien
> 
> 
> 
> Le vendredi 10 octobre 2014 09:07:31 UTC-3, David Nolen a écrit :
> 
> > ClojureScript, the Clojure compiler that emits JavaScript source code.
> 
> > 
> 
> > 
> 
> > 
> 
> > README and source code: https://github.com/clojure/clojurescript
> 
> > 
> 
> > 
> 
> > 
> 
> > New release version: 0.0-2371
> 
> > 
> 
> > 
> 
> > 
> 
> > Leiningen dependency information:
> 
> > 
> 
> > 
> 
> > 
> 
> > [org.clojure/clojurescript "0.0-2371"]
> 
> > 
> 
> > 
> 
> > 
> 
> > This release includes minor fixes, faster collection iterators, and
> 
> > 
> 
> > stays in sync with the latest transducers changes in Clojure master.
> 
> > 
> 
> > 
> 
> > 
> 
> > ### Fixes
> 
> > 
> 
> > * CLJS-862: fix inconsistent re-pattern
> 
> > 
> 
> > * CLJS-866: Faulty ns macro desugaring
> 
> > 
> 
> > * CLJS-869: When preamble is not found in source directory, compiler
> 
> > 
> 
> > does not report it

-- 
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 email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


[ClojureScript] Re: [ANN] freactive - high performance, pure Clojurescript, declarative DOM library

2014-11-17 Thread Shaun LeBron
On Sunday, November 16, 2014 8:20:29 PM UTC-6, Aaron Craelius wrote:
> freactive (pronounced "f reactive" for functional reactive) is a new high 
> performance, pure Clojurescript, declarative DOM library: 
> https://github.com/aaronc/freactive
> 
> It has a syntax very similar to that of Reagent and was in fact inspired by 
> Reagent, Om, and others.
> 
> I came up with it when I was doing some DOM programming after having spending 
> a fair amount of time working with JavaFX (see my soon to be announced 
> library fx-clj: https://github.com/aaronc/fx-clj). I thought Om and Reagent 
> were very nice to work with (and actually inspired some what I did with 
> fx-clj), but I felt from my desktop GUI experience, that I could take things 
> a few steps further.
> 
> freactive's main advantages over existing solutions are probably built-in 
> animations support and slightly higher performance.
> 
> Here are it's goals from the README:
> Provide a simple, intuitive API that should be almost obvious to those 
> familiar with Clojure (inspiration from reagent)Allow for high-performance 
> rendering good enough for animated graphics based on a purely declarative 
> syntaxAllow for reactive binding of any attribute, style property or child 
> node
> Allow for coordinated management of state via cursors (inspiration from 
> om)Provide deeply-integrated animation supportAllow for cursors based on 
> paths as well as lenses
> Provide a generic items view component for efficient viewing of large data 
> sets
> Minimize unnecessary triggering of update eventsCoordinate all updates via 
> requestAnimationFrame wherever possibleBe easy to debug
> Be written in pure Clojurescript
> Provide support for older browsers via polyfills (not yet implemented)
> Any feedback is welcome!!
> I'm not sure I like the name "freactive" - but it was the best I could think 
> of at the time. Suggestions for alternative names are welcome.

How does it perform its dom-diffing?

-- 
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 email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


[ClojureScript] Re: build fn vs. lein cljsbuild auto , how does lein-cljsbuild achieve such small compilation times?

2014-11-29 Thread Shaun LeBron
Thanks for the question; made me curious to check it out.

The key is to save the compiler environment and to bind it to the dynamic 
variable before building.

Created a repo with short readme:
https://github.com/shaunlebron/how-to-self-build-cljs

On Friday, November 28, 2014 12:53:21 PM UTC-6, Brian Hurlow wrote:
> lein-cljsbuild works really well for most of my cljs projects
> 
>  I've recently found a need to compile cljs directly from a clojure project 
> and I've noticed that calling something like: 
> 
> (use '[cljs.closure :only [build]])
> (build "cljs" {:optimizations :none :output-to "main.js"})
> 
> doesn't get close to the compilation speed of lein-cljsbuild. On my machine, 
> a simple build with no optimizations takes around 2 seconds. The same project 
> compiled with lein cljsbuild auto hovers around 0.02 seconds. 
> 
> I'd like to know: why is lein-cljsbuild so much faster? Is there an easy way 
> to integrate "custom" cljs compilation into my project that has the same 
> efficiency?
> 
> Thanks ya'll, I really truly <3 clojurescript

-- 
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 email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


[ClojureScript] Re: ANN: ClojureScript 0.0-2411

2014-12-07 Thread Shaun LeBron
might need to update the readme with this latest version

On Friday, December 5, 2014 2:03:25 PM UTC-6, David Nolen wrote:
> ClojureScript, the Clojure compiler that emits JavaScript source code.
> 
> README and source code: https://github.com/clojure/clojurescript
> 
> New release version: 0.0-2411
> 
> Leiningen dependency information:
> 
> [org.clojure/clojurescript "0.0-2411"]
> 
> Feedback welcome!
> 
> ### Enhancements
> * forcing source maps to load for dynamic js reloads
> * All ISeqable types are now ES6 iterable
> * CLJS-863: Invalid arity error when calling 0-arity multimethod
> * CLJS-622: better error reporting for zero arity protocol methods
> * CLJS-506: expose more Closure minification knobs
> 
> ### Changes
> * CLJS-807: Emitter cannot emit BigInt or BigDecimal
> * CLJS-749: Ignore .repl-* given that CLJS version is appended by default.
> * CLJS-749: Append CLJS version to browser repl-env
> * CLJS-749: *clojurescript-version* is unbound return empty string
> * implement INamed for multi-method
> * revert CLJS-801
> * CLJS-888: Omit redundant {} around emitted recur
> * CLJS-888: Better placement of newlines in emitter
> * Join preambles with newline line to catch cases with files without newlines.
> * add js-in interop macro
> * Add nthrest
> * CLJS-510: Throw error when :output-wrapper and :optimizations
> :whitespace combined
> * CLJS-875: bump tools.reader dep to 0.8.10
> * CLJS-879: add `update` from Clojure 1.7
> * CLJS-857: change deftype*/defrecord* special forms to include their
> inline methods decls
> 
> ### Fixes
> * CLJS-885: relax type inference around numbers
> * fix var resolution bug pointed out by Brandon Bloom
> * CLJS-853: propagate read-time metadata on fn and reify forms at runtime
> * CLJS-716: support hashing of JavaScript dates
> * CLJS-814: clojure.string/reverse breaks surrogate pairs
> * Recursively check IEncodeClojure in js->clj
> * CLJS-873: non-higher-order calls to array-map should return PAMs
> * CLJS-881: check for duplicate keys in array-map
> * select-keys did not preserve metadata

-- 
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 email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


[ClojureScript] Re: ANN: ClojureScript 0.0-2496, cljs.test - a clojure.test port

2014-12-17 Thread Shaun LeBron
really exciting stuff, thanks a lot

On Wednesday, December 17, 2014 3:54:09 PM UTC-6, David Nolen wrote:
> ClojureScript, the Clojure compiler that emits JavaScript source code.
> 
> README and source code: https://github.com/clojure/clojurescript
> 
> New release version: 0.0-2496
> 
> Leiningen dependency information:
> 
> [org.clojure/clojurescript "0.0-2496"]
> 
> The big change in this release is a port of the clojure.test namespace
> - cljs.test.
> It is largely compatible with clojure.test and implements enough
> functionality such
> that we could port all of the existing tests to it. It's also featureful 
> enough
> to support a ClojureScript port of test.check that is underway.
> cljs.test is compatible
> with all of the optimization settings provided by the compiler including 
> :none.
> 
> Still cljs.test may not satisfy all the patterns that people have come to 
> expect
> from clojure.test so feedback (and enhancement/fix patches) is very welcome.
> 
> On the way we implemented changes to the compiler in order to make
> custom testing
> frameworks simpler to implement - this includes compiler support for
> :test metadata as well
> as introducing static vars.
> 
> ClojureScript does not have vars, however there are var patterns that
> are largely
> static in nature and useful for metaprogramming and REPL interactions. Towards
> this end we've implemented the `var` special form and introduced very 
> restricted
> functionality - metadata is the primary use case.
> 
> (defn foo [])
> (meta #'foo) ;; will return the expected metadata
> 
> cljs.test is implemented on top of this functionality as well as a new 
> namespace
> cljs.analyzer.api which I think macro writers will find quite useful.
> 
> Also there's a doc macro now in the cljs.repl namespace that works as 
> expected.
> Patches welcome to bring all the useful bits of clojure.repl into cljs.repl.
> 
> ## 0.0-2496
> 
> ### Enhancements
> * cljs.test added, mirrors clojure.test
> * New cljs.analyzer.api namespace for easier access to analysis info from 
> macros
> * New cljs.analyzer.api namespace for easier access to analysis info from 
> macros
> * Support :test metadata on vars
> * Support static vars
> * cljs.source-map for client side source mapping
> * expose ClojureScript :warnings build option
> * CLJS-909: Add stable api for consumers of compiler data.
> 
> ### Changes
> * convert all ClojureScript tests to cljs.test
> * add volatile! from Clojure 1.7
> * stateful transducers use volatile!
> * added `js-debugger` macro, compiles to "debugger;"
> * CLJS-892: Improve performance of compare-symbols/compare-keywords
> * CLJS-696: remove arguments usage from defrecord constructor
> * unroll `partial`, copy & pasted from Clojure core.clj
> * optimize clojure.string/join
> 
> ### Fixes
> * fix `cljs.nodejs/enable-util-print!`, incorrectly monkey patched
> `cjls.core/string-print` instead of setting `cljs.core/*print-fn*`
> * cljs.reader bug, '/ incorrectly read
> * avoid emitting the same goog.require

-- 
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 email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


[ClojureScript] Re: Getting started with cljs.test

2014-12-20 Thread Shaun LeBron
Neat, I really like the use of the `:notify-command` to run the tests after 
every recompile.  Attached screenshot.  Thanks for the solution.

On Friday, December 19, 2014 5:31:16 AM UTC-6, Andrew Keedle wrote:
> Simple post and sample project about getting started with cljs.test (using 
> phantomjs).
> 
> http://keeds.github.io/clojurescript/2014/12/19/cljs-test.html

-- 
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 email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


[ClojureScript] ANN: ClojureScript API docfiles

2014-12-23 Thread Shaun LeBron
This is an auto-generated and versioned catalog of ClojureScript's core library 
functions, macros, and special forms (and their metadata). It is intended for 
tools and people to consume for quick reference to any ClojureScript release.  
(Built for upcoming cljs.info website)

https://github.com/shaunlebron/cljs-api-docs

Let me know if you have suggestions on parsing special-form docs and if you 
have any opinions on what should or shouldn't be parsed.  The line between 
library and compiler code seems blurry to me.

Thanks.

-- 
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 email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


Re: [ClojureScript] Spurious arithmetic warnings with ClojureScript 0.0-2411?

2014-12-30 Thread Shaun LeBron
Seems to be the simplest case for this warning (run against master branch):

(when-let [x nil]
  (+ x 100))

WARNING: cljs.core/+, all arguments must be numbers, got [clj-nil number] 
instead. at line 4 src/example/core.cljs

On Tuesday, December 30, 2014 3:22:04 AM UTC-6, Andrew Mcveigh wrote:
> I'm also seeing this in cljs-time in both "0.0-2411" and "0.0-2511". The call 
> to cljs.core// can never be reached with a nil 'millis, but the compiler 
> still gives the warning.
> 
> WARNING: cljs.core//, all arguments must be numbers, got [#{nil clj-nil} 
> number] instead. at line 51 src/cljs_time/coerce.cljs
> 
> (defn to-epoch
>   "Convert `obj` to Unix epoch."
>   [obj]
>   (let [millis (to-long obj)]
> (and millis (/ millis 1000
> 
> OR
> 
> (defn to-epoch
>   "Convert `obj` to Unix epoch."
>   [obj]
>   (when-let [millis (to-long obj)]
> (/ millis 1000)))

-- 
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 email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


[ClojureScript] Re: The Essence of ClojureScript Redux

2015-01-04 Thread Shaun LeBron
Really exciting seeing the node repl becoming easier to use.  (nice 
mies-generated readme too)

I can see this being supported by cljsbuild as a default repl task, and the 
cljsbuild alias in the readme being used for "cljsbuild repl" without the need 
for the repl scripts in the project directory.

To continue Brandon's idea, since we're relying on a `cljsbuild` alias in the 
user's bash profile, a global `cljs` script released on brew/apt could fulfill 
this role and more.  It could have straightforward behavior in an individually 
configured project, or run some default configuration outside one perhaps.

-- 
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 email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


[ClojureScript] [ANN] hammock - an Om cursor-like tree transformer

2015-01-07 Thread Shaun LeBron
hammock

https://github.com/shaunlebron/hammock

In UIs, it is common to transform JSON data received from a backend REST 
service into data better suited for representation on screen. After this 
transformation is made, it is useful to remember which original fields are 
associated with the new ones.

This is an experiment to capture that relationship during transformation using 
something called "hammocks" which are like Om cursors, but are tied to two 
separate trees.

-- 
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 email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


[ClojureScript] Re: question about om patterns

2015-01-20 Thread Shaun LeBron
If I have a form that is editing an active object, I have a "edit-object" field 
that contains the value of the object, not just the ID.  This gives me a 
staging area to hold the edited object, which I can write back to the original 
object if the form is saved.

If you want the form to allow users to immediately update the object without a 
staging area, I would use an "active-id" field, and then have a parent 
component resolve the appropriate object cursor to pass to the form component.

On Monday, January 19, 2015 at 8:12:16 PM UTC-6, Ivan Willig wrote:
> Hello, 
> 
> 
> 
> I am struggling with how to best represent the common UI pattern where there 
> is a collection of objects and a single "active/current" object. Often there 
> is a form where the user can edit the "active" object.
> 
> 
> I find myself saving a reference to the current id and then looking up that 
> object from the collection. This seemed to be the direction that David was 
> going with in the immutable-stack, 
> https://github.com/KitchenTableCoders/immutable-stack/blob/master/contacts/src/cljs/contacts/core.cljs#L24-L27,
>  but I wanted to ask if there was an undated version. 
> 
> 
> Do other people have other solutions? 
> 
> 
> Thanks
> 
> 
> 
> 
> 
> Ivan Willig

-- 
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 email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


[ClojureScript] Re: ANN: ClojureScript 0.0-2913, Google Closure Modules, improved nREPL support

2015-02-23 Thread Shaun LeBron
I was trying out the Closure Module support.  Looks like we need to wait for 
cljsbuild to support this.
On Saturday, February 21, 2015 at 3:16:11 PM UTC-6, Boris Kourtoukov wrote:
> On Saturday, February 21, 2015 at 1:01:39 PM UTC-5, David Nolen wrote:
> > ClojureScript, the Clojure compiler that emits JavaScript source code.
> > 
> > 
> > README and source code: https://github.com/clojure/clojurescript
> > 
> > 
> > New release version: 0.0-2913
> > 
> > 
> > Leiningen dependency information:
> > 
> > 
> >     [org.clojure/clojurescript "0.0-2913"]
> > 
> > 
> > This release comes with two very big enhancements.
> > 
> > 
> > The first is support for Google Closure Modules via the :modules build
> > option. Google Closure Modules permits splitting advanced compiled
> > builds into optimal smaller pieces for faster page
> > loads. ClojureScript's Google Closure Module support is fully
> > :foreign-libs aware. Source mapping for modules is also fully
> > supported.
> > 
> > 
> > The feature is described in more detail here:
> > https://github.com/clojure/clojurescript/wiki/Compiler-Options#modules
> > 
> > 
> > The second big change is a fundamental rearchitecting of ClojureScript
> > REPLs. ClojureScript REPLs now support a set of options similar to
> > those taken by `clojure.main/repl` with small changes to account for
> > different JavaScript evaluation environments. Many third party REPLs
> > like Figwheel, Weasel, and Ambly are either unaffected or have already
> > accounted for these changes. However current tooling leveraging
> > Piggieback will likely present an inferior experience as Piggieback was
> > designed to work around the previous limitations of ClojureScript
> > REPLs. Now that ClojureScript REPLs are more like the standard Clojure
> > REPL it should be far simpler to add proper interruptible-eval and
> > load-file nREPL middleware so that existing tooling around nREPL can
> > more easily integrate ClojureScript REPLs as first class citizens.
> > 
> > 
> > Feedback on both of these enhancements is very welcome!
> > 
> > 
> > 
> > There are also many smaller fixes around REPL command line behavior,
> > the Nashorn REPL, :foreign-libs resource finding issues, the full
> > list follows:
> > 
> > 
> > ## 0.0-2913
> > * Support custom :output-to for :cljs-base module
> > 
> > 
> > ## 0.0-2911
> > 
> > 
> > ### Enhancements
> > * CLJS-1042: Google Closure Modules :source-map support
> > * CLJS-1041: Google Closure Modules :foreign-libs support
> > * Google Closure Modules support via :modules
> > * CLJS-1040: Source-mapped script stack frames for the Nashorn repl
> > 
> > 
> > ### Changes
> > * CLJS-960: On carriage return REPLs should always show new REPL prompt
> > * CLJS-941: Warn when a symbol is defined multiple times in a file
> > * REPLs now support parameterization a la clojure.main/repl
> > * all REPLs analyze cljs.core before entering loop
> > * can emit :closure-source-map option for preserving JS->JS map
> > * REPLs can now merge new REPL/compiler options via -setup
> > 
> > 
> > ### Fixes
> > * CLJS-998: Nashorn REPL does not support require special fn
> > * CLJS-1052: Cannot require ns from within the ns at the REPL for reloading 
> > purposes
> > * CLJS-975: preserve :reload & :reload-all in ns macro sugar
> > * CLJS-1039: Under Emacs source directory watching triggers spurious 
> > recompilation
> > * CLJS-1046: static vars do not respect user compile time metadata
> > * CLJS-989: ClojureScript REPL loops on EOF signal
> > * fix DCE regression for trivial programs
> > * CLJS-1036: use getResources not findResources in get-upstream-deps*
> 
> Closure Module support is an amazing  addition, thank you for implementing 
> it. It is something that has always been nagging at me when building multi 
> page/multi ui applications with CLJS.

-- 
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 email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


Re: [ClojureScript] Re: ANN: ClojureScript 0.0-2913, Google Closure Modules, improved nREPL support

2015-02-24 Thread Shaun LeBron
I uploaded a project that I failed to get working with :modules.  I know I'm 
missing something; just not seeing it yet:
https://github.com/shaunlebron/cljs-multi-module

On Monday, February 23, 2015 at 2:40:31 PM UTC-6, David Nolen wrote:
> Closure Module support was developed by testing alongside with cljsbuild. 
> There's nothing to wait for.
> 
> 
> Is there some issue that you encountered?
> 
> 
> 
> 
> David
> 
> 
> On Mon, Feb 23, 2015 at 3:35 PM, Shaun LeBron  wrote:
> I was trying out the Closure Module support.  Looks like we need to wait for 
> cljsbuild to support this.
> 
> 
> 
> On Saturday, February 21, 2015 at 3:16:11 PM UTC-6, Boris Kourtoukov wrote:
> 
> > On Saturday, February 21, 2015 at 1:01:39 PM UTC-5, David Nolen wrote:
> 
> > > ClojureScript, the Clojure compiler that emits JavaScript source code.
> 
> > >
> 
> > >
> 
> > > README and source code: https://github.com/clojure/clojurescript
> 
> > >
> 
> > >
> 
> > > New release version: 0.0-2913
> 
> > >
> 
> > >
> 
> > > Leiningen dependency information:
> 
> > >
> 
> > >
> 
> > >     [org.clojure/clojurescript "0.0-2913"]
> 
> > >
> 
> > >
> 
> > > This release comes with two very big enhancements.
> 
> > >
> 
> > >
> 
> > > The first is support for Google Closure Modules via the :modules build
> 
> > > option. Google Closure Modules permits splitting advanced compiled
> 
> > > builds into optimal smaller pieces for faster page
> 
> > > loads. ClojureScript's Google Closure Module support is fully
> 
> > > :foreign-libs aware. Source mapping for modules is also fully
> 
> > > supported.
> 
> > >
> 
> > >
> 
> > > The feature is described in more detail here:
> 
> > > https://github.com/clojure/clojurescript/wiki/Compiler-Options#modules
> 
> > >
> 
> > >
> 
> > > The second big change is a fundamental rearchitecting of ClojureScript
> 
> > > REPLs. ClojureScript REPLs now support a set of options similar to
> 
> > > those taken by `clojure.main/repl` with small changes to account for
> 
> > > different JavaScript evaluation environments. Many third party REPLs
> 
> > > like Figwheel, Weasel, and Ambly are either unaffected or have already
> 
> > > accounted for these changes. However current tooling leveraging
> 
> > > Piggieback will likely present an inferior experience as Piggieback was
> 
> > > designed to work around the previous limitations of ClojureScript
> 
> > > REPLs. Now that ClojureScript REPLs are more like the standard Clojure
> 
> > > REPL it should be far simpler to add proper interruptible-eval and
> 
> > > load-file nREPL middleware so that existing tooling around nREPL can
> 
> > > more easily integrate ClojureScript REPLs as first class citizens.
> 
> > >
> 
> > >
> 
> > > Feedback on both of these enhancements is very welcome!
> 
> > >
> 
> > >
> 
> > >
> 
> > > There are also many smaller fixes around REPL command line behavior,
> 
> > > the Nashorn REPL, :foreign-libs resource finding issues, the full
> 
> > > list follows:
> 
> > >
> 
> > >
> 
> > > ## 0.0-2913
> 
> > > * Support custom :output-to for :cljs-base module
> 
> > >
> 
> > >
> 
> > > ## 0.0-2911
> 
> > >
> 
> > >
> 
> > > ### Enhancements
> 
> > > * CLJS-1042: Google Closure Modules :source-map support
> 
> > > * CLJS-1041: Google Closure Modules :foreign-libs support
> 
> > > * Google Closure Modules support via :modules
> 
> > > * CLJS-1040: Source-mapped script stack frames for the Nashorn repl
> 
> > >
> 
> > >
> 
> > > ### Changes
> 
> > > * CLJS-960: On carriage return REPLs should always show new REPL prompt
> 
> > > * CLJS-941: Warn when a symbol is defined multiple times in a file
> 
> > > * REPLs now support parameterization a la clojure.main/repl
> 
> > > * all REPLs analyze cljs.core before entering loop
> 
> > > * can emit :closure-source-map option for preserving JS->JS map
> 
> > > * REPLs can now merge new REPL/compiler options via -setup
> 
> > >
> 
> > >
> 
> > > ### Fixes
> 
> > > * CLJS-998: Nashorn REPL does not

[ClojureScript] Re: A real clojurescript dedicated website

2015-05-01 Thread Shaun LeBron
We are working on a website here:
https://github.com/cljsinfo

we're mainly working on docs right now:
http://cljsinfo.github.io/api-docs-report/



On Thursday, April 30, 2015 at 11:26:59 AM UTC-5, Benjamin Dreux wrote:
> Hi,
> 
> I'm pretty new to Clojurescript. 
> And i feel a little bit weird the way to get information on the projet, 
> environment, etc
> 
> I think staring would be easier if there was a reference point.
> 
> I' aware that there is pretty much every thing I need could be found in this 
> wiki (https://github.com/clojure/clojurescript/wiki). But i'm looking for 
> something prettier, more graphical.
> 
> Does this conversation already happened?
> Is this on purpose, to not replicate the clojure.org website?
> Am I the only one having this idea?

-- 
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 email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


Re: [ClojureScript] A real clojurescript dedicated website

2015-05-01 Thread Shaun LeBron
I can't speak to the analogy with Common Lisp.  I talked to a few people at 
Clojure/west who shared the same concerns about fragmenting resources for 
Clojure & ClojureScript.

I just think the present reality is that ClojureScript has enough differences 
from Clojure to make their conflation a confusing enough affair for prospective 
JS/front-enders.  And I think having that first-class website experience for 
CLJS is going to be valuable when compared to the standard set by other 
compile-to-JS languages like TypeScript and Dart, which have excellent websites.


On Friday, May 1, 2015 at 2:51:27 PM UTC-5, Gary Schiltz wrote:
> On Thursday, April 30, 2015 at 11:45:03 AM UTC-5, David Nolen wrote:
> > No plans at the moment for an official ClojureScript site. There are some 
> > community led efforts underway which we whole-heartedly encourage!
> > 
> > 
> > David
> > 
> > 
> > On Thu, Apr 30, 2015 at 12:10 PM, Benjamin Dreux  wrote:
> > Hi,
> > 
> > 
> > 
> > I'm pretty new to Clojurescript.
> > 
> > And i feel a little bit weird the way to get information on the projet, 
> > environment, etc
> > 
> > 
> > 
> > I think staring would be easier if there was a reference point.
> > 
> > 
> > 
> > I' aware that there is pretty much every thing I need could be found in 
> > this wiki (https://github.com/clojure/clojurescript/wiki). But i'm looking 
> > for something prettier, more graphical.
> > 
> > 
> > 
> > Does this conversation already happened?
> > 
> > Is this on purpose, to not replicate the clojure.org website?
> > 
> > Am I the only one having this idea?
> > 
> > 
> > 
> > --
> > 
> > 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 
> > email to clojurescrip...@googlegroups.com.
> > 
> > To post to this group, send email to clojur...@googlegroups.com.
> > 
> > Visit this group at http://groups.google.com/group/clojurescript.
> 
> Separate sites for Clojure and ClojureScript seems strange to me. I was 
> thinking that in time, the two languages would start getting more alike 
> rather than diverging. The more divergence, the more opportunity there is for 
> territoriality for the "Clojure" name. I'd sure hate to see anything like 
> what one sees on the Common Lisp newsgroup crrep into the Clojure landscape...

-- 
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 email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


Re: [ClojureScript] Re: A real clojurescript dedicated website

2015-05-06 Thread Shaun LeBron
The report was moved to: http://cljsinfo.github.io/api-docs/

You can get an example ID here: 
http://cljsinfo.github.io/api-docs/example-template.html


On Wednesday, May 6, 2015 at 8:20:58 AM UTC-5, Benjamin Dreux wrote:
> The way i do, is that i let the CI server propose me an id.
> Which happen when you make a PR to the projet.
> 
> @Nolan the link you gave is a 404 right now, Can you make a new one please.
> 
> Le mercredi 6 mai 2015 08:28:23 UTC-4, Nolan Prescott a écrit :
> > On 5/3/2015 10:07 PM, J David Eisenberg wrote:
> > > [snip]
> > >
> > > One other question: if I manually add an example, how can I generate an 
> > > identifier of the form Example#6a87de that is guaranteed to be different 
> > > from all the other example numbers?
> > >
> > The chances of hitting on the same combination is something like 1 in
> > 2,176,782,336 (36^6). The hashes are generated by stripping a UUID4 down
> > to 6 characters, which you can see here:
> > https://github.com/cljsinfo/api-docs-report/blob/4eeca74caf7306bbe921d630380b2dac6bd97abd/resources/report/example-template.html
> > , so while a collision is possible the chances are very low.

-- 
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 email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


[ClojureScript] Explore the ClojureScript API

2015-05-25 Thread Shaun LeBron
I designed an API reference for ClojureScript.  You can see the available 
symbols, how they relate to Clojure*, and track version history:
https://github.com/cljsinfo/api-refs/tree/catalog

* thanks to Josh Headapohl for pushing me to show related/unported clojure 
symbols

-- 
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 email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


[ClojureScript] Re: ANN: ClojureScript 1.7.28 - Optional Self Hosting

2015-07-31 Thread Shaun LeBron
On Friday, July 31, 2015 at 12:52:23 PM UTC-5, David Nolen wrote:
> ClojureScript, the Clojure compiler that emits JavaScript source code.
> 
> 
> README and source code: https://github.com/clojure/clojurescript
> 
> 
> Leiningen dependency information:
> 
> 
>     [org.clojure/clojurescript "1.7.28"]
> 
> 
> ClojureScript now has a proper version number. This version number is
> designed to reflect feature parity with Clojure.
> 
> 
> The primary new feature of this release is optional
> self hosting. ClojureScript can now run either on the JVM or directly on
> JavaScript. Please refer to the docstrings in the new cljs.js
> namespace for details on this functionality. cljs.js is designed to
> enable new use cases (iOS, Android, interactive tutorials, snippet
> sharing) not well served by the default compilation model.
> 
> 
> The release also includes numerous bug fixes and enhancements.
> 
> 
> This release also bumps the Clojure dependency to 1.7.0 and
> tools.reader to 0.10.0-alpha3.
> 
> 
> As always feedback welcome!
> 
> 
> ## 1.7.28
> 
> 
> ## Enhancements
> * New namespace cljs.js provides analysis, compilation, and eval
> * CLJS-1360: Refactor JS module processing to work with recent Google Closure 
> compiler changes
> * CLJS-1282: Add a :pprint option to the default reporter in cljs.test
> * CLJS-1308: :analyze-path should be extended to take a vector of paths
> * CLJS-1230: ES 2015 Module Processing
> * CLJS-1231: AMD Module Processing
> * CLJS-1092: CommonJS Module processing
> 
> 
> ## Changes
> * CLJS-1376: Printing in a tagged literal data form
> * CLJS-836: Replace seq-based iterators with direct iterator for all non-seq 
> collections that use SeqIterator
> * CLJS-1367: Expose default-warning-handler and warning-enabled?
> * CLJS-1267: Added the :end-test-all-vars and :end-test-vars events to have 
> end events for all cljs.test api functions
> * CLJS-1337: Move parse ns side-effects into a separate compiler pass
> * CLJS-1247: Split out error printing from regular printing
> * CLJS-1329: Support for reading #js tagged literals in bootstrap
> * CLJS-1191: rebased patch Update clojure.walk to the current version on 
> clojure
> * CLJS-1321: remove getNamespace & getName method calls from defrecord
> * CLJS-1281: Preserve test order
> * CLJS-934: In the REPL return vars after defs
> 
> 
> ## Fixes
> * CLJS-1316 let does not detect invalid binding vector when it contains 
> destructuring
> * CLJS-1033: take a drop accept nil as n argument
> * CLJS-1324: Compiler fails to raise warning/error when invoking a keyword 
> without arguments
> * CLJS-1352: cljs.js: Allow conditional readers
> * CLJS-1348: meta is printing for def at REPL
> * CLJS-1342: cljs.reader/read-string should throw Error when not called with 
> string
> * CLJS-1341: Fix CommonJS conversion bug
> * CLJS-1333: Analyze meta on quoted symbols
> * CLJS-1210: Javascript built-in arguments replaces nil arguments locally 
> defined by let
> * CLJS-1248: alter-meta! does not work on vars
> * CLJS-1276: var equality differs from Clojure
> * CLJS-1310: ns libspec error message misses :import
> * CLJS-428: Added step to escape docstrings with */ and associated test
> * CLJS-1331: Regex literal emits invalid JS
> * CLJS-1338: NPE in confirm-var-exists if suffix is ".."
> * CLJS-1319: Cannot locate module namespace when filename contains dash
> * CLJS-1317: Incremental compilation issues for :nodejs target
> * CLJS-1227 Raise error when if form has more than 4 statements
> * CLJS-1306: Browser REPL :asset-path with leading slash breaks source map 
> support
> * CLJS-1290: :refer does not work with Closure JS namespaces
> * CLJS-1307: Doc for ns missing
> * CLJS-1301: local :foreign-libs are not picked up the first time browser 
> REPL is started

1.7.28 API docs updated: 
https://github.com/cljsinfo/cljs-api-docs/blob/1.7.28/INDEX.md

-- 
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 email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


Re: [ClojureScript] Pure JS ClojureScript build system?

2015-08-03 Thread Shaun LeBron
i think the wiki link does a great job of explaining the challenges of creating 
a js-based dev environment. But i wouldnt discourage anyone from building it. 
An npm starter kit might be a great outreach project, meeting the JS devs on 
their turf with a quick env to try out before using the full JVM env.

-- 
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 email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


[ClojureScript] Re: aget of nil

2015-08-05 Thread Shaun LeBron
`get` provides safe deep property access by handing nil appropriately, but 
`aget` has never done this to my knowledge.  It just emits straight JS bracket 
notation:

`(aget a 4 1 2)` => `(cljs.user.a[(4)][(1)][(2)])`

So `aget` cannot be safely used this way for arrays or objects.

On Wednesday, August 5, 2015 at 4:41:37 AM UTC-5, Peter Taoussanis wrote:
> Hi folks,
> 
> Running ClojureScript 1.7.28 - just ran into some unexpected behaviour:
> 
> (aget nil "foo") throws an error; was expecting it to return nil.
> 
> This also leads to (aget obj "foo" "bar") throwing when obj doesn't have a 
> "foo" property. Was expecting that to return nil too.
> 
> Is this behaviour intentional?
> 
> Thanks!

-- 
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 email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


[ClojureScript] Re: aget of nil

2015-08-05 Thread Shaun LeBron
goog.object/getValueByKeys supports safe deep property access, unless the input 
value is just nil

On Wednesday, August 5, 2015 at 4:41:37 AM UTC-5, Peter Taoussanis wrote:
> Hi folks,
> 
> Running ClojureScript 1.7.28 - just ran into some unexpected behaviour:
> 
> (aget nil "foo") throws an error; was expecting it to return nil.
> 
> This also leads to (aget obj "foo" "bar") throwing when obj doesn't have a 
> "foo" property. Was expecting that to return nil too.
> 
> Is this behaviour intentional?
> 
> Thanks!

-- 
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 email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


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

2015-09-04 Thread Shaun LeBron
The "function", "object", "array" symbols are just symbols that have meaning in 
the context of the `extend-type` macro, so nothing special syntactically.  They 
just map internally to the type strings produced by `goog/typeOf`, used for 
protocol dispatch.

Just added some documentation to the `extend-type` doc:
https://github.com/cljsinfo/cljs-api-docs/blob/catalog/refs/cljs.core_extend-type.md

On Thursday, September 3, 2015 at 3:17:21 PM UTC-5, Scott Nelson wrote:
> Thanks- that worked perfectly.  I did not need to extend IFn and I actually 
> got a runtime error when I tried (perhaps because IFn is a protocol in 
> ClojureScript?).  What are "function"/"object"/ect. in this case, 
> syntactically?  Is there any documentation about this?
> 
> Thanks again!
> 
> -Scott

-- 
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 email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


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

2015-09-06 Thread Shaun LeBron
I just looked at the implementation, and it's not done 'from the outside' for 
cljs types.  `extend-type` adds protocol methods to the type object's 
prototype.  Only exception is for JS base types (e.g. "function", "number", 
"array").  You can see the effects in this gist:
https://gist.github.com/shaunlebron/a98a05b47a1521b58a6b

Not sure why though



On Sunday, September 6, 2015 at 7:01:02 AM UTC-5, Yehonathan Sharvit wrote:
> On Friday, 4 September 2015 20:42:46 UTC+3, Scott Nelson  wrote:
> > OK, thanks.  Great documentation by the way.  Definitely going to refer to 
> > this from now on.
> 
> Francis,
> 
> Do you have an ide yhy the implementation of `extend-type` for:
> 1.  js types modifies the js type itself 
> 2. while for cljs types it modifies the protocol (from the outside)?

-- 
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 email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


Re: [ClojureScript] self-hosted defmacro

2015-09-15 Thread Shaun LeBron
I read through all your posts on macros, Mike, thanks a lot.

Wrote some documentation on `defmacro` to elucidate these points 
(feedback/edits welcome):
https://github.com/cljsinfo/cljs-api-docs/blob/catalog/refs/cljs.core/defmacro.md

(hope to see more questions like this on the mailing list.  really helps drive 
the docs.)

On Sunday, September 13, 2015 at 3:32:45 PM UTC-5, Mike Fikes wrote:
> Self-hosted ClojureScript supports defmacro in the same way that regular 
> ClojureScript supports defmacro. In particular, macros must be defined 
> separately from runtime code. And, perforce, macros must be written in 
> ClojureScript (or, alternatively, they can be in a .clj file, so long as the 
> Clojure in that file happens to also be ClojureScript.)
> 
> 
> See this for more exposition on this:  
> http://blog.fikesfarm.com/posts/2015-06-19-portable-macro-musing.html
> 
> 
> Also, if you’d like to just mess around with macros within a self-hosted 
> ClojureScript REPL, it _is_ possible to do if you play games with the way 
> things work under the hood. This is covered in more detail here: 
> http://blog.fikesfarm.com/posts/2015-09-07-messing-with-macros-at-the-repl.html
> 
> 
> For your example below this ends up looking like:
> 
> 
> 
> cljs.user=> (ns foo.core$macros)
> nil
> foo.core$macros=> (defmacro m [x] `(- ~x))
> true
> foo.core$macros=> (foo.core/m 1)
> -1
> 
> 
> 
> - Mike
> 
> 
> 
> On Sep 13, 2015, at 10:43 AM, ZhX Chen  wrote:
> 
> In clojure:
> 
> => (defmacro m [x] `(- ~x))
> => (m 1)
> => -1
> 
> While in self-hosted clojurescript:
> 
> => (defmacro m [x] `(- ~x))
> => (m 1)
> => (- nil)
> 
> So this means self hosted clojurescript does not fully support the defmacro 
> yet?
> 
> -- 
> 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 
> email to clojurescrip...@googlegroups.com.
> To post to this group, send email to clojur...@googlegroups.com.
> Visit this group at http://groups.google.com/group/clojurescript.

-- 
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 email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


Re: [ClojureScript] es7 vs core.async

2015-09-15 Thread Shaun LeBron
ES7 vs core.async (gist):
https://gist.github.com/shaunlebron/d231431b4d6a82d83628

On Tuesday, September 15, 2015 at 3:51:06 PM UTC-5, marc fawzi wrote:
> Well the title gives that impression and I regret having chose to do that :) 
> 
> But if you read the content i am asking the question if Async functions in 
> es7 can be used to build a performant and faithful version of CSP (github: 
> aysnc-csp) and also be useful for common tasks like the simple server request 
> scenario I mentioned then why wouldnt we want to think of CSP as just one 
> pattern not the One True Pattern for async. Right now core.async is being 
> used and or recommended for everything async and I am asking if that is ideal 
> and if CLJS can allow itself to grow beyond this one particular pattern when 
> it comes to async. The first thing would be renaming core.async to core.csp 
> and promoting choice when it comes to async patterns. As it is right now, 
> every time someone has an async design problem core.async is recommended as a 
> solution regardless of whether or not it's the best fit solution. If you have 
> a hammer...
> 
> That's the scope. Not es7 vs core.async and I'm sorry for the stupid title.
> 
> Sent from my iPhone
> 
> > On Sep 15, 2015, at 8:32 AM, Johann Bestowrous 
> >  wrote:
> > 
> > At a high level, I think it's pretty important to note that you are 
> > comparing a language spec to a library.
> > 
> > -- 
> > 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 
> > email to clojurescript+unsubscr...@googlegroups.com.
> > To post to this group, send email to clojurescript@googlegroups.com.
> > Visit this group at http://groups.google.com/group/clojurescript.

-- 
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 email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


Re: [ClojureScript] es7 vs core.async

2015-09-17 Thread Shaun LeBron
 exposed low 
> level semantics. Maybe a bunch of core.async macros that expose common use 
> cases in a way that anyone can understand without even having to understand 
> CSP basics. In my team, everyone gets the es7 version of things but despite 
> having been CLJS users for 6 months now, no one understands how to use 
> core.async. I've had to play with it in different languages before I realized 
> how powerful it is to have in your toolset to manage complex (potentially 
> dynamic) coordination patterns between async processes but our use cases in 
> the UI have yet to beyond the very simple use cases your gist shows which are 
> (without use of macros) much easier to understand using es7 async 
> functions.If macros can solve the "comprehensibility" problem for the common 
> use cases then maybe something that would provide es7 async like library for 
> cljs that gives you defnasync and await Syntax and semantics can then be so 
> simple while the underlying system remains so powerful and in that case you 
> could have core.async be bundled with those macros thus allowing easy access 
> to common async patterns without the Go syntax obfuscating things and making 
> it seem complicated as well as too noisy syntax wise for the most common 
> tasks 
> 
> Sent from my iPhone
> 
> 
> 
> On Sep 15, 2015, at 9:38 PM, Shaun LeBron  wrote:
> 
> 
> ES7 vs core.async (gist):
> https://gist.github.com/shaunlebron/d231431b4d6a82d83628
> 
> On Tuesday, September 15, 2015 at 3:51:06 PM UTC-5, marc fawzi wrote:
> Well the title gives that impression and I regret having chose to do that :) 
> 
> But if you read the content i am asking the question if Async functions in 
> es7 can be used to build a performant and faithful version of CSP (github: 
> aysnc-csp) and also be useful for common tasks like the simple server request 
> scenario I mentioned then why wouldnt we want to think of CSP as just one 
> pattern not the One True Pattern for async. Right now core.async is being 
> used and or recommended for everything async and I am asking if that is ideal 
> and if CLJS can allow itself to grow beyond this one particular pattern when 
> it comes to async. The first thing would be renaming core.async to core.csp 
> and promoting choice when it comes to async patterns. As it is right now, 
> every time someone has an async design problem core.async is recommended as a 
> solution regardless of whether or not it's the best fit solution. If you have 
> a hammer...
> 
> That's the scope. Not es7 vs core.async and I'm sorry for the stupid title.
> 
> Sent from my iPhone
> 
> On Sep 15, 2015, at 8:32 AM, Johann Bestowrous  wrote:
> 
> At a high level, I think it's pretty important to note that you are comparing 
> a language spec to a library.
> 
> -- 
> 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 
> email to clojurescrip...@googlegroups.com.
> To post to this group, send email to clojur...@googlegroups.com.
> Visit this group at http://groups.google.com/group/clojurescript.
> 
> -- 
> 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 
> email to clojurescrip...@googlegroups.com.
> To post to this group, send email to clojur...@googlegroups.com.
> Visit this group at http://groups.google.com/group/clojurescript.
> 
> 
> 
> 
> 
> 
> 
> -- 
> 
> 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 
> email to clojurescrip...@googlegroups.com.
> 
> To post to this group, send email to clojur...@googlegroups.com.
> 
> Visit this group at http://groups.google.com/group/clojurescript.
> 
> 
> 
> 
> 
> -- 
> 
> 
> 
> 
> 
> Andrey Antukh - Андрей Антух - 
> http://www.niwi.nz
> 
> https://github.com/niwinz
> 
> 
> 
> 
> 
> -- 
> 
> 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 
> email to clojurescrip...@googlegroups.com.
> 
> To post to this group, send email to clojur...@googlegroups.com.
> 
> Visit this group at http://groups.google.com/group/clojurescript.

-- 
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 email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


[ClojureScript] Exporting UMD from ClojureScript library

2015-11-21 Thread Shaun LeBron
I'm trying to export a JavaScript API from my ClojureScript library using a UMD 
pattern, given the following export function:
https://github.com/shaunlebron/parinfer/blob/7131d10ee21a6674279577b76743f623d4b2c3c9/parinfer-lib/src/parinfer/api_js.cljs#L64-L70

After compiling in advanced mode, and running Node, `require("./parinfer.js")` 
just returns {}.  Adding the `:target :nodejs` option doesn't help.

I'm thinking it has something to do with google closure renaming my `module` 
symbol despite having the externs to prevent it.  Anyway to prevent this?

-- 
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 email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


[ClojureScript] Re: Exporting UMD from ClojureScript library

2015-11-22 Thread Shaun LeBron
Thanks, Thomas!  will post result here when completed.

On Sunday, November 22, 2015 at 3:20:49 AM UTC-6, Thomas Heller wrote:
> Hey,
> 
> my advice would be to use a post-process step instead of trying to making it 
> go through the closure compiler. Not only will that produce headaches but the 
> generated CLJS->JS also does not match the expected structure for UMD exports.
> 
> You'd need to tag the functions you want to have available by name ala
> 
> (defn ^:export js-indent-mode []...)
> 
> and then refer to them on the exports. Note that you need to refer to the 
> munged names (eg. _ instead of -).
> 
> I do not know how to do this in cljsbuild but could show you an example in 
> shadow-build if interested. Anyways all you'd need is to pipe the  compiled 
> output into the below script (at the marker). No externs needed for this case.
> 
> (function (root, factory) {
> if (typeof define === 'function' && define.amd) {
> // AMD. Register as an anonymous module.
> define([], factory);
> } else if (typeof module === 'object' && module.exports) {
> // Node. Does not work with strict CommonJS, but
> // only CommonJS-like environments that support module.exports,
> // like Node.
> module.exports = factory();
> } else {
> // Browser globals (root is window)
> root.returnExports = factory();
>   }
> }(this, function () {
> 
> // CLJS-COMPILED-OUTPUT-HERE
>   
> return {indentMode: parinfer.api_js.js_indent_mode,
> indentModeChange: parinfer.api_js.js_indent_mode_change,
> parenMode: parinfer.api_js.js_paren_mode};
> }));
> 
> 
> HTH,
> /thomas
> 
> On Sunday, November 22, 2015 at 8:42:53 AM UTC+1, Shaun LeBron wrote:
> > I'm trying to export a JavaScript API from my ClojureScript library using a 
> > UMD pattern, given the following export function:
> > https://github.com/shaunlebron/parinfer/blob/7131d10ee21a6674279577b76743f623d4b2c3c9/parinfer-lib/src/parinfer/api_js.cljs#L64-L70
> > 
> > After compiling in advanced mode, and running Node, 
> > `require("./parinfer.js")` just returns {}.  Adding the `:target :nodejs` 
> > option doesn't help.
> > 
> > I'm thinking it has something to do with google closure renaming my 
> > `module` symbol despite having the externs to prevent it.  Anyway to 
> > prevent this?

-- 
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 email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


[ClojureScript] Re: Exporting UMD from ClojureScript library

2015-11-24 Thread Shaun LeBron
Everything working here using some new shadow-build features Thomas made!
https://github.com/shaunlebron/parinfer/blob/52dcdaa140c60fd31a70f1ea2fe1e1359e7d4889/lib/dev/build.clj#L10-L13

On Sunday, November 22, 2015 at 11:06:03 PM UTC-6, Shaun LeBron wrote:
> Thanks, Thomas!  will post result here when completed.
> 
> On Sunday, November 22, 2015 at 3:20:49 AM UTC-6, Thomas Heller wrote:
> > Hey,
> > 
> > my advice would be to use a post-process step instead of trying to making 
> > it go through the closure compiler. Not only will that produce headaches 
> > but the generated CLJS->JS also does not match the expected structure for 
> > UMD exports.
> > 
> > You'd need to tag the functions you want to have available by name ala
> > 
> > (defn ^:export js-indent-mode []...)
> > 
> > and then refer to them on the exports. Note that you need to refer to the 
> > munged names (eg. _ instead of -).
> > 
> > I do not know how to do this in cljsbuild but could show you an example in 
> > shadow-build if interested. Anyways all you'd need is to pipe the  compiled 
> > output into the below script (at the marker). No externs needed for this 
> > case.
> > 
> > (function (root, factory) {
> > if (typeof define === 'function' && define.amd) {
> > // AMD. Register as an anonymous module.
> > define([], factory);
> > } else if (typeof module === 'object' && module.exports) {
> > // Node. Does not work with strict CommonJS, but
> > // only CommonJS-like environments that support module.exports,
> > // like Node.
> > module.exports = factory();
> > } else {
> > // Browser globals (root is window)
> > root.returnExports = factory();
> >   }
> > }(this, function () {
> > 
> > // CLJS-COMPILED-OUTPUT-HERE
> > 
> > return {indentMode: parinfer.api_js.js_indent_mode,
> > indentModeChange: parinfer.api_js.js_indent_mode_change,
> > parenMode: parinfer.api_js.js_paren_mode};
> > }));
> > 
> > 
> > HTH,
> > /thomas
> > 
> > On Sunday, November 22, 2015 at 8:42:53 AM UTC+1, Shaun LeBron wrote:
> > > I'm trying to export a JavaScript API from my ClojureScript library using 
> > > a UMD pattern, given the following export function:
> > > https://github.com/shaunlebron/parinfer/blob/7131d10ee21a6674279577b76743f623d4b2c3c9/parinfer-lib/src/parinfer/api_js.cljs#L64-L70
> > > 
> > > After compiling in advanced mode, and running Node, 
> > > `require("./parinfer.js")` just returns {}.  Adding the `:target :nodejs` 
> > > option doesn't help.
> > > 
> > > I'm thinking it has something to do with google closure renaming my 
> > > `module` symbol despite having the externs to prevent it.  Anyway to 
> > > prevent this?

-- 
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 email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


[ClojureScript] UMD module error

2016-01-18 Thread Shaun LeBron
JS libraries use the UMD pattern to export symbols.  I created a small sample 
project to test this out, but I am getting a Google Closure error that you can 
see and recreate here:
https://github.com/shaunlebron/umd-cljs-bug

-- 
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 email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at https://groups.google.com/group/clojurescript.


[ClojureScript] Re: ANN: ClojureScript 1.9.14, clojure.spec port

2016-06-02 Thread Shaun LeBron
Great stuff, thanks!  I'm not familiar, but is the `clojure.spec.gen` namespace 
going to be ported?

On Wednesday, June 1, 2016 at 1:01:58 PM UTC-5, David Nolen wrote:
> ClojureScript, the Clojure compiler that emits JavaScript source code.
> 
> 
> README and source code: https://github.com/clojure/clojurescript
> 
> 
> Leiningen dependency information:
> 
> 
>     [org.clojure/clojurescript "1.9.14"]
> 
> 
> This release includes a complete and faithful port of clojure.spec to
> ClojureScript. The functionality resides in the new cljs.spec
> namespace. All features present in Clojure 1.9.0-alpha4 are
> implemented, including REPL support, testing support and macro
> checking.
> 
> 
> As always feedback welcome.
> 
> 
> ## 1.9.14
> 
> 
> ### Enhancements
> * clojure.spec ported to cljs.spec
> 
> 
> ### Fixes
> * CLJS-1649: Possible issue with in cljs.reader or cljs.core/PersistentHashMap
> * CLJS-1647: Rethrow exception from parallel-build
> * CLJS-1642: cljs.core/reductions does not respect 'reduced'
> * CLJS-1635: Var type implements IEquiv but not IHash
> * CLJS-1629: Fix warning about duplicate test-pr-str
> * CLJS-1637: Missing docstrings for a few vars

-- 
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 email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at https://groups.google.com/group/clojurescript.


Re: [ClojureScript] Re: ANN: ClojureScript 1.9.14, clojure.spec port

2016-06-02 Thread Shaun LeBron
Oops, I missed that, thanks!

Why is it under `impl`?  I'd actually like to read about what the philosophy 
behind `impl` is since it's been turning up a lot.

On Thursday, June 2, 2016 at 8:33:06 AM UTC-5, Mike Fikes wrote:
> Hey Shaun,
> 
> It has been. It is cljs.spec.impl.gen
> 
> - Mike
> 
> > On Jun 2, 2016, at 9:32 AM, Shaun LeBron  wrote:
> > 
> > Great stuff, thanks!  I'm not familiar, but is the `clojure.spec.gen` 
> > namespace going to be ported?
> > 
> > On Wednesday, June 1, 2016 at 1:01:58 PM UTC-5, David Nolen wrote:
> >> ClojureScript, the Clojure compiler that emits JavaScript source code.
> >> 
> >> 
> >> README and source code: https://github.com/clojure/clojurescript
> >> 
> >> 
> >> Leiningen dependency information:
> >> 
> >> 
> >> [org.clojure/clojurescript "1.9.14"]
> >> 
> >> 
> >> This release includes a complete and faithful port of clojure.spec to
> >> ClojureScript. The functionality resides in the new cljs.spec
> >> namespace. All features present in Clojure 1.9.0-alpha4 are
> >> implemented, including REPL support, testing support and macro
> >> checking.
> >> 
> >> 
> >> As always feedback welcome.
> >> 
> >> 
> >> ## 1.9.14
> >> 
> >> 
> >> ### Enhancements
> >> * clojure.spec ported to cljs.spec
> >> 
> >> 
> >> ### Fixes
> >> * CLJS-1649: Possible issue with in cljs.reader or 
> >> cljs.core/PersistentHashMap
> >> * CLJS-1647: Rethrow exception from parallel-build
> >> * CLJS-1642: cljs.core/reductions does not respect 'reduced'
> >> * CLJS-1635: Var type implements IEquiv but not IHash
> >> * CLJS-1629: Fix warning about duplicate test-pr-str
> >> * CLJS-1637: Missing docstrings for a few vars
> > 
> > -- 
> > 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 
> > email to clojurescript+unsubscr...@googlegroups.com.
> > To post to this group, send email to clojurescript@googlegroups.com.
> > Visit this group at https://groups.google.com/group/clojurescript.

-- 
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 email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at https://groups.google.com/group/clojurescript.


Re: [ClojureScript] Re: ANN: ClojureScript 1.9.14, clojure.spec port

2016-06-03 Thread Shaun LeBron
On Thursday, June 2, 2016 at 10:05:59 AM UTC-5, Leon Grapenthin wrote:
> Until now impl was a convention to indicate that the vars the ns is private 
> to the library itself. I belive that the pattern became more common with 
> core.async.

Thanks for the background context on `impl`, Leon.

-- 
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 email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at https://groups.google.com/group/clojurescript.


[ClojureScript] Re: [ANN] shadow-devtools: simpler CLJS configs

2017-04-04 Thread Shaun LeBron
typo: use "dev" instead of "release" for the full blown dev experience:
rlwrap lein run -m shadow.cljs.devtools.cli/dev script

On Monday, April 3, 2017 at 3:35:34 PM UTC-5, Thomas Heller wrote:
> This thing I wrote is getting to a point where it might be useful to someone 
> else. It might make your CLJS life a bit easier.
> 
> I have been using my own CLJS tooling (shadow-build) for over 3 years now, it 
> had some of lein-figwheel's features that I never talked about but frankly 
> lein-figwheel was just plain easier to use so I never bothered.
> 
> Over the years however I noticed a trend in my projects that bothered me. I 
> would repeat all my build configuration at least twice and only change one 
> tiny thing. I would have a :dev build with :optimizations :none and a :min 
> build with :advanced. Some other things might change as well but the bulk of 
> the configuration stayed the same.
> 
> So the goal was simple, abstract the configuration stuff to the basics. You 
> define the :target and compile this either in :dev or :release mode. The 
> :target defines where your build is supposed to run (ie. browser, 
> node-library or node-script). :dev then provides some good defaults for 
> development (with REPL, live-reloading, source-maps, ...) and :release takes 
> care of everything to produce the most optimized build.
> 
> The main goal of this was to automate as much as possible and no changes to 
> code should be required when switching between :dev and :release.
> 
> Say you want to create a node script, something that runs as a standalone 
> node process.
> 
> {:id :script
>  :target :node-script
>  :main demo.script/main
>  :output-to "out/demo-script/script.js"}
> 
> This creates only the file defined in :output-to. You run that file by 
> calling "node script.js arg". It will call "(demo.script/main "arg") on 
> startup which is a normal `(defn main [& args] ...)` in `(ns demo.script)`. 
> No need to do the usual `(set! *main-cli-fn* ...)` or anything else really.
> 
> To compile the script in :dev mode you run:
> lein run -m shadow.cljs.devtools.cli/once script
> 
> To compile the script in :release mode:
> lein run -m shadow.cljs.devtools.cli/release script
> 
> Or if you want the full blown dev experience:
> rlwrap lein run -m shadow.cljs.devtools.cli/release script
> 
> This drops you into a REPL that you can use to interact with the running 
> process once you start the node process.
> 
> 
> If you just want to integrate with some existing node stuff as a library you 
> can use this config:
> 
> {:id :library
>  :target :node-library
>  :output-to "out/demo-library/lib.js"
>  :exports
>  {:hello demo.lib/hello}}
> 
> The :exports map specifies which vars should be exported to node.
> 
> > var x = require('./lib');
> undefined
> > x.hello()
> hello
> 'hello'
> 
> 
> The caveat of all this is that these default :target configurations (didn't 
> mention :browser yet) are based on what I consider "good" setups. That might 
> be totally different from what everyone else is doing. There are also some 
> other differences to other build tools like figwheel or lein-cljsbuild, which 
> may be confusing at first.
> 
> So should anyone be interested in this at all I'd be happy about any kind of 
> feedback.
> 
> You can find some more information here:
> https://github.com/thheller/shadow-devtools
> 
> I would consider this ALPHA level but I have been using shadow-build for a 
> really long time and some of the devtools things for just as long. I just 
> re-wrote some parts recently to simplify the configuration bits. It is 
> nowhere near the polish of lein-figwheel but it is probably faster and 
> simpler to configure. ;)
> 
> Cheers,
> /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 email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at https://groups.google.com/group/clojurescript.


[ClojureScript] Re: Lots of undeclared Var warnings after upgrading to 1.9.493

2017-04-15 Thread Shaun LeBron
cljs.pprint/*out* was removed in 1.7.10.  see: 
http://cljs.github.io/api/cljs.pprint/STARoutSTAR

might be something weird going on with the analysis cache? clean your 
output-dir to clear it.  if that doesn't fix, can you give a working example?

On Saturday, April 15, 2017 at 2:16:11 AM UTC-5, Torsten Uhlmann wrote:
> Hi,
> 
> after upgrading Clojurscript from 1.9.473 to 1.9.493 I get a bunch of 
> warnings like this:
> 
> WARNING: Use of undeclared Var cljs.pprint/*out* at line 2141 
> resources\public\js\out\cljs\pprint.cljs
> 
> The warnings also appear with the latest version 1.9.521.
> 
> Is that expected or am I doing something wrong?
> 
> Thanks,
> Torsten.

-- 
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 email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at https://groups.google.com/group/clojurescript.


Re: [ClojureScript] Re: Lots of undeclared Var warnings after upgrading to 1.9.493

2017-04-16 Thread Shaun LeBron
cool, sounds like you found the source.  can we get a minimal example?

On Sunday, April 16, 2017 at 1:25:48 AM UTC-5, Torsten Uhlmann wrote:
> I think I found the source of the problem, but I don't understand it yet :)
> 
> So, for building my project I'm using a setup copied and adapted from the 
> chestnut template. I do `lein repl` and then `(run)` which minifies assets, 
> builds scss files and then calls figwheel.
> 
> The problem goes away when I do not build scss files, it uses `[lein-sass 
> "0.4.0"]` for this.
> 
> To build scss files it runs:
> 
> (defn start-scss []
>   (future
> (log/info "Starting scss.")
> (lein/-main ["sass" "auto"])))
> 
> When running the command in a separate terminal and starting my project 
> without the scss builder call no warnings appear. Please not I did not change 
> the project dependencies, just did not call `(start-scss)`.
> 
> I don't understand the relationship between the warning and the lein call, 
> the lein-sass plugin does (seemingly) not use and Clojurescript.
> 
> Could you give me some pointers where to look further?
> 
> Thanks,
> Torsten.
> 
> Am Samstag, 15. April 2017 21:05:29 UTC+2 schrieb Torsten Uhlmann:
> > Thanks for your response!
> > 
> > 
> > I cleaned the output dir multiple times and that didn't change it. I will 
> > provide a minimal example- maybe doing this will surface the problem...
> > 
> > 
> > Shaun LeBron schrieb am Sa., 15. Apr. 2017 um 19:40 Uhr:
> > cljs.pprint/*out* was removed in 1.7.10.  see: 
> > http://cljs.github.io/api/cljs.pprint/STARoutSTAR
> > 
> > 
> > 
> > might be something weird going on with the analysis cache? clean your 
> > output-dir to clear it.  if that doesn't fix, can you give a working 
> > example?
> > 
> > 
> > 
> > On Saturday, April 15, 2017 at 2:16:11 AM UTC-5, Torsten Uhlmann wrote:
> > 
> > > Hi,
> > 
> > >
> > 
> > > after upgrading Clojurscript from 1.9.473 to 1.9.493 I get a bunch of 
> > > warnings like this:
> > 
> > >
> > 
> > > WARNING: Use of undeclared Var cljs.pprint/*out* at line 2141 
> > > resources\public\js\out\cljs\pprint.cljs
> > 
> > >
> > 
> > > The warnings also appear with the latest version 1.9.521.
> > 
> > >
> > 
> > > Is that expected or am I doing something wrong?
> > 
> > >
> > 
> > > Thanks,
> > 
> > > Torsten.
> >

-- 
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 email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at https://groups.google.com/group/clojurescript.


[ClojureScript] Re: Any chance we can fit ClojureScript into Webpack ecosystem?

2017-05-11 Thread Shaun LeBron
On Wednesday, May 10, 2017 at 11:45:02 PM UTC-5, Jiyin Yiyong wrote:
> Already an old boring topic... I'm from JavaScript side and so many people 
> are building apps with Webpack. And so many of alt-js languages got Webpack 
> loaders:
> 
> BuckleScript https://github.com/rrdelaney/bs-loader
> PureScript https://github.com/ethul/purs-loader
> Elm https://github.com/elm-community/elm-webpack-loader
> Fable https://github.com/fable-compiler/Fable
> 
> Exception:
> 
> No Webpack for ReasonML 
> https://github.com/chenglou/reason-react-example/blob/master/webpack.config.js
> 
> Can we make a loader for ClojureScript? 
> 
> Or how about the possibility? I guess Closure Compiler will get in the why. 
> But is it possible if I don't use dead code elimination from Closure 
> Compiler? I know many people need it but seriously no other solutions? And 
> how much does ClojureScript depend on Closure Library?

I'm from the JS side as well, so I'm glad to see this question!  Are you 
imagining something like the following?  We should probably start by imagining 
why someone would want to require cljs this way and if it would even make sense 
to:

```
require('cljs!./src-cljs') // return all goog.provided namespaces?
require('cljs!./src-cljs/foo/core.cljs') // return a single goog.provide 
namespace?
```

Either way I think it would need Closure Compiler to return a single asset for 
each require statement, if I understand webpack correctly.

It's worth mentioning that the recent "node-jre" package allows users to 
install/use the full cljs JVM compiler in its fully glory through npm without 
any external dependencies, which I've tested here: https://github.com/cljs/tool

I think it's possible—just unsure of webpack use-cases.  Thoughts?

-- 
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 email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at https://groups.google.com/group/clojurescript.


[ClojureScript] Re: A new take on ClojureScript and npm

2017-05-14 Thread Shaun LeBron
> The example still uses leiningen by I may drop that and create something 
> standalone.

I'd like to show you around my "cljs/tool" some time for your standalone thing. 
I'm a year into building it to wrap a good UX around cljs on npm things as they 
become available, and I think this experimental feature could be delivered 
pretty easily through it.

-- 
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 email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at https://groups.google.com/group/clojurescript.


[ClojureScript] Re: A new take on ClojureScript and npm

2017-05-16 Thread Shaun LeBron
On Tuesday, May 16, 2017 at 4:56:03 AM UTC-5, Thomas Heller wrote:
> I wrote a short introduction here:
> https://github.com/thheller/shadow-devtools/wiki/ClojureScript-for-JS-Devs
> 
> Looking for any kind of feedback.

The quick start is great!  I have three questions:

1. Should we call this "cljs-require"?  With the understanding that it is a bit 
like a portal to cljs's ":require" form:

require('cljs-require/foo.core')

2. Is there a way to set the ClojureScript version, or is it tied to shadow's 
version?

3. Thinking back on Jiyin's question about using cljs in webpack—have you put 
any thought into the possibility of this workflow as a webpack loader?  Maybe 
that's a next step?

Awesome job turning this webpack discussion into a real tool we can explore! 🎉

-- 
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 email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at https://groups.google.com/group/clojurescript.


[ClojureScript] Re: When will the async/await feature in ES8 be introduced in ClojureScript?

2018-05-24 Thread Shaun LeBron
thanks for posting this question.  I asked about it a few months ago on 
slack and apparently it has come up a few times.  There is resistance (for 
good reason), but here's a proposal I put together that might get 
discussion going:

https://beta.observablehq.com/@shaunlebron/proposal-generators-and-async-functions-in-clojurescript

in summary, core.async doesn't solve all the problems, can be harder to 
debug, and using the promise api directly can be unwieldy.  but there are 
arguments against including the extra syntax.

feedback appreciated!


On Wednesday, May 23, 2018 at 11:44:06 PM UTC-5, Philos Kim wrote:
>
> I wonder when the async/await feature in ES8 will be introduced in 
> ClojureScript.
>
> Of course, I know there is core.async in ClojureScript but I hope that the 
> async/await feature in ES8 will be supported in ClojureScript as soon as 
> possible.
>
> Does anyone know when it will be supported?
>

-- 
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 email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at https://groups.google.com/group/clojurescript.


[ClojureScript] Re: When will the async/await feature in ES8 be introduced in ClojureScript?

2018-05-24 Thread Shaun LeBron
good point about the IIFEs, added some notes on what to fixl:

https://beta.observablehq.com/@shaunlebron/proposal-generators-and-async-functions-in-clojurescript#blockers

> [core.async] is a much more powerful abstraction which can do a lot of 
things async/await can't and anything that does can easily be achieved with 
core.async and a few helper functions/macros

not quite! core.async doesn't allow you to cancel a go-block (to my 
knowledge), which JS allows.  I added a section on this:

https://beta.observablehq.com/@shaunlebron/proposal-generators-and-async-functions-in-clojurescript#coreasync

On Thursday, May 24, 2018 at 4:44:29 PM UTC-5, Thomas Heller wrote:
>
> I'm generally in favor of "embracing the host" but both generators and 
> async/await would probably require substantial rewrites of core parts of 
> the compiler. It it not just about adding a small *** or *async* keyword 
> somewhere. The compiler will generally emit anonymous functions at various 
> places to ensure proper scoping and this can pretty easily break 
> async/generator functions. Given that you'd emitting ES6+ anways however 
> you could replace those with proper block-scoped lets though. Of course 
> that is not a reason to not do it, just don't underestimate how much work 
> this would be.
>
> I certainly looks like the JS world is adopting async/await but given the 
> rate of change in that ecosystem that might change again when the next 
> thing comes along. Given that the React folks decided to implement a pretty 
> substantial feature based on throwing promises I guess they are here to 
> stay for a while though.
>
> I do not think that this compares in any way to core.async however. It is 
> a much more powerful abstraction which can do a lot of things async/await 
> can't and anything that does can easily be achieved with core.async and a 
> few helper functions/macros. Yes, core.async is not perfect either but 
> someone could work on fixing the kinks.
>
> I guess I agree that we should eventually support async/await + generators 
> for the sake of full interop but not because of "issues" with core.async. 
>
>
> On Thursday, May 24, 2018 at 6:58:38 PM UTC+2, Shaun LeBron wrote:
>>
>> thanks for posting this question.  I asked about it a few months ago on 
>> slack and apparently it has come up a few times.  There is resistance (for 
>> good reason), but here's a proposal I put together that might get 
>> discussion going:
>>
>>
>> https://beta.observablehq.com/@shaunlebron/proposal-generators-and-async-functions-in-clojurescript
>>
>> in summary, core.async doesn't solve all the problems, can be harder to 
>> debug, and using the promise api directly can be unwieldy.  but there are 
>> arguments against including the extra syntax.
>>
>> feedback appreciated!
>>
>>
>> On Wednesday, May 23, 2018 at 11:44:06 PM UTC-5, Philos Kim wrote:
>>>
>>> I wonder when the async/await feature in ES8 will be introduced in 
>>> ClojureScript.
>>>
>>> Of course, I know there is core.async in ClojureScript but I hope that 
>>> the async/await feature in ES8 will be supported in ClojureScript as soon 
>>> as possible.
>>>
>>> Does anyone know when it will be supported?
>>>
>>

-- 
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 email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at https://groups.google.com/group/clojurescript.


[ClojureScript] Re: When will the async/await feature in ES8 be introduced in ClojureScript?

2018-05-25 Thread Shaun LeBron
Right!  The proposal mentions that go-blocks must check for a closed 
channel at every step in order to exit early. So I'll revise the 
title—core.async cannot stop *arbitrary* go-blocks.

For example, with this staggered animation code, it's not immediately clear 
to me how to exit after any step. In JS, it pulls the plug for free.

(go
  (dotimes [_ 3]
(swap! game assoc :board cleared)
(
>
>> not quite! core.async doesn't allow you to cancel a go-block (to my 
>> knowledge), which JS allows.  I added a section on this:
>>
>>
>> https://beta.observablehq.com/@shaunlebron/proposal-generators-and-async-functions-in-clojurescript#coreasync
>>
>>
> This is incorrect. Closing a channel can be used to "end" a loop. In 
> addition it is possible to use alt! or alts! with an additional "control" 
> channel (or more) and "selecting" which channel to work on.
>
>
>
> (defn foo []
>   (let [ch (async/chan)]
> (go (loop [i 100]
>   (when (pos? i)
> ( (when (>! ch i)
>   (recur (dec i)
> (prn :loop-terminated))
> ch))
>
> (go (let [ch (foo)]
>   (prn (   (prn (   (async/close! ch)
>   (prn (
>
>  
> In addition the "loop" is dependent on the "ch" reference. If that gets 
> garbage collected the loop will be as well, similar to generators or 
> async/await.
>

-- 
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 email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at https://groups.google.com/group/clojurescript.


[ClojureScript] Re: When will the async/await feature in ES8 be introduced in ClojureScript?

2018-05-25 Thread Shaun LeBron
thanks!  
added: 
https://beta.observablehq.com/@shaunlebron/proposal-generators-and-async-functions-in-clojurescript#macros

On Friday, May 25, 2018 at 1:24:07 PM UTC-5, Didier wrote:
>
> For example this blog post shows compatibility: 
> https://blog.jeaye.com/2017/09/30/clojurescript-promesa/
>
> And also gives a nice little macro so you can use similar syntax to async 
> and await.
>
> The biggest downside is that all the sugar is in a macro, and thus can't 
> rewrite across function boundaries. Though I think that's also true in JS.
>
>

-- 
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 email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at https://groups.google.com/group/clojurescript.


[ClojureScript] Re: When will the async/await feature in ES8 be introduced in ClojureScript?

2018-05-25 Thread Shaun LeBron
agreed that core.async is not relevant to this discussion.

I suppose the main question is—how should ES6+ (ES Next) features be made 
available to CLJS users.  Is the story going to be  "All of ES5 is 
accessible from CLJS—but you must use an external JS file for ES Next 
features"?

(I added your transpile link to macros section. Also, I'd love to see 
emitting ES Modules in the future, though I'm not sure of implications 
there)

On Friday, May 25, 2018 at 11:22:26 AM UTC-5, Thomas Heller wrote:
>
> Yes, core.async is not great for this but it was also not meant for this. 
> The big abstraction there are channels or CSP. There are "zero" channels 
> involved in your example so you could probably find a better abstraction to 
> fit here.
>
> There are several different concurrency models and all of them have 
> drawbacks. As I said before I'm for adding support for async/await and 
> generators but core.async should not even be part of the argument IMHO. I'm 
> not trying to convince anyone that core.async is the best solution ever. I 
> remember vividly how desperately I wanted a proper Actor-like concurrency 
> primitive when I came over from Erlang. I actually only understood the 
> drawbacks of Actors after I learned about CSP.
>
> I made this example a while ago showing what Closure does when rewriting 
> async/await to ES3.
> https://gist.github.com/thheller/82ca9ef8a04b58aafa4624edbac383ac
>
> We could emit that JS code directly using a few macros. The only reason 
> emitting the ES6+ code makes sense is due to tool support and maybe having 
> slightly more compact code, which is probably not a factor after :advanced 
> is done with it. We can already interop with all of it very easily, just 
> writing equivalent code is not ideal.
>
> To be honest just adding support for async/await and generators alone 
> doesn't make much sense to me. At that point we should probably look into 
> emitting ES6+ESM directly instead and make proper use of all the features 
> that has. Given that Closure support for ES6 is getting much better that 
> might make sense at some point.
>
>
> On Friday, May 25, 2018 at 4:45:22 PM UTC+2, Shaun LeBron wrote:
>>
>> Right!  The proposal mentions that go-blocks must check for a closed 
>> channel at every step in order to exit early. So I'll revise the 
>> title—core.async cannot stop *arbitrary* go-blocks.
>>
>> For example, with this staggered animation code, it's not immediately 
>> clear to me how to exit after any step. In JS, it pulls the plug for free.
>>
>> (go
>>   (dotimes [_ 3]
>> (swap! game assoc :board cleared)
>> (> (swap! game assoc :board board)
>> (>   (swap! game assoc :board cleared)
>>   (>   (swap! game assoc :board collapsed))
>>
>>
>> Anyone coming from the Unity game engine will recognize this feature as 
>> the StopCoroutine function. Core.async does not have such a feature.  the 
>> ergonomics matter!
>>
>> On Friday, May 25, 2018 at 3:28:49 AM UTC-5, Thomas Heller wrote:
>>>
>>>
>>>> not quite! core.async doesn't allow you to cancel a go-block (to my 
>>>> knowledge), which JS allows.  I added a section on this:
>>>>
>>>>
>>>> https://beta.observablehq.com/@shaunlebron/proposal-generators-and-async-functions-in-clojurescript#coreasync
>>>>
>>>>
>>> This is incorrect. Closing a channel can be used to "end" a loop. In 
>>> addition it is possible to use alt! or alts! with an additional "control" 
>>> channel (or more) and "selecting" which channel to work on.
>>>
>>>
>>>
>>> (defn foo []
>>>   (let [ch (async/chan)]
>>> (go (loop [i 100]
>>>   (when (pos? i)
>>> (>> (when (>! ch i)
>>>   (recur (dec i)
>>> (prn :loop-terminated))
>>> ch))
>>>
>>> (go (let [ch (foo)]
>>>   (prn (>>   (prn (>>   (async/close! ch)
>>>   (prn (>>
>>>
>>>  
>>> In addition the "loop" is dependent on the "ch" reference. If that gets 
>>> garbage collected the loop will be as well, similar to generators or 
>>> async/await.
>>>
>>

-- 
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 email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at https://groups.google.com/group/clojurescript.