Coder Social home page Coder Social logo

chestnut's Introduction

chestnut

Gitter Clojureverse

Clojars Project

Mr. Chestnut

Getting value out of Chestnut? Consider making a small donation.

Chestnut is a Clojure/ClojureScript application template. It takes the pain out of getting a working ClojureScript setup with live reloading plus a browser connected REPL.

It provides a solid default configuration for a REPL driven workflow, a ClojureScript setup with separate dev/prod/test builds, Figwheel integration, and a basic setup for running CLJ and CLJS unit tests. It provides a basic web backend setup with Compojure, and a frontend based on one of the React wrappers (your choice of Reagent, Rum, om-next, re-frame, or Vanilla JS). It works out of the box on popular cloud providers like Heroku.

While Chestnut it's quite "complete" in a sense, it also tries to be minimal. Boilerplate code is kept to a minimum, and there is only just enough structure to get you started. How you build and structure your app from there is up to you.

Chestnut should appeal to beginners because it allows you to get started quickly and with minimal baggage, it should appeal to more seasoned developers because it provides all the "obvious" configuration for a comfortable setup, without being so opinionated that it becomes a straight jacket.

For deployment you get uberjar support, meaning you can get all your code compiled, optimized, and packaged in a single executable JAR file. It also contains the necessary artifacts to work on Heroku out of the box.

Need help? Ask on the mailing list (issues on GitHub are for bugs. Feature requests can be done either on the mailing list or on Github.)

This README may describe unreleased features. Please compare the version number on Clojars to the changelog below, and check the README in your generated project for instructions pertaining to your version.

Usage

This README may describe unreleased features, instead you can check the README for the latest stable release

lein new chestnut <name> <options>

e.g.

lein new chestnut my-app +garden +reagent +http-kit

If you're using the snapshot version, then make sure to add a -- to separate Leiningen's and Chestnut's arguments

lein new chestnut my-app --snapshot -- +garden +reagent +http-kit

You can get an overview of all recognized options with

lein new chestnut +help

After that open the README of your generated project for detailed instructions.

Lighttable

Lighttable provides a tighter integration for live coding with an inline browser-tab. Rather than evaluating cljs on the command line with weasel repl, evaluate code and preview pages inside Lighttable.

Steps: After running (go), open a browser tab in Lighttable. Open a cljs file from within a project, go to the end of an s-expression and hit Cmd-ENT. Lighttable will ask you which client to connect. Click 'Connect a client' and select 'Browser'. Browse to http://localhost:10555

View LT's console to see a Chrome js console.

Hereafter, you can save a file and see changes or evaluate cljs code (without saving a file). Note that running a weasel server is not required to evaluate code in Lighttable.

Emacs/Cider

Start a repl in the context of your project with M-x cider-jack-in.

After that it's the regular

(go)
(cljs-repl)

as described above.

List of Contents

This template gives you everything you need to start developing Clojure/ClojureScript apps effectively. It comes with

  • Figwheel Automatically reload your ClojureScript and CSS as soon as you save the file, no need for browser refresh.
  • A ClojureScript interface to Facebook's React. You can choose between Reagent (default), Om-next (+om-next), re-frame (+re-frame), Rum (+rum), or use +vanilla to do without a React wrapper.
  • Ring + Compojure. Clojure's de facto HTTP interface. Chestnut uses a Jetty or HttpKit server to serve the Clojurescript app. This way you already have an HTTP server running in case you want to add server-side functionality. Chestnut also inserts a Ring middleware to reload server-side Clojure files.
  • Heroku support. Chestnut apps have all the bits and pieces to be deployable to Heroku. Getting your app on the web is as simple as git push.
  • Unit tests for both Clojure and CLJS. Both specs and CLJS tests can be run in "auto" mode.

Options

General options:

  • +help Show an overview of all recognized options, then exit.
  • +no-poll Opt out of usage statistics poll.
  • +http-kit Use HTTP Kit instead of Jetty.
  • +bidi Use bidi instead of Compojure.
  • +site-middleware Use the ring.middleware.defaults.site-defaults middleware (session, CSRF), instead of ring.middleware.defaults.api-defaults (see ring.defaults documentation).
  • +code-of-conduct / +coc Add the contributor covenant Code of Conduct.
  • +edge Use the latest available version of all libraries/plugins. This includes alpha/beta versions, but does not include SNAPSHOT versions.
  • +bleeding-edge Like +edge, but also use SNAPSHOT versions when available.

Choice of UI library:

  • +vanilla Don't include Reagent, use this if you intend to use some other view library.
  • +om-next Use om.next, instead of Reagent.
  • +re-frame Use Reagent and re-frame.
  • +rum Use Rum instead of Reagent.

Choice of CSS style:

  • +less Use less for compiling Less CSS files.
  • +sass Use SASS for generating CSS.
  • +garden Use Garden for generating CSS.

Local copy

If you want to customize Chestnut, or try unreleased features, you can run directly from master like this:

git clone https://github.com/plexus/chestnut.git
cd chestnut
lein install

Note that master may be partially or wholly broken. I try to do extensive manual testing before releasing a new stable version, so if you don't like surprises then stick to the version on Clojars. Issue reports and pull requests are very welcome.

Requirements

  • Java 1.7 or later
  • Leiningen 2

FAQ

  • Q: How can I get the features in the SNAPSHOT version?
    A: Use leiningen's --snapshot flag, e.g. lein new chestnut my-project --snapshot
  • Q: I'm seeing warnings while compiling ClojureScript.
    A: There are a few known warnings, but they should not affect the functioning of your app.
  • Q: I changed the {:text "Hello Chestnut!"} portion and saved the file, but the changes don't show up.
    A: It's a feature. The app-state is defined with defonce, so your application state doesn't reset every time you save a file. If you do want to reset after every change, change (defonce app-state ..) to (def app-state ...).
  • Q: I just want to compile ClojureScript to fully optimized JavaScript, so I can use it in a static HTML site.
    A: Compile the "min" ClojureScript build, like this: lein cljsbuild once min, then look for resources/public/js/app.js.
  • Q: I gave my project a very generic name like cljs or clojure and now it's not working.
    A: This is due to namespace clashes. Try picking a more unique name. In particular avoid namespace prefixes used by Clojure, Clojurescript, or existing libraries.

Sources

I used the browser-connected-repl that's included with Austin as a starting point, then pulled in bits from cljs-liveedit-webapp until things worked. Figwheel's Flappy Bird Demo app also provided some ideas. The concept of refreshing Om when Figwheel reloads was taken from this blog post by Michiel Borkent.

For Heroku support I looked at Heroku's clojure-getting-started example app.

Other Templates

We hope Chestnut is great for you, but there are also many other templates that tackle similar tasks.. Each has a slightly different perspective, so it is worth taking a look at a few. Here is a comparison chart of many interesting Clojure/ClojureScript templates.

License

Copyright © 2014-2018 Arne Brasseur

Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.

chestnut's People

Contributors

adadoom3 avatar aew avatar arosequist avatar bsvingen avatar bzg avatar christoph-frick avatar ciniglio avatar deg avatar ducky427 avatar english avatar featheredtoast avatar gacelita avatar jackrusher avatar jaeschliman avatar jcdcodes avatar jcsims avatar joshuaoshickman avatar ku1ik avatar lambda-knight avatar mudphone avatar otann avatar peeja avatar plexus avatar ponkore avatar radicalzephyr avatar teur avatar timreinke avatar tmclane avatar vinai avatar willmruzek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

