Oh sorry, to be clear - that won't work for a ClojureScript + node.js backend - as far as I can tell you're running a Clojure server on the backend and ClojureScript on the front.
Though, actually, looking at the original question that may not be what Martin is asking for, in which case your project.clj is definitely exactly right! On Tue, Mar 18, 2014 at 8:37 PM, Travis Vachon <[email protected]> wrote: > Ah - that works for Clojure, but not for ClojureScript. Unfortunately > I don't think heroku + node.js is smart enough to build with > leiningen, though perhaps the Procfile could do "lein cljsbuild once" > before running node? That would mean slow startup times, but that > could be ok. > > On Tue, Mar 18, 2014 at 6:28 PM, Xavi Caballé <[email protected]> wrote: >> Here they are. HTH >> >> ; Procfile >> web: java $JVM_OPTS -cp target/example-standalone.jar clojure.main -m >> example.server >> >> ; project.clj >> (defproject example "0.3.0-SNAPSHOT" >> :description "Example" >> :dependencies [[org.clojure/clojure "1.5.1"] >> [org.clojure/clojurescript "0.0-2127"] >> ; ... >> ] >> :plugins [[lein-cljsbuild "0.3.4"]] >> :profiles {:dev {:source-paths ["dev"]}} >> :hooks [leiningen.cljsbuild] >> :cljsbuild { >> :builds { >> :dev >> {:source-paths ["src"] >> :compiler { >> :output-to "resources/public/js/cljs-debug.js" >> :optimizations :whitespace >> :pretty-print true }} >> :prod >> {:source-paths ["src"] >> :compiler { >> :output-to "resources/public/js/cljs.js" >> :optimizations :advanced >> :pretty-print false}}}} >> :min-lein-version "2.0.0" >> :main example.server >> :jvm-opts ["-Djava.awt.headless=true"] >> :source-paths ["src"] >> :uberjar-name "example-standalone.jar" >> ; Workaround for >> ; https://groups.google.com/forum/#!topic/clojure/7Kijzaf0SGk >> ; >> https://github.com/technomancy/leiningen/commit/5b97d9a47246af30d0e146f0c12cfa45fbf6953e >> ; while dm3's (aka Vadim Platonov) pull request is not applied to Ring >> ; https://github.com/ring-clojure/ring/issues/96 >> :jar-exclusions [#"^.*/$"]) >> >> >> >> >> >> On Tuesday, March 18, 2014 10:14:30 PM UTC+1, Martin Klepsch wrote: >>> Hey >>> >>> >>> >>> @Travis >>> >>> I thought about that and it probably is a solution, feels a bit like a >>> workaround though. >>> >>> >>> >>> @Xavi >>> >>> I tried to get that automatic compilation of Clojurescript to work, but >>> couldn't. >>> >>> Would you mind sharing your project.clj + Procfile with me? >>> >>> Maybe I can figure it out when I can compare them side-by-side with mine. >>> >>> >>> >>> Thanks already! >>> >>> >>> >>> On Tuesday, March 18, 2014 3:42:40 PM UTC+1, Xavi Caballé wrote: >>> >>> > Martin, I just use the leiningen.cljsbuild hook like you said. >>> >>> > >>> >>> > I don't use :resource-paths, but I think it still works because the >>> > default :resource-paths is ["resources"] >>> >>> > https://github.com/technomancy/leiningen/blob/491c2c9595a90afb2653b085be03bf312b8d3e5d/leiningen-core/src/leiningen/core/project.clj#L175 >>> >>> > >>> >>> > There's no need to check any JavaScript file into version control. >>> > ClojureScript will be transpiled to JavaScript by Heroku when deploying. >>> >>> > >>> >>> > I also have an :uberjar-name entry in the project.clj like in Heroku's >>> > Clojure article >>> >>> > https://devcenter.heroku.com/articles/getting-started-with-clojure#project-clj >>> >>> > >>> >>> > >>> >>> > Xavi >>> >>> > >>> >>> > >>> >>> > On Monday, March 17, 2014 6:11:49 PM UTC+1, Travis Vachon wrote: >>> >>> > > Hey Martin >>> >>> > > >>> >>> > > >>> >>> > > >>> >>> > > I haven't done this before, but just took a quick look at >>> >>> > > >>> >>> > > https://devcenter.heroku.com/articles/getting-started-with-nodejs >>> >>> > > >>> >>> > > >>> >>> > > >>> >>> > > At a high level, my understanding is that you'll need to check a >>> >>> > > >>> >>> > > JavaScript file into version control and push the relevant branch up >>> >>> > > >>> >>> > > to heroku. What you might want to do is follow the pattern GitHub uses >>> >>> > > >>> >>> > > for project pages - maintain a separate branch that contains only the >>> >>> > > >>> >>> > > files you'll want to deploy to heroku (a package.json file, a Procfile >>> >>> > > >>> >>> > > and the JavaScript file containing your application code) and push >>> >>> > > >>> >>> > > that. When you want to deploy to Heroku you would: >>> >>> > > >>> >>> > > >>> >>> > > >>> >>> > > 1) check out your master branch (the one with ClojureScript) and build >>> >>> > > >>> >>> > > (lein cljsbuild once) to a temporary location >>> >>> > > >>> >>> > > 2) check out your deployment branch and move the generated JavaScript >>> >>> > > >>> >>> > > file into the appropriate location >>> >>> > > >>> >>> > > 3) commit the generated JavaScript file >>> >>> > > >>> >>> > > 4) push the deployment branch to Heroku >>> >>> > > >>> >>> > > >>> >>> > > >>> >>> > > You could write a short script that made this very easy. >>> >>> > > >>> >>> > > >>> >>> > > >>> >>> > > To be clear, this mean that the deployment branch will have entirely >>> >>> > > >>> >>> > > different content from the development branch. It would also be >>> >>> > > >>> >>> > > possible to keep them all in the same branch, and just commit the >>> >>> > > >>> >>> > > generated JavaScript whenever you'd like to deploy to Heroku. This >>> >>> > > >>> >>> > > might have more overhead, but, hard to say. Yet another option would >>> >>> > > >>> >>> > > be to have a submodule within your ClojureScript repository that >>> >>> > > >>> >>> > > looked like a normal Heroku node.js project. Submodules are kind of a >>> >>> > > >>> >>> > > pain though. >>> >>> > > >>> >>> > > >>> >>> > > >>> >>> > > Good luck! Very interested to hear what you end up doing. >>> >>> > > >>> >>> > > >>> >>> > > >>> >>> > > Travis >>> >>> > > >>> >>> > > >>> >>> > > >>> >>> > > On Thu, Mar 13, 2014 at 3:23 PM, Martin Klepsch >>> >>> > > >>> >>> > > <[email protected]> wrote: >>> >>> > > >>> >>> > > > Hey, >>> >>> > > >>> >>> > > > >>> >>> > > >>> >>> > > > I was looking for a simple way to deploy a clojurescript app to >>> > > > heroku/dokku. >>> >>> > > >>> >>> > > > Seemed like the proper way to do that is using something like >>> > > > `:resource-paths ["resources"]` >>> >>> > > >>> >>> > > > and use that as target directory for the cljs compilation. >>> >>> > > >>> >>> > > > >>> >>> > > >>> >>> > > > I now wonder how I can integrate cljsbuild into leiningens uberjar >>> > > > command. As I understand the leiningen.cljsbuild hook it should do >>> > > > exactly this. >>> >>> > > >>> >>> > > > >>> >>> > > >>> >>> > > > Would love to hear how you do it (and more general how do you deploy >>> > > > clojurescript)? >>> >>> > > >>> >>> > > > >>> >>> > > >>> >>> > > > Martin >>> >>> > > >>> >>> > > > >>> >>> > > >>> >>> > > > ps. I have some project here with the configuration I described in >>> > > > case something is unclear https://github.com/mklappstuhl/suggest >>> >>> > > >>> >>> > > > >>> >>> > > >>> >>> > > > -- >>> >>> > > >>> >>> > > > 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 [email protected]. >>> >>> > > >>> >>> > > > To post to this group, send email to [email protected]. >>> >>> > > >>> >>> > > > 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 [email protected]. >> To post to this group, send email to [email protected]. >> 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 [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/clojurescript.
