cljsjs / boot-cljsjs

Helper tasks to aid the packaging of JS dependencies for Clojurescript projects
66 stars 22 forks source link

Bad example in README should be a good example #13

Closed danielsz closed 9 years ago

danielsz commented 9 years ago

Seriously.

Thanks!

martinklepsch commented 9 years ago

There is a better example in the packages project, maybe we should use this one here as well or link to it (that'd also make it easier to maintain).

;; in your build.boot file:
(set-env!
  :source-paths #{"src"}
  :dependencies '[[adzerk/boot-cljs   "0.0-2629-1" :scope "test"]
                  [cljsjs/boot-cljsjs "0.3.1"      :scope "test"]
                  [cljsjs/react       "0.12.2-2"]
                  [reagent            "0.4.3"]]

(require '[adzerk.boot-cljs :refer [cljs]]
         '[cljsjs.boot-cljsjs :refer [from-cljsjs]])

(deftask build-dev []
  (comp
    (from-cljsjs :profile :development)
    (cljs :optimizations :none)))

(deftask build-prod []
  (comp
    (from-cljsjs :profile :production)
    (cljs :optimizations :advanced)))
danielsz commented 9 years ago

This is much better. A link is fine, too. The main thing is to avoid causing confusion. I understood a little bit more about boot-cljsjs only after seeing how @Deraen used it in https://github.com/Deraen/saapas.

martinklepsch commented 9 years ago

Maybe it'd make sense to annotate the example with things like:

; This will scan jars for files under cljsjs/ and add .inc.js, .ext.js & .lib.js to the fileset
(from-cljsjs :profile :development)

Thanks for your feedback @danielsz, things have been changing fast so documentation might be a bit behind still, please let us know if you discover anything else that should be improved :)

danielsz commented 9 years ago

Annotating the example like you demonstrate would be extremely helpful for users new to boot-clj and boot-cljsjs.

Thank you for the library and the good work!

Deraen commented 9 years ago

I think it's best to have example on the readme here, things shouldn't change too much in future I think.

martinklepsch commented 9 years ago

Made some changes, let me know what you think.

danielsz commented 9 years ago

Looks good. Also: #14