chestnut's Issues

Add unit tests

This is the main missing ingredient at the moment. It would be great if Chestnut came with an example unit test, both on the clojure and on the clojurescript side. The clojurescript tests should run each time figwheel reloads.

Fresh project not quite working

I'm trying out Chestnut and it almost works. I do everything as in the
README. When doing (run) I get

2014-10-11 13:36:29.451:INFO:oejs.Server:jetty-7.6.13.v20130916
2014-10-11 13:36:29.510:INFO:oejs.AbstractConnector:Started
[email protected]:10555
Starting figwheel.
Starting web server on port 10555 .

<Server org.eclipse.jetty.server.Server@3ee926bd>

kastanja.server=> Compiling ClojureScript.
Figwheel: Starting server at http://localhost:3449
Figwheel: Serving files from '(dev-resources|resources)/public'
Compiling "resources/public/js/app.js" from ("src/cljs" "env/dev/cljs")...
WARNING: Use of undeclared Var cljs.core.async/do-alts at line 62
file:/Users/shem/.m2/repository/org/clojure/core.async/0.1.278.0-76b25b-alpha/core.async-0.1.278.0-76b25b-alpha.jar!/cljs/core/async/impl/ioc_helpers.cljs
WARNING: Bad method signature in protocol implementation, impl/Handler
does not declare method called lock-id at line 214
file:/Users/shem/.m2/repository/org/clojure/core.async/0.1.278.0-76b25b-alpha/core.async-0.1.278.0-76b25b-alpha.jar!/cljs/core/async.cljs
WARNING: Use of undeclared Var cljs.core.async.impl.protocols/lock-id at
line 217
file:/Users/shem/.m2/repository/org/clojure/core.async/0.1.278.0-76b25b-alpha/core.async-0.1.278.0-76b25b-alpha.jar!/cljs/core/async.cljs
WARNING: Bad method signature in protocol implementation, impl/Handler
does not declare method called lock-id at line 214
resources/public/js/out/cljs/core/async.cljs
WARNING: Use of undeclared Var cljs.core.async.impl.protocols/lock-id at
line 217 resources/public/js/out/cljs/core/async.cljs
Successfully compiled "resources/public/js/app.js" in 15.358 seconds.

I then open the page in browser and try the manipulations. Changing CSS
takes place immediately, great! Also, doing swap! from the repl works.
But when I edit :text in app-state in core.cljs and save, I can see in the repl

Compiling "resources/public/js/app.js" from ("src/cljs" "env/dev/cljs")...
Successfully compiled "resources/public/js/app.js" in 0.083 seconds.
notifying browser that file changed: /js/out/kastanja/core.js

and in chrome's console I see

Figwheel: loaded these files client.cljs:53
("/js/out/kastanja/core.js")

But the view does not update. If I do reload in the browser, I see the
new version.

improve dev/prod configuration

I'd like to tweak the template so that main namespace does not depend on figwheel or weasel at all yet provide the same beautiful hassle-free dev experience. Would you be open to a PR that moves things around a bit to make this possible?

Separate status/compiler output from REPL?

[Probably similar to this issue]

I'm running from command-line. The compiler output and server status info is gumming up my REPL. Can I redirect this somehow, so my REPL interface can be relatively clean.

e.g. gummed up REPL:

cljs.user=> Compiling "resources/public/js/app.js" from ("src/cljs" "env/dev/cljs")...
WARNING: Use of undeclared Var nut.core/clear-background at line 60 src/cljs/nut/core.cljs
WARNING: Use of undeclared Var cljs.core.async/do-alts at line 62 file:/Users/clay/.m2/repository/org/clojure/core.async/0.1.278.0-76b25b-alpha/core.async-0.1.278.0-76b25b-alpha.jar!/cljs/core/async/impl/ioc_helpers.cljs
WARNING: Bad method signature in protocol implementation, impl/Handler does not declare method called lock-id at line 214 file:/Users/clay/.m2/repository/org/clojure/core.async/0.1.278.0-76b25b-alpha/core.async-0.1.278.0-76b25b-alpha.jar!/cljs/core/async.cljs
WARNING: Use of undeclared Var cljs.core.async.impl.protocols/lock-id at line 217 file:/Users/clay/.m2/repository/org/clojure/core.async/0.1.278.0-76b25b-alpha/core.async-0.1.278.0-76b25b-alpha.jar!/cljs/core/async.cljs
Successfully compiled "resources/public/js/app.js" in 5.311 seconds.

Refreshing server's template

Hi,
I've noticed that when I change the index.html I have to also make some change to the server.clj file in order for the server to serve the new version of the html file. Normally I add a whitespace and save the file.
Is there a better way to do it?

Unable to resolve symbol `run`...

Following the README here...

$ lein new chestnut chest
Generating fresh 'lein new' chestnut project.
$ cd chest
$ lein repl
#<CompilerException java.lang.IllegalAccessError: in-seconds does not exist, compiling:(ring/middleware/cookies.clj:1:1)>
nREPL server started on port 60272 on host 127.0.0.1 - nrepl://127.0.0.1:60272
REPL-y 0.3.5, nREPL 0.2.6
Clojure 1.6.0
Java HotSpot(TM) 64-Bit Server VM 1.7.0_65-b17
    Docs: (doc function-name-here)
        (find-doc "part-of-name-here")
    Source: (source function-name-here)
    Javadoc: (javadoc java-object-or-class-here)
    Exit: Control+D or (exit) or (quit)
          Results: Stored in vars *1, *2, *3, an exception in *e

chest.server=> (run)

CompilerException java.lang.RuntimeException: Unable to resolve symbol: run in this context, compiling:(/private/var/folders/v2/yxn9b9h93lzgjsz645mblbt80000gt/T/form-init6922594209638647883.clj:1:1)
chest.server=>

