Version 0.4.1 is a minor update to 0.4.0, and contains basic support
for the just-released App Engine 1.4.3 SDK.
https://github.com/gcv/appengine-magic
Future versions of appengine-magic will contain full support for new
features of App Engine, including the Files API, the Deferred API, and
the Remote API. (Patches welcome!)
Thanks,
Constantine Vetoshev
appengine-magic is primarily optimized for running in interactive REPL
mode, where you just recompile changed functions and see the results
immediately. The appengine-magic.core/serve function is specifically
there for that purpose; you should rarely have to restart anything.
In my understanding, Enclojure supports interactive REPL development
(correct me if I'm wrong). Just start a project, code up some
functions, wire them to the Ring response, and recompile them. There
is no need for wrap-reload middleware.
I don't recommend using dev_appserver.sh. It's supported in
appengine-magic, but I don't think it's useful, except maybe for a
quick test of the bundled final jars before production deployment.
As for wrap-stacktrace, I'm reluctant to include a dependency on it by
default in the library. It's easy enough to include in your
application's definition. In Compojure, it would look something like:
(def my-app-handler
(-> #'my-app-routes
ring/wrap-stacktrace))
(ae/def-appengine-app my-app #'my-app-handler)
That way, if you want to use a custom replacement for wrap-stacktrace,
you can do so (I actually do this in my apps), whereas including it by
default will force it on everyone.
By the way, you can recompile my-app-handler on the fly, too.
> Another issue I've been facing: I'm using enclojure for coding, but I can't
> use the enclojure IDE for coding unless I move appengine-magic from the
> dev-dependencies to depenpencies. Has anybody have a suggestion how to work
> around this other than patching enclojure to add the /lib/dev/ directory
> content to the classpath?
You mean Enclojure doesn't let you customize the project's classpath?
At Sun, 3 Apr 2011 17:26:49 -0700,
Constantine Vetoshev wrote:
>
> I would like to announce the release of appengine-magic version 0.4.1,
> a library designed to make it easier to write Clojure applications for
> Google App Engine.
Thanks for that, appengine-magic looks great.
I'm trying appengine-magic out, following the Getting Started
(https://github.com/gcv/appengine-magic#readme) but when I get to
"lein appengine-prepare", I receive the following error:
Exception in thread "main" java.io.FileNotFoundException: Could not locate lancet/core__init.class or lancet/core.clj on classpath: (appengine_prepare.clj:1)
[...]
Caused by: java.io.FileNotFoundException: Could not locate lancet/core__init.class or lancet/core.clj on classpath:
[...]
I'm very likely to be missing something but I can't find what. As far
as I can judge, I've followed your Getting Started strictly... Do I
need to set the classpath myself? Any idea why I fail there?
Thanks!
Vincent
appengine-magic is primarily optimized for running in interactive REPL
mode, where you just recompile changed functions and see the results
immediately. The appengine-magic.core/serve function is specifically
there for that purpose; you should rarely have to restart anything.
In my understanding, Enclojure supports interactive REPL development
(correct me if I'm wrong). Just start a project, code up some
functions, wire them to the Ring response, and recompile them. There
is no need for wrap-reload middleware.
I don't recommend using dev_appserver.sh. It's supported in
appengine-magic, but I don't think it's useful, except maybe for a
quick test of the bundled final jars before production deployment.
> Another issue I've been facing: I'm using enclojure for coding, but I can't
> use the enclojure IDE for coding unless I move appengine-magic from the
> dev-dependencies to depenpencies. Has anybody have a suggestion how to work
> around this other than patching enclojure to add the /lib/dev/ directory
> content to the classpath?
You mean Enclojure doesn't let you customize the project's classpath?
It looks like you have an older version of Leiningen installed. Try
upgrading (to 1.5.0) with "lein upgrade".
I don't recommend using the (require ...) workflow to make changes
available to the app. Since Clojure is a Lisp, I suggest working with
s-expressions. In other words, don't reload files, just recompile the
functions which you changed.
In Emacs and SLIME, I just hit C-c C-c, and my current top-level
definition, usually a defn form, is recompiled in the running image. I
don't use Enclojure, but the screenshots suggest that it supports this
concept: http://www.enclojure.org/Clojure+Code+Editor+-+REPL+Integration
— it has an "Evaluate Expression" option, which sounds like it does
the right thing. You should not have to use a (require ...) form after
every change.
> I don't quite understand what do you mean by not using dev_appserver.sh.
> I use (ae/serve) which I thought is about the same thing, it gives you an
> emulated GAE environment.
Not exactly. From the Google SDK's point of view, dev_appserver.sh and
ae/serve run the same code. However, ae/serve enables interactive
development. When you use dev_appserver.sh, you're no better off than
using straight Java, with its inefficient
edit-compile-package-deploy-restart workflow; i.e., you can't attach a
live REPL to the JVM. When you use ae/serve, you can take advantage of
Clojure's Lisp-style workflow.
In early versions of appengine-magic, dev_appserver.sh also gave you
access to /_ah/admin. As of version 0.4.0, ae/serve gives you the same
features, so I do not recommend dev_appserver.sh for development.
> The managed REPL that can be started with 2 clicks relies on the maven
> dependencies.
> lein pom does not include the dev-dependencies, but I now created an
> alternative task that does. [2]
That looks pretty useful for Maven-only tools. Have you considered
discussing this on the Leiningen mailing list?
You were right, thank you very much. I'm new to clojure and this was
driving me crazy! Now I can start :)
Vincent
In Emacs and SLIME, I just hit C-c C-c, and my current top-level
definition, usually a defn form, is recompiled in the running image. I
don't use Enclojure, but the screenshots suggest that it supports this
concept: http://www.enclojure.org/Clojure+Code+Editor+-+REPL+Integration
— it has an "Evaluate Expression" option, which sounds like it does
the right thing. You should not have to use a (require ...) form after
every change.
> The managed REPL that can be started with 2 clicks relies on the maven
> dependencies.
> lein pom does not include the dev-dependencies, but I now created an
> alternative task that does. [2]
That looks pretty useful for Maven-only tools. Have you considered
discussing this on the Leiningen mailing list?