Fork me on GitHub

how would i configure lein to copy the static assets (imgs, css, etc) to the output directory of cljsbuild?


Does anyone know what Google means by "2D array" in this?


start	(Array<number>|null)
2D array for start scroll left and top.


Looks decidedly one dimensional to me, but it fails silently, so I'm guessing I have something wrong.


guessing it's a array with two coordinates, x y which would be the pixels from the left and the pixels from the top (but, this is a guess)


should be used something like this: goog.fx.dom.Scroll(document, [0,0], [0,100], 200);


well, (new goog.fx.dom.Scroll(document, [0,0], [0,100], 200)).play() I guess would be the full usage actually


This is what I have:

(let [el (get-element "the-element")
      scroller (Scroll. el
                       (clj->js [0 800])
                       (clj->js [0 (.-offsetTop el)])
   (.play scroller))
I'm guessing the problem is somewhere else then. Alright, thanks!


I gave up on Closure and just used .scrollIntoView.

Tangible Dream23:04:13

I’m working through Ch7 of living clojure and I think I’m getting tangled up in version dependencies The book is written circa 2015 pardon the length of this output cljsbuild barfout my cheshire-cat.core file core.cljs

(ns cheshire-cat.core
  (:require-macros [cljs.core.async.macros :refer [go]])
  (:require [clojure.browser.repl :as repl]
            [cljs-http.client :as http]
            [cljs.core.async :refer [<!]]
            [enfocus.core :as ef]))

(defn ^:export init []
  (repl/connect "")
  (go (let [response (<! (http/get "/cheshire-cat"))
            body (:body response)]
        (ef/at "#cat-name" (ef/content (:name body)))
        (ef/at "#status" (ef/content (:status body))))))
my project version dance
(defproject cheshire-cat "0.1.0-SNAPSHOT"
  :description "FIXME: write description"
  :url ""
  :min-lein-version "2.0.0"
  :dependencies [[org.clojure/clojure "1.10.0"]
                 [compojure "1.6.1"]
                 [ring/ring-defaults "0.3.2"]
                 [ring/ring-json "0.5.0-beta1"]
                 [org.clojure/clojurescript "1.10.520"]
                 [cljs-http "0.1.46"]
                 [org.clojure/core.async "0.4.490"]
                 [enfocus "2.1.1"]]
  :plugins [[lein-ring "0.12.5"]
            [lein-cljsbuild "1.1.7"]]
  :ring {:handler cheshire-cat.handler/app}
  {:dev {:dependencies [[javax.servlet/servlet-api "2.5"]
                        [ring/ring-mock "0.3.2"]]}}
  :cljsbuild {
      :builds [{
          :source-paths ["src-cljs"]
          :compiler {
            :output-to "resources/public/main.js"
            :optimizations :whitespace
            :pretty-print true}}]})


Hey @UHVRM4S64, did you get yourself sorted here?


The issue I believe you're running into is that since that book was written the ns macro became more strict about its arguments.


In particular inside a ns form (:import [package.Class]) used to work, even though it's malformed (import lists expect a space between the package name and the class name(s) (:import [package Class])).


One of the packages you're using, enfocus, has a namespace (`enfocus.macros`) that uses that malformed syntax:


One thing you could try is downgrading your Clojure version to when the ns macro was less strict. 1.9.0, say.


I filed an issue for the malformed ns form in enfocus.macros here:

Tangible Dream13:04:34

I was thinking of downgrading. I’ll try it

Tangible Dream13:04:07

Here is what I get with 1.9.36

Tangible Dream13:04:50

GR-030078mbp:cheshire-cat rhicks$ lein cljsbuild auto
Watching for changes before compiling ClojureScript...
Retrieving org/clojure/tools.reader/1.0.0-beta4/tools.reader-1.0.0-beta4.jar from central
Could not find artifact org.clojure:clojurescript:jar:1.9.0 in central ()
Could not find artifact org.clojure:clojurescript:jar:1.9.0 in clojars ()
This could be due to a typo in :dependencies, file system permissions, or network issues.
If you are behind a proxy, try setting the 'http_proxy' environment variable.
GR-030078mbp:cheshire-cat rhicks$ lein cljsbuild auto
Watching for changes before compiling ClojureScript...
Retrieving org/clojure/clojurescript/1.9.36/clojurescript-1.9.36.pom from central
Retrieving com/google/javascript/closure-compiler/v20160315/closure-compiler-v20160315.pom from central
Retrieving com/google/javascript/closure-compiler-main/v20160315/closure-compiler-main-v20160315.pom from central
Retrieving com/google/javascript/closure-compiler-parent/v20160315/closure-compiler-parent-v20160315.pom from central
Retrieving com/google/javascript/closure-compiler-externs/v20160315/closure-compiler-externs-v20160315.pom from central
Retrieving com/google/guava/guava/19.0/guava-19.0.pom from central
Retrieving com/google/guava/guava-parent/19.0/guava-parent-19.0.pom from central
Retrieving org/clojure/tools.reader/1.0.0-beta1/tools.reader-1.0.0-beta1.pom from central
Retrieving com/google/javascript/closure-compiler/v20160315/closure-compiler-v20160315.jar from central
Retrieving com/google/code/gson/gson/2.2.4/gson-2.2.4.jar from central
Retrieving com/google/javascript/closure-compiler-externs/v20160315/closure-compiler-externs-v20160315.jar from central
Retrieving com/google/guava/guava/19.0/guava-19.0.jar from central
Retrieving org/clojure/tools.reader/1.0.0-beta1/tools.reader-1.0.0-beta1.jar from central
Retrieving org/clojure/clojurescript/1.9.36/clojurescript-1.9.36.jar from central
WARNING: boolean? already refers to: #'clojure.core/boolean? in namespace: cljs.util, being replaced by: #'cljs.util/boolean?
Exception in thread "main" Syntax error macroexpanding clojure.core/ns at (cljs/source_map/base64_vlq.clj:1:1).
Call to clojure.core/ns did not conform to spec.
	at clojure.lang.Compiler.checkSpecs(
	at clojure.lang.Compiler.macroexpand1(
	at clojure.lang.Compiler.macroexpand(
	at clojure.lang.Compiler.eval(
	at clojure.lang.Compiler.load(
	at clojure.lang.RT.loadResourceScript(
	at clojure.lang.RT.loadResourceScript(
	at clojure.lang.RT.load(
	at clojure.lang.RT.load(
	at clojure.core$load$fn__6824.invoke(core.clj:6126)
	at clojure.core$load.invokeStatic(core.clj:6125)
	at clojure.core$load.doInvoke(core.clj:6109)
	at clojure.lang.RestFn.invoke(
	at clojure.core$load_one.invokeStatic(core.clj:5908)
	at clojure.core$load_one.invoke(core.clj:5903)
	at clojure.core$load_lib$fn__6765.invoke(core.clj:5948)
	at clojure.core$load_lib.invokeStatic(core.clj:5947)
	at clojure.core$load_lib.doInvoke(core.clj:5928)
	at clojure.lang.RestFn.applyTo(
	at clojure.core$apply.invokeStatic(core.clj:667)
	at clojure.core$load_libs.invokeStatic(core.clj:5985)
	at clojure.core$load_libs.doInvoke(core.clj:5969)
	at clojure.lang.RestFn.applyTo(
	at clojure.core$apply.invokeStatic(core.clj:667)
	at clojure.core$require.invokeStatic(core.clj:6007)
	at clojure.core$require.doInvoke(core.clj:6007)
	at clojure.lang.RestFn.invoke(
	at cljs.source_map$eval2537$loading__6706__auto____2538.invoke(source_map.clj:1)
	at cljs.source_map$eval2537.invokeStatic(source_map.clj:1)
	at cljs.source_map$eval2537.invoke(source_map.clj:1)
	at clojure.lang.Compiler.eval(

Tangible Dream13:04:50

at clojure.lang.Compiler.eval(
	at clojure.lang.Compiler.load(


@UHVRM4S64 The relevant bit there is this part:

Call to clojure.core/ns did not conform to spec.
Try going back farther.

Tangible Dream20:04:20

Actually, the writer of enfocus is going to get his code up to current versions


Oh, great!