Less is broken on heroku with chestnut master

       Retrieving compojure/compojure/1.3.1/compojure-1.3.1.jar from clojars
       Retrieving ring/ring-anti-forgery/1.0.0/ring-anti-forgery-1.0.0.jar from clojars
       Retrieving clout/clout/2.1.0/clout-2.1.0.jar from clojars
       Retrieving medley/medley/0.5.3/medley-0.5.3.jar from clojars
       Retrieving com/facebook/react/0.12.2.1/react-0.12.2.1.jar from clojars
       Retrieving om/om/0.8.0-beta5/om-0.8.0-beta5.jar from clojars
       Retrieving sablono/sablono/0.2.22/sablono-0.2.22.jar from clojars
       Retrieving prismatic/om-tools/0.3.9/om-tools-0.3.9.jar from clojars
       Retrieving prismatic/plumbing/0.3.5/plumbing-0.3.5.jar from clojars
       Retrieving prismatic/schema/0.3.1/schema-0.3.1.jar from clojars
       Retrieving weasel/weasel/0.4.2/weasel-0.4.2.jar from clojars
       Compiling project.dev
       Compiling project.server
       java.lang.IllegalAccessError: start-less does not exist, compiling:(server.clj:1:1)
        at clojure.lang.Compiler$InvokeExpr.eval(Compiler.java:3558)
        at clojure.lang.Compiler.compile1(Compiler.java:7226)
        at clojure.lang.Compiler.compile1(Compiler.java:7216)
        at clojure.lang.Compiler.compile(Compiler.java:7292)
        at clojure.lang.RT.compile(RT.java:398)
        at clojure.lang.RT.load(RT.java:438)
        at clojure.lang.RT.load(RT.java:411)
        at clojure.core$load$fn__5066.invoke(core.clj:5641)
        at clojure.core$load.doInvoke(core.clj:5640)
        at clojure.lang.RestFn.invoke(RestFn.java:408)   
        at clojure.core$load_one.invoke(core.clj:5446)   
        at clojure.core$compile$fn__5071.invoke(core.clj:5652)
        at clojure.core$compile.invoke(core.clj:5651)
        at user$eval9$fn__16.invoke(form-init8647967921244594969.clj:1)
        at user$eval9.invoke(form-init8647967921244594969.clj:1)
        at clojure.lang.Compiler.eval(Compiler.java:6703)
        at clojure.lang.Compiler.eval(Compiler.java:6693)
        at clojure.lang.Compiler.load(Compiler.java:7130)
        at clojure.lang.Compiler.loadFile(Compiler.java:7086)
        at clojure.main$load_script.invoke(main.clj:274) 
        at clojure.main$init_opt.invoke(main.clj:279)
        at clojure.main$initialize.invoke(main.clj:307)  
        at clojure.main$null_opt.invoke(main.clj:342)
        at clojure.main$main.doInvoke(main.clj:420)
        at clojure.lang.RestFn.invoke(RestFn.java:421)   
        at clojure.lang.Var.invoke(Var.java:383)
        at clojure.lang.AFn.applyToHelper(AFn.java:156)  
        at clojure.lang.Var.applyTo(Var.java:700)
        at clojure.main.main(main.java:37)
       Caused by: java.lang.IllegalAccessError: start-less does not exist
        at clojure.core$refer.doInvoke(core.clj:3919)
        at clojure.lang.RestFn.applyTo(RestFn.java:139)  
        at clojure.core$apply.invoke(core.clj:626)
        at clojure.core$load_lib.doInvoke(core.clj:5505) 
        at clojure.lang.RestFn.applyTo(RestFn.java:142)  
        at clojure.core$apply.invoke(core.clj:626)
        at clojure.core$load_libs.doInvoke(core.clj:5524)
        at clojure.lang.RestFn.applyTo(RestFn.java:137)  
        at clojure.core$apply.invoke(core.clj:626)
        at clojure.core$require.doInvoke(core.clj:5607)
        at clojure.lang.RestFn.invoke(RestFn.java:805)
        at otherworldimports.server$loading__4958__auto__.invoke(server.clj:1)
        at clojure.lang.AFn.applyToHelper(AFn.java:152)
        at clojure.lang.AFn.applyTo(AFn.java:144)
        at clojure.lang.Compiler$InvokeExpr.eval(Compiler.java:3553)
        ... 28 more
       Exception in thread "main" java.lang.IllegalAccessError: start-less does not exist, compiling:(server.clj:1:1)
        at clojure.lang.Compiler$InvokeExpr.eval(Compiler.java:3558)
        at clojure.lang.Compiler.compile1(Compiler.java:7226)
        at clojure.lang.Compiler.compile1(Compiler.java:7216)
        at clojure.lang.Compiler.compile(Compiler.java:7292)
        at clojure.lang.RT.compile(RT.java:398)
        at clojure.lang.RT.load(RT.java:438)
        at clojure.lang.RT.load(RT.java:411)
        at clojure.core$load$fn__5066.invoke(core.clj:5641)
        at clojure.core$load.doInvoke(core.clj:5640)
        at clojure.lang.RestFn.invoke(RestFn.java:408)
        at clojure.core$load_one.invoke(core.clj:5446)
        at clojure.core$compile$fn__5071.invoke(core.clj:5652)
        at clojure.core$compile.invoke(core.clj:5651)
        at user$eval9$fn__16.invoke(form-init8647967921244594969.clj:1)
        at user$eval9.invoke(form-init8647967921244594969.clj:1)
        at clojure.lang.Compiler.eval(Compiler.java:6703)
        at clojure.lang.Compiler.eval(Compiler.java:6693)
        at clojure.lang.Compiler.load(Compiler.java:7130)
        at clojure.lang.Compiler.loadFile(Compiler.java:7086)
        at clojure.main$load_script.invoke(main.clj:274) 
        at clojure.main$init_opt.invoke(main.clj:279)
        at clojure.main$initialize.invoke(main.clj:307)  
        at clojure.main$null_opt.invoke(main.clj:342)
        at clojure.main$main.doInvoke(main.clj:420)
        at clojure.lang.RestFn.invoke(RestFn.java:421)   
        at clojure.lang.Var.invoke(Var.java:383)
        at clojure.lang.AFn.applyToHelper(AFn.java:156)  
        at clojure.lang.Var.applyTo(Var.java:700)
        at clojure.main.main(main.java:37)
       Caused by: java.lang.IllegalAccessError: start-less does not exist
        at clojure.core$refer.doInvoke(core.clj:3919)
        at clojure.lang.RestFn.applyTo(RestFn.java:139)  
        at clojure.core$apply.invoke(core.clj:626)
        at clojure.core$load_lib.doInvoke(core.clj:5505) 
        at clojure.lang.RestFn.applyTo(RestFn.java:142)  
        at clojure.core$apply.invoke(core.clj:626)
        at clojure.core$load_libs.doInvoke(core.clj:5524)
        at clojure.lang.RestFn.applyTo(RestFn.java:137)  
        at clojure.core$apply.invoke(core.clj:626)
        at clojure.core$require.doInvoke(core.clj:5607)  
        at clojure.lang.RestFn.invoke(RestFn.java:805)   
        at otherworldimports.server$loading__4958__auto__.invoke(server.clj:1)
        at clojure.lang.AFn.applyToHelper(AFn.java:152)  
        at clojure.lang.AFn.applyTo(AFn.java:144)
        at clojure.lang.Compiler$InvokeExpr.eval(Compiler.java:3553)
        ... 28 more
       Compilation failed: Subprocess failed
 !     Failed to build.

 !     Push rejected, failed to compile Clojure (Leiningen 2) app

Refactor dev only dependencies to be part of the dev profile

I might be missing something, but could we not move all the development related stuff into the env/ folder and then add that to the :source-paths of the :dev profile, with the intention of getting rid of non-essential dependencies from the main profile? Would this break something?

Add option for --cljx

It's a bit more involved than the other options currently provided, but it would certainly make the life of those wishing to use this with cljx a lot easier.

Evaluating cljs in Lighttable before Weasel

After running (run) and (browser-repl), I cannot evaluate cljs code from Lighttable's (remote nRepl) connection using localhost:9001 (Weasel). I could type things out on the weasel repl, but I would rather use my editor. In other words, what are some workflows to build an entire page, live, from other editors like sublime or emacs?

Prior to Chestnut, my live coding in LT involved adding a connection to an external browser and dropping a line of js with websockets info.

Random?

This is kind of random. I ran through the simple steps
$ lein new chestnut prj
$ cd prj
$ lein repl
nREPL server started on port 45354 on host 127.0.0.1 - nrepl://127.0.0.1:45354
REPL-y 0.3.5, nREPL 0.2.6
Clojure 1.6.0
Java HotSpot(TM) 64-Bit Server VM 1.8.0_25-b17
=> (run)
=> (browser-repl)
(open page on browser)

Then at repl type,
cljs.user=> app-state
"Error evaluating:" app-state :as ""

<SyntaxError: Unexpected token .>

SyntaxError: Unexpected token .
at http://localhost:10555/js/out/weasel/repl.js:21:744
at http://localhost:10555/js/out/weasel/repl.js:28:4
at cljs.core.MultiFn.call.G__16220__2 (http://localhost:10555/js/out/cljs/core.js:21148:18)
at cljs.core.MultiFn.call.G__16220 as call
at null. (http://localhost:10555/js/out/weasel/repl.js:109:422)
at goog.events.EventTarget.fireListeners (http://localhost:10555/js/out/goog/events/eventtarget.js:285:23)
at Function.goog.events.EventTarget.dispatchEventInternal_ (http://localhost:10555/js/out/goog/events/eventtarget.js:382:26)
at goog.events.EventTarget.dispatchEvent (http://localhost:10555/js/out/goog/events/eventtarget.js:197:34)
at goog.net.WebSocket.onMessage_ (http://localhost:10555/js/out/goog/net/websocket.js:411:8)
nil
cljs.user=>

ArityException when starting with "-- --http-kit --om-tools" options

This could be an error in my config somewhere as this seemed to be working earlier in the day but starting a new project with the --http-kit and --om-tools options throws an error:

➜  clojurescript  lein new chestnut foo -- --http-kit --om-tools
clojure.lang.ArityException: Wrong number of args (3) passed to: chestnut/chestnut
 at clojure.lang.AFn.throwArity (AFn.java:429)
    clojure.lang.AFn.invoke (AFn.java:40)
    clojure.lang.Var.invoke (Var.java:388)
    clojure.lang.AFn.applyToHelper (AFn.java:160)
    clojure.lang.Var.applyTo (Var.java:700)
    clojure.core$apply.invoke (core.clj:626)
    leiningen.new$create.doInvoke (new.clj:73)
    clojure.lang.RestFn.applyTo (RestFn.java:142)
    clojure.core$apply.invoke (core.clj:628)
    leiningen.new$new.doInvoke (new.clj:189)
    clojure.lang.RestFn.invoke (RestFn.java:516)
    clojure.lang.Var.invoke (Var.java:409)
    clojure.lang.AFn.applyToHelper (AFn.java:178)
    clojure.lang.Var.applyTo (Var.java:700)
    clojure.core$apply.invoke (core.clj:626)
    leiningen.core.main$partial_task$fn__6071.doInvoke (main.clj:253)
    clojure.lang.RestFn.applyTo (RestFn.java:139)
    clojure.lang.AFunction$1.doInvoke (AFunction.java:29)
    clojure.lang.RestFn.applyTo (RestFn.java:137)
    clojure.core$apply.invoke (core.clj:626)
    leiningen.core.main$apply_task.invoke (main.clj:303)
    leiningen.core.main$resolve_and_apply.invoke (main.clj:309)
    leiningen.core.main$_main$fn__6136.invoke (main.clj:377)
    leiningen.core.main$_main.doInvoke (main.clj:366)
    clojure.lang.RestFn.invoke (RestFn.java:512)
    clojure.lang.Var.invoke (Var.java:409)
    clojure.lang.AFn.applyToHelper (AFn.java:178)
    clojure.lang.Var.applyTo (Var.java:700)
    clojure.core$apply.invoke (core.clj:624)
    clojure.main$main_opt.invoke (main.clj:315)
    clojure.main$main.doInvoke (main.clj:420)
    clojure.lang.RestFn.invoke (RestFn.java:619)
    clojure.lang.Var.invoke (Var.java:430)
    clojure.lang.AFn.applyToHelper (AFn.java:195)
    clojure.lang.Var.applyTo (Var.java:700)
    clojure.main.main (main.java:37)

Unknown error when saving files from cider

Saving file /home/stephen/work/pantry/src/cljs/pantry/core.cljs...
Wrote /home/stephen/work/pantry/src/cljs/pantry/core.cljs
error in process filter: nrepl--dispatch-response: No response handler with id nil found
error in process filter: No response handler with id nil found
error in process filter: nrepl--dispatch-response: No response handler with id nil found
error in process filter: No response handler with id nil found
error in process filter: nrepl--dispatch-response: No response handler with id nil found
error in process filter: No response handler with id nil found

Start up emacs
'M-x cider-jack-in'
Modify and Save core.cljs

Does not seem to cause anything. I can C-x e to execute code directly in the browser (through weasel). As well as simply save a file to cause figwheel to reload the cljs. Just a message that shows up every time I save, not sure if it has any significance.

cljs macro issue

I'm not sure who to turn to with this problem.

When trying to compile (lein cljsbuild once) this branch:

https://github.com/improper/clojexcms/tree/schema-demo

I get

Caused by: clojure.lang.ExceptionInfo: java.lang.ExceptionInInitializerError, compiling:(schema/macros.clj:1:1) at line 1 file:/Users/improper/.m2/repository/prismatic/schema/0.3.1/schema-0.3.1.jar!/schema/core.cljs {:tag :cljs/analysis-error, :file "file:/Users/improper/.m2/repository/prismatic/schema/0.3.1/schema-0.3.1.jar!/schema/core.cljs", :line 1, :column 1}

The error occurred after depending on om-bootstrap, which depends on schema 0.3.1. Using schema 0.3.3 directly yields the same error after requiring the macros.

cljsbuild runs fine when removing the dependency on leiningen (project.clj line 53) – of course this breaks the figwheel startup.

I tried to construct a minimal example to reproduce this incompatibility but to no avail, something in the chestnut template seems to trigger it.
#69 might solve this, but anyhow: WTF? Any help appreciated.

Enable enlive auto-reload in dev profile

Loving this project so far, it makes getting started with clojurescript easier for a newbie like myself. One thing I thought that was unintuitive (when doing the om-tutorials) is that the default deftemplate is being cached --

What about using Enlive's auto-reload (net.cgrand.reload/auto-reload *ns*) in a dev profile?

Unsupported major.minor version 51.0 (cemerick.piggieback)

newbie in trouble with the Clojars version:

08:59 $ lein repl
#<CompilerException java.lang.UnsupportedClassVersionError: com/google/javascript/jscomp/CompilerOptions : Unsupported major.minor version 51.0, compiling:(cljs/closure.clj:1:1)>
Error loading cemerick.piggieback: java.lang.UnsupportedClassVersionError: com/google/javascript/jscomp/CompilerOptions : Unsupported major.minor version 51.0, compiling:(cljs/closure.clj:1:1)
Exception in thread "main" java.lang.RuntimeException: Unable to resolve var: cemerick.piggieback/wrap-cljs-repl in this context, compiling:(/private/var/folders/df/jgv5hvpn5w50tydfg8249qlc0000gp/T/form-init3709648666698359861.clj:1:5662)

I'm using Leiningen 2.5.0 on Java 1.6.0_65 Java HotSpot(TM) 64-Bit Server VM on OSX 10.9.5.

Support different hostname for websocket connection?

I need to do development on ssl for what I'm working on (browser permissions, etc.), so I have nginx serving a self-signed cert downstream from the chestnut process. That works fine, except that the websocket connection isn't happening over ssl (and is pointed at localhost anyway). Any way I can override this with env vars, or some dynamic var before starting (run)?

adding libs

Hi,
I'm trying to finish my clojurecup project so I'm asking while looking for an awser.
I added libs in my project.clj but compilation won't add any files in out directory.
I deleted the resources/public/out directory and it's never recreated.
I tried lein cljsbuild once and lein figwheel.

What am I missing ?

Dropped back to cljs.user when using chestnut through CIDER

I connect to chestnut through cider by using 'cider-connect localhost NREPL-PORT-NUMBER.

However, whenever I make an error, it switches me from my current namespace to cljs.user. This is kind of annoying as it means I have to remember to switch back every time. Example:

pantry.products-list> (breakup (vec (range 103)) 7 2)
[[0 1 2 3 4 5 6 7 8 9 10 11 12 13] [14 15 16 17 18 19 20 21 22 23 24 25 26 27] [28 29 30 31 32 33 34 35 36 37 38 39 40 41] [42 43 44 45 46 47 48 49 50 51 52 53 54 55] [56 57 58 59 60 61 62 63 64 65 66 67 68 69] [70 71 72 73 74 75 76 77 78 79 80 81 82 83] [84 85 86 87 88 89 90 91 92 93 94 95 96 97] [98 99 100 101 102]]
cljs.user> (this-fx-does-not-exist (vec (range 103)) 7 2)
"Error evaluating:" (this-fx-does-not-exist (vec (range 103)) 7 2) :as ".this_fx_does_not_exist.call(null,cljs.core.vec.call(null,cljs.core.range.call(null,(103))),(7),(2));\n"
#<SyntaxError: Unexpected token .>
SyntaxError: Unexpected token .
    at http://localhost:8070/js/out/weasel/repl.js:21:744
    at http://localhost:8070/js/out/weasel/repl.js:28:4
    at cljs.core.MultiFn.call.G__26068__2 (http://localhost:8070/js/out/cljs/core.js:21148:18)
    at cljs.core.MultiFn.call.G__26068 [as call] (http://localhost:8070/js/out/cljs/core.js:21293:20)
    at null.<anonymous> (http://localhost:8070/js/out/weasel/repl.js:109:422)
    at goog.events.EventTarget.fireListeners (http://localhost:8070/js/out/goog/events/eventtarget.js:285:23)
    at Function.goog.events.EventTarget.dispatchEventInternal_ (http://localhost:8070/js/out/goog/events/eventtarget.js:382:26)
    at goog.events.EventTarget.dispatchEvent (http://localhost:8070/js/out/goog/events/eventtarget.js:197:34)
    at goog.net.WebSocket.onMessage_ (http://localhost:8070/js/out/goog/net/websocket.js:411:8)
nil
cljs.user>

Has anyone figure out how to keep this from happening?

Can't set up a workflow to test cljx with speclj

How can I set up a workflow that will test my cljx files in the testrunner?

Hiya

Thanks for making this template, I'm new to clojure, clojurescript, web programming and this has been hugely helpful for gettting me going :)

I have generated a project with chestnut to include speclj testing and cljx:

lein new chestnut testproject --snapshot -- --cljx --speclj

What I am having some trouble with is running tests on any of my CLJX test. I can run tests fine with:

lein spec

However this does not rebuild any changes to any of my cljx files. I can solve that with:

lein do cljx, spec

Great! What I really want is for the tests to run constantly without the need ro reload the JVM. I can do that fine with:

lein spec -a

But it doesn't pick up and cljx changes and:

lein do cljx, spec -a

Doesn't work as it will only transform the cljx file once. Any help greatfully received :)

Apologies in advance if I'm missing something really obvious

Snapshot build with om-tools generates error

I'm using this command line to set up a project:

lein new chestnut my-app --snapshot -- --om-tools

Issuing (run) in lein repl gives the following error. Not using --snapshot works fine.

Compiling "resources/public/js/app.js" failed.
clojure.lang.ExceptionInfo: java.lang.ExceptionInInitializerError, compiling:(schema/core.clj:1:1) at line 1
core.clj:4403 clojure.core/ex-info
analyzer.clj:287 cljs.analyzer/error
analyzer.clj:1489 cljs.analyzer/analyze-seq
analyzer.clj:1580 cljs.analyzer/analyze[fn]
analyzer.clj:1573 cljs.analyzer/analyze
analyzer.clj:1642 cljs.analyzer/parse-ns[fn]
analyzer.clj:1642 cljs.analyzer/parse-ns[fn]
analyzer.clj:1637 cljs.analyzer/parse-ns
analyzer.clj:1632 cljs.analyzer/parse-ns
compiler.clj:1005 cljs.compiler/compile-root
closure.clj:343 cljs.closure/compile-dir
closure.clj:383 cljs.closure/eval3071[fn]
closure.clj:293 cljs.closure/eval3006[fn]
closure.clj:397 cljs.closure/eval3058[fn]
closure.clj:293 cljs.closure/eval3006[fn]
compiler.clj:44 cljsbuild.compiler.SourcePaths/fn
core.clj:2559 clojure.core/map[fn]
LazySeq.java:40 clojure.lang.LazySeq.sval
LazySeq.java:49 clojure.lang.LazySeq.seq
RT.java:484 clojure.lang.RT.seq
core.clj:133 clojure.core/seq
core.clj:624 clojure.core/apply
core.clj:2586 clojure.core/mapcat
RestFn.java:423 clojure.lang.RestFn.invoke
compiler.clj:44 cljsbuild.compiler/cljsbuild.compiler.SourcePaths
closure.clj:962 cljs.closure/build
closure.clj:928 cljs.closure/build
compiler.clj:58 cljsbuild.compiler/compile-cljs[fn]
compiler.clj:57 cljsbuild.compiler/compile-cljs
compiler.clj:159 cljsbuild.compiler/run-compiler
form-init4413254595112067552.clj:1 user/eval12342[fn]
form-init4413254595112067552.clj:1 user/eval12342[fn]
form-init4413254595112067552.clj:1 user/eval12342
Compiler.java:6703 clojure.lang.Compiler.eval
Compiler.java:6693 clojure.lang.Compiler.eval
Compiler.java:7130 clojure.lang.Compiler.load
Compiler.java:7086 clojure.lang.Compiler.loadFile
main.clj:274 clojure.main/load-script
main.clj:279 clojure.main/init-opt
main.clj:307 clojure.main/initialize
main.clj:342 clojure.main/null-opt
main.clj:420 clojure.main/main
RestFn.java:421 clojure.lang.RestFn.invoke
Var.java:383 clojure.lang.Var.invoke
AFn.java:156 clojure.lang.AFn.applyToHelper
Var.java:700 clojure.lang.Var.applyTo
main.java:37 clojure.main.main
Caused by: clojure.lang.Compiler$CompilerException: java.lang.ExceptionInInitializerError, compiling:(schema/core.clj:1:1)
Compiler.java:7142 clojure.lang.Compiler.load
RT.java:370 clojure.lang.RT.loadResourceScript
RT.java:361 clojure.lang.RT.loadResourceScript
RT.java:440 clojure.lang.RT.load
RT.java:411 clojure.lang.RT.load
core.clj:5641 clojure.core/load[fn]
core.clj:5640 clojure.core/load
RestFn.java:408 clojure.lang.RestFn.invoke
core.clj:5446 clojure.core/load-one
core.clj:5486 clojure.core/load-lib[fn]
core.clj:5485 clojure.core/load-lib
RestFn.java:142 clojure.lang.RestFn.applyTo
core.clj:626 clojure.core/apply
core.clj:5524 clojure.core/load-libs
RestFn.java:137 clojure.lang.RestFn.applyTo
core.clj:626 clojure.core/apply
core.clj:5607 clojure.core/require
RestFn.java:436 clojure.lang.RestFn.invoke
schema.clj:1 plumbing.fnk.schema/eval13577[fn]
schema.clj:1 plumbing.fnk.schema/eval13577
Compiler.java:6703 clojure.lang.Compiler.eval
Compiler.java:6692 clojure.lang.Compiler.eval
Compiler.java:7130 clojure.lang.Compiler.load
RT.java:370 clojure.lang.RT.loadResourceScript
RT.java:361 clojure.lang.RT.loadResourceScript
RT.java:440 clojure.lang.RT.load
RT.java:411 clojure.lang.RT.load
core.clj:5641 clojure.core/load[fn]
core.clj:5640 clojure.core/load
RestFn.java:408 clojure.lang.RestFn.invoke
core.clj:5446 clojure.core/load-one
core.clj:5486 clojure.core/load-lib[fn]
core.clj:5485 clojure.core/load-lib
RestFn.java:142 clojure.lang.RestFn.applyTo
core.clj:626 clojure.core/apply
core.clj:5524 clojure.core/load-libs
RestFn.java:137 clojure.lang.RestFn.applyTo
core.clj:626 clojure.core/apply
core.clj:5607 clojure.core/require
RestFn.java:512 clojure.lang.RestFn.invoke
core.clj:1 om-tools.core/eval13545[fn]
core.clj:1 om-tools.core/eval13545
Compiler.java:6703 clojure.lang.Compiler.eval
Compiler.java:6692 clojure.lang.Compiler.eval
Compiler.java:7130 clojure.lang.Compiler.load
RT.java:370 clojure.lang.RT.loadResourceScript
RT.java:361 clojure.lang.RT.loadResourceScript
RT.java:440 clojure.lang.RT.load
RT.java:411 clojure.lang.RT.load
core.clj:5641 clojure.core/load[fn]
core.clj:5640 clojure.core/load
RestFn.java:408 clojure.lang.RestFn.invoke
core.clj:5446 clojure.core/load-one
core.clj:5486 clojure.core/load-lib[fn]
core.clj:5485 clojure.core/load-lib
RestFn.java:142 clojure.lang.RestFn.applyTo
core.clj:626 clojure.core/apply
core.clj:5524 clojure.core/load-libs
RestFn.java:137 clojure.lang.RestFn.applyTo
core.clj:626 clojure.core/apply
core.clj:5607 clojure.core/require
RestFn.java:408 clojure.lang.RestFn.invoke
analyzer.clj:1198 cljs.analyzer/eval1524[fn]
MultiFn.java:249 clojure.lang.MultiFn.invoke
analyzer.clj:1491 cljs.analyzer/analyze-seq
Caused by: java.lang.ExceptionInInitializerError:
(Unknown Source) java.lang.Class.forName0
Class.java:344 java.lang.Class.forName
RT.java:2093 clojure.lang.RT.loadClassForName
RT.java:430 clojure.lang.RT.load
RT.java:411 clojure.lang.RT.load
core.clj:5641 clojure.core/load[fn]
core.clj:5640 clojure.core/load
RestFn.java:408 clojure.lang.RestFn.invoke
core.clj:5446 clojure.core/load-one
core.clj:5486 clojure.core/load-lib[fn]
core.clj:5485 clojure.core/load-lib
RestFn.java:142 clojure.lang.RestFn.applyTo
core.clj:626 clojure.core/apply
core.clj:5524 clojure.core/load-libs
RestFn.java:137 clojure.lang.RestFn.applyTo
core.clj:626 clojure.core/apply
core.clj:5607 clojure.core/require
RestFn.java:408 clojure.lang.RestFn.invoke
walk.clj:1 riddley.walk/loading
(Unknown Source) riddley.walk__init.load
(Unknown Source) riddley.walk__init.
(Unknown Source) java.lang.Class.forName0
Class.java:344 java.lang.Class.forName
RT.java:2093 clojure.lang.RT.loadClassForName
RT.java:430 clojure.lang.RT.load
RT.java:411 clojure.lang.RT.load
core.clj:5641 clojure.core/load[fn]
core.clj:5640 clojure.core/load
RestFn.java:408 clojure.lang.RestFn.invoke
core.clj:5446 clojure.core/load-one
core.clj:5486 clojure.core/load-lib[fn]
core.clj:5485 clojure.core/load-lib
RestFn.java:142 clojure.lang.RestFn.applyTo
core.clj:626 clojure.core/apply
core.clj:5524 clojure.core/load-libs
RestFn.java:137 clojure.lang.RestFn.applyTo
core.clj:626 clojure.core/apply
core.clj:5607 clojure.core/require
RestFn.java:421 clojure.lang.RestFn.invoke
macros.clj:1 potemkin.macros/loading
(Unknown Source) potemkin.macros__init.load
(Unknown Source) potemkin.macros__init.
(Unknown Source) java.lang.Class.forName0
Class.java:344 java.lang.Class.forName
RT.java:2093 clojure.lang.RT.loadClassForName
RT.java:430 clojure.lang.RT.load
RT.java:411 clojure.lang.RT.load
core.clj:5641 clojure.core/load[fn]
core.clj:5640 clojure.core/load
RestFn.java:408 clojure.lang.RestFn.invoke
core.clj:5446 clojure.core/load-one
core.clj:5486 clojure.core/load-lib[fn]
core.clj:5485 clojure.core/load-lib
RestFn.java:142 clojure.lang.RestFn.applyTo
core.clj:626 clojure.core/apply
core.clj:5524 clojure.core/load-libs
RestFn.java:137 clojure.lang.RestFn.applyTo
core.clj:628 clojure.core/apply
core.clj:5618 clojure.core/use
RestFn.java:421 clojure.lang.RestFn.invoke
types.clj:1 potemkin.types/loading
(Unknown Source) potemkin.types__init.load
(Unknown Source) potemkin.types__init.
(Unknown Source) java.lang.Class.forName0
Class.java:344 java.lang.Class.forName
RT.java:2093 clojure.lang.RT.loadClassForName
RT.java:430 clojure.lang.RT.load
RT.java:411 clojure.lang.RT.load
core.clj:5641 clojure.core/load[fn]
core.clj:5640 clojure.core/load
RestFn.java:408 clojure.lang.RestFn.invoke
core.clj:5446 clojure.core/load-one
core.clj:5486 clojure.core/load-lib[fn]
core.clj:5485 clojure.core/load-lib
RestFn.java:142 clojure.lang.RestFn.applyTo
core.clj:626 clojure.core/apply
core.clj:5528 clojure.core/load-libs
RestFn.java:137 clojure.lang.RestFn.applyTo
core.clj:626 clojure.core/apply
core.clj:5607 clojure.core/require
RestFn.java:408 clojure.lang.RestFn.invoke
potemkin.clj:1 potemkin/loading
(Unknown Source) potemkin__init.load
(Unknown Source) potemkin__init.
(Unknown Source) java.lang.Class.forName0
Class.java:344 java.lang.Class.forName
RT.java:2093 clojure.lang.RT.loadClassForName
RT.java:430 clojure.lang.RT.load
RT.java:411 clojure.lang.RT.load
core.clj:5641 clojure.core/load[fn]
core.clj:5640 clojure.core/load
RestFn.java:408 clojure.lang.RestFn.invoke
core.clj:5446 clojure.core/load-one
core.clj:5486 clojure.core/load-lib[fn]
core.clj:5485 clojure.core/load-lib
RestFn.java:142 clojure.lang.RestFn.applyTo
core.clj:626 clojure.core/apply
core.clj:5524 clojure.core/load-libs
RestFn.java:137 clojure.lang.RestFn.applyTo
core.clj:626 clojure.core/apply
core.clj:5607 clojure.core/require
RestFn.java:457 clojure.lang.RestFn.invoke
core.clj:1 schema.core/eval13583[fn]
core.clj:1 schema.core/eval13583
Compiler.java:6703 clojure.lang.Compiler.eval
Compiler.java:6692 clojure.lang.Compiler.eval
Compiler.java:7130 clojure.lang.Compiler.load
Caused by: java.lang.ClassNotFoundException: riddley.Util
URLClassLoader.java:372 java.net.URLClassLoader$1.run
URLClassLoader.java:361 java.net.URLClassLoader$1.run
(Unknown Source) java.security.AccessController.doPrivileged
URLClassLoader.java:360 java.net.URLClassLoader.findClass
ClassLoader.java:424 java.lang.ClassLoader.loadClass
Launcher.java:308 sun.misc.Launcher$AppClassLoader.loadClass
ClassLoader.java:357 java.lang.ClassLoader.loadClass
(Unknown Source) java.lang.Class.forName0
Class.java:260 java.lang.Class.forName
compiler.clj:1 riddley.compiler/loading
(Unknown Source) riddley.compiler__init.load
(Unknown Source) riddley.compiler__init.

template options

Hello,
Is this the correct usage for options ?
lein new chestnut retalk --http-kit --om-tools

if yes, I don't have any of the options activated

cljs with speclj

I installed the new template and ran lein spec but it only tests my clj files.
how do i get my cljs files running in spec / spec -a ?

thanks

IllegalStateException running (browser-repl) command

Hi!
Thanks for sharing your project - having a om setup with figwheel is a great productivity boost.

Apologies if there's an obvious solution to this problem but executing (browser-repl) on my machine produces an "IllegalStateException" on my machine. Here's the relevant info: (note: I'm running Java 1.8)

➜  foo  lein cljsbuild once
Compiling ClojureScript.
Compiling "resources/public/app.js" from ["src/cljs"]...
WARNING: Use of undeclared Var cljs.core.async/do-alts at line 62 file:/Users/zand/.m2/repository/org/clojure/core.async/0.1.278.0-76b25b-alpha/core.async-0.1.278.0-76b25b-alpha.jar!/cljs/core/async/impl/ioc_helpers.cljs
WARNING: Bad method signature in protocol implementation impl/Handler lock-id at line 214 file:/Users/zand/.m2/repository/org/clojure/core.async/0.1.278.0-76b25b-alpha/core.async-0.1.278.0-76b25b-alpha.jar!/cljs/core/async.cljs
WARNING: Use of undeclared Var cljs.core.async.impl.protocols/lock-id at line 217 file:/Users/zand/.m2/repository/org/clojure/core.async/0.1.278.0-76b25b-alpha/core.async-0.1.278.0-76b25b-alpha.jar!/cljs/core/async.cljs
WARNING: Bad method signature in protocol implementation impl/Handler lock-id at line 214 resources/public/out/cljs/core/async.cljs
WARNING: Use of undeclared Var cljs.core.async.impl.protocols/lock-id at line 217 resources/public/out/cljs/core/async.cljs
Successfully compiled "resources/public/app.js" in 11.749 seconds.
➜  foo  lein repl          
nREPL server started on port 54331 on host 127.0.0.1 - nrepl://127.0.0.1:54331
REPL-y 0.3.5, nREPL 0.2.6
Clojure 1.6.0
Java HotSpot(TM) 64-Bit Server VM 1.8.0_20-b26
    Docs: (doc function-name-here)
          (find-doc "part-of-name-here")
  Source: (source function-name-here)
 Javadoc: (javadoc java-object-or-class-here)
    Exit: Control+D or (exit) or (quit)
 Results: Stored in vars *1, *2, *3, an exception in *e

foo.server=> (run)
2014-09-27 09:53:01.247:INFO:oejs.Server:jetty-7.6.13.v20130916
2014-09-27 09:53:01.274:INFO:oejs.AbstractConnector:Started [email protected]:10555
#<Server org.eclipse.jetty.server.Server@1eaca988>
foo.server=> (browser-repl)

IllegalStateException Can't change/establish root binding of: *cljs-repl-options* with set  clojure.lang.Var.set (Var.java:221)
foo.server=> 

foo.server=> exit
Bye for now!

Cannot change ns after doing `(browser-repl)`

Way to reproduce:

  • clone the repo
  • lein install
  • lein new chestnut foo --snapshot
  • cd foo
  • lein repl
  • (run)
  • (browser-repl)
  • now you can see the error: ArityException Wrong number of args (2) passed to: repl/fn--5124/self--5130 clojure.lang.AFn.throwArity (AFn.java:429)
  • at this point the same error can be seen when doing: (in-ns 'foo.core)

Client side only release output?

How about a client-side-only profile/option for static release/publish to github pages, divshot.io, static website host X, etc?

[INFO] Roadmap - versions

cljs.repl is going through some breaking changes. We'll have to wait for Piggieback and Weasel to catch up before we can update ClojureScript beyong 0.0-2511.

On the other hand Chestnut 0.7.0 has been in the making for too long now. With Om 0.8.0 being released as we speak I'd like to focus on getting that out by pinning some versions.

0.7.0

  • Om 0.8.0
  • ClojureScript 0.0-2511
  • Piggieback 0.1.3
  • Weasel 0.4.2

0.8.0

  • ClojureScript >= 0.0-2665
  • Piggieback >= 0.1.5 (0.1.5-SNAPSHOT is already available with necessary fixes, but would prefer to include a "real" release) Related issue: nrepl/piggieback#38
  • Weasel > 0.4.2. Related issue: nrepl/weasel#37

WebSocket connection to 'ws://localhost:9001/' failed

Hi

When I create a new project by typing lein new chestnut <project-name>. Then start the repl with lein repl then (run). If I then browse to localhost:10555 I get the following message in the Chrome browser console:

lWebSocket connection to 'ws://localhost:9001/' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSEDl

Then I start to see Figwheel: client disconnected :going-away in the terminal every time I refresh the browser.

I wanted to try and eliminate interference from my ~/.lein/profiles.clj so it simply contains an empty map {}.

Any idea what's causing the error messages?

Bad method signature

Hey, whenever I run (browser-repl) I get this error:

vcbgame.server=> (browser-repl)
WARNING: Bad method signature in protocol implementation impl/Handler lock-id at line 214 file:/home/simon/.m2/repository/org/clojure/core.async/0.1.278.0-76b25b-alpha/core.async-0.1.278.0-76b25b-alpha.jar!/cljs/core/async.cljs
<< started Weasel server on ws://0.0.0.0:9001 >>
Type :cljs/quit to stop the ClojureScript REPL

Any ideas?

:preamble only respected with :advanced compilation?

It seems that when not using :advanced the files in :preamble are not actually prepended. (That's why they're added to the page with that inject-devmode-html function).
To avoid confusion we could move that into the :uberjar profile.

What do you think? (Am I mistaken?)

High memory consumption

I created the default project with lein new chestnut <xyz>, started the repl with lein repl followed by (run) and (browser-repl). Before doing this, I removed all of my plugins from ~/.lein/profiles.clj.

I am now left with 3 java processes. Together, these processes use almost 2GB of memory.

This is on OSX 10.10 and here is the repl session if it helps.

~/Code/front on master  $ lein repl
nREPL server started on port 53644 on host 127.0.0.1 - nrepl://127.0.0.1:53644
REPL-y 0.3.5, nREPL 0.2.6
Clojure 1.6.0
Java HotSpot(TM) 64-Bit Server VM 1.7.0_60-b19
    Docs: (doc function-name-here)
          (find-doc "part-of-name-here")
  Source: (source function-name-here)
 Javadoc: (javadoc java-object-or-class-here)
    Exit: Control+D or (exit) or (quit)
 Results: Stored in vars *1, *2, *3, an exception in *e

front.server=> (run)
2014-11-23 10:25:39.806:INFO:oejs.Server:jetty-7.6.13.v20130916
2014-11-23 10:25:39.856:INFO:oejs.AbstractConnector:Started [email protected]:10555
Starting web server on portStarting figwheel.
 10555 .
#<Server org.eclipse.jetty.server.Server@6f7714c8>
front.server=> Compiling ClojureScript.
Figwheel: Starting server at http://localhost:3449
Figwheel: Serving files from '(dev-resources|resources)/public'
front.server=> (browser-repl)
<< started Weasel server on ws://0.0.0.0:9001 >>
Type `:cljs/quit` to stop the ClojureScript REPL
nil

Is this normal? Can something be done about this?

Add sass support with sass-clojure

There was a previous attempt to support Sass using sassc, but installing the sassc binaries requires building libsass and sassc from source, which is not acceptable for Chestnut's target audience.

Using sass-clojure, we can simply rely on JRuby and use the canonical Ruby based implementation. All that's needed is for someone to write leiningen hooks to wire things up.

https://github.com/mylesmegyesi/sass-clojure

Previous discussion here: #61

Errors in fresh project: in-seconds does not exist

I'm trying out chestnut for the first time, and when I create a new chestnut project and enter (run) in a lein repl, I get the following:

CompilerException java.lang.RuntimeException: Unable to resolve symbol: run in this context, compiling:(/private/var/folders/gk/bxgzz2tn5gs2249f05hkw2jh0000gn/T/form-init1377301235688307069.clj:1:1)

Also, while the repl loads, I see this:

#<CompilerException java.lang.IllegalAccessError: in-seconds does not exist, compiling:(ring/middleware/cookies.clj:1:1)>

Snapshot build displays ArityException on (browser-repl)

Hey,

first of all, I'm not sure if this is the right channel for discussing these things. Let me know if you would prefer another way...

When creating a snapshot project

lein new chestnut app1 --snapshot --

the following exception is thrown when issuing (browser-repl), connected to latest Chrome:

app1.server=> (browser-repl)
<< started Weasel server on ws://0.0.0.0:9001 >>
Type `:cljs/quit` to stop the ClojureScript REPL

ArityException Wrong number of args (3) passed to: repl/fn--4972/fn--4975    clojure.lang.AFn.throwArity (AFn.java:429)

The connection still seems to work, I can send commands to be executed in the browser.

Add Devcards as an option

Would you accept a pull-request for this?

I think Devcards is very beginner friendly in that it allows you to develop your application bottom-up, creating small components that work and only later figuring it out how they should play together. However unless you are using the lein-devcards template, trying to configure it to work with your existing project can be overwhelming for someone not used to working with Leiningen.

If you change a library version (e.g. Om) in project.clj, the server continues serving the old version until you "lein cljsbuild clean"

  1. lein new chestnut <name>
  2. lein repl
  3. (run)
  4. (quit)
  5. In project.clj, change [om "0.7.3"] to [om "0.8.0-alpha1"]
  6. Start the server again

RESULT: It quietly continues serving the old version of Om.

If you lein cljsbuild clean, then start the server, it works.

Reading the cljsbuild README, I see

If you've upgraded any libraries, you probably want to run lein cljsbuild clean afterward.

So maybe seasoned cljs people already are used to solving this problem, but I wasn't. Maybe this is worth putting in the chestnut FAQ?

Pre 0.7.0 testing

I'd like to release a new stable version as soon as Om 0.8.0 is out. it's at rc1 now so this might be soon. Before we can release though we'll have to verify everything still works as expected.

A description of what "basic test" and "production test" means can be found in the docs.

  • Basic Test ; no options
  • Basic Test ; --http-kit
  • Basic Test ; --site-middleware
  • Basic Test ; --om-tools
  • Basic Test ; --cljx
  • Basic Test ; --less
  • Basic Test ; --speclj
  • Basic Test ; all options
  • Production Test ; no options
  • Production Test ; --http-kit
  • Production Test ; --site-middleware
  • Production Test ; --om-tools
  • Production Test ; --cljx
  • Production Test ; --less
  • Production Test ; --speclj
  • Production Test ; all options
  • Feature Test : CLJX
  • Feature Test : Speclj

Known issues that need to be fixed before 0.7.0 :

Remove project dependency on leiningen

Chestnut has a dependency on Leiningen which depends on Maven. This means we pull in a ton of unnecessary dependencies into our uberjar including Plexus and Lucene. It seems to be only used in dev.clj. Does it make sense to:

  1. Put the Leiningen dependency (and dev.clj) into a dev profile or
  2. Remove it entirely and just shell out our calls to lein/-main?

--speclj option doesn't do anything

I was trying to get the speclj install options working and ended up diffing two new projects with/without the option. There's no difference, and lein spec doesn't work within the new project.

Figwheel (as of 0.2.2-SNAPSHOT) opens a REPL into a running app.

I wasn't sure where to open this discussion / comment. It looks like the latest Figwheel handles opening a REPL into your running app.

Here's a short announcement on this from the author:
https://twitter.com/bhauman/status/555842947250651138

I tested the REPL with CLJS 0.0-2665, which is required for it to work. Older versions of CLJS will hang the REPL.

Is this something that might be a good replacement for Weasel/Piggieback? Or, would this complement it, or neither?

Paths for & in index.html may be wrong.

After running lein figwheel and opening localhost:3449 in my browser, I realized only the default austin HTML was being loaded in the browser. I tried loading localhost:3449/index.html to no avail. I got the page to load after doing the following:

  1. moved resources/index.html to resources/public/index.html
  2. changed "/app.js" to "app.js" in index.html This has proved unnecessary.
  3. opened localhost:3449/index.html in my browser

Now everything appears to work as expected. I suspect I might be doing something wrong to cause this issue (as is usually the case in general), but I literally changed nothing after running lein new chestnut myproject.

Add Garden

Would you be interested in merging a PR that adds Garden as a flag --garden?

My thinking is that I'd just add it as a part of the run function similar to how it's done for figwheel.
There are still a couple of unknowns but if there's interest I'd give it a shot.

caching of resource routes

when i change a file from the resources folder usually the chestnut server will not send the updated file upon http GET request.

i am getting 200s and old files.

what do you think is going on or do you have suggestions for fixing the server part?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.