plexus / chestnut

Application template for Clojure + ClojureScript web apps
Eclipse Public License 1.0
1.32k stars 99 forks source link

bidi support #232

Closed ponkore closed 6 years ago

ponkore commented 6 years ago

I prefer to use bidi for server side routing library rather than Compojure. So I tried to support this as command line option +bidi. When +bidi not specified, generates files for Compojure.

I prefer to use bidi for server side routing libraries instead ofCompojure. So I tried supporting it as a command line option + bidi. If + bidi is not specified, it creates conventionalCompojure files.

featheredtoast commented 6 years ago

Thanks for this, I'm interested in bidi support -- I'd like to test out the flag and see everything in order before I merge.

As it is a new flag, @plexus should probably also give the OK on this, too.

plexus commented 6 years ago

This looks pretty good. I tried it out and got an error though

Caused by: java.io.FileNotFoundException: Could not locate compojure/core__init.class or compojure/core.clj on classpath., compiling:(system/components/handler.clj:1:1)
    at clojure.lang.Compiler.load(Compiler.java:7391)
    at clojure.lang.RT.loadResourceScript(RT.java:372)
    at clojure.lang.RT.loadResourceScript(RT.java:363)
    at clojure.lang.RT.load(RT.java:453)
    at clojure.lang.RT.load(RT.java:419)
    at clojure.core$load$fn__5677.invoke(core.clj:5893)
    at clojure.core$load.invokeStatic(core.clj:5892)
    at clojure.core$load.doInvoke(core.clj:5876)
    at clojure.lang.RestFn.invoke(RestFn.java:408)
    at clojure.core$load_one.invokeStatic(core.clj:5697)
    at clojure.core$load_one.invoke(core.clj:5692)
    at clojure.core$load_lib$fn__5626.invoke(core.clj:5737)
    at clojure.core$load_lib.invokeStatic(core.clj:5736)
    at clojure.core$load_lib.doInvoke(core.clj:5717)
    at clojure.lang.RestFn.applyTo(RestFn.java:142)
    at clojure.core$apply.invokeStatic(core.clj:648)
    at clojure.core$load_libs.invokeStatic(core.clj:5774)
    at clojure.core$load_libs.doInvoke(core.clj:5758)
    at clojure.lang.RestFn.applyTo(RestFn.java:137)
    at clojure.core$apply.invokeStatic(core.clj:648)
    at clojure.core$require.invokeStatic(core.clj:5796)
    at clojure.core$require.doInvoke(core.clj:5796)
    at clojure.lang.RestFn.invoke(RestFn.java:619)
    at sesame.application$eval9$loading__5569__auto____10.invoke(application.clj:1)
    at sesame.application$eval9.invokeStatic(application.clj:1)
    at sesame.application$eval9.invoke(application.clj:1)

Seems the new-handler from system still needs compojure to be available, so we'll have to include the compojure dependency even when using bidi.

Could you also add an entry to the CHANGELOG? Thanks!

ponkore commented 6 years ago

Sorry, my mistake. I think there is a problem with the following library version:

[org.danielsz/system "0.4.0"]

I tried this PR with +edge option. This option checks clojars, and update dependencies of project.clj. I found my project.clj :

[org.danielsz/system "0.4.1"]

v0.4.1 will not fail start up. Could you try it?

plexus commented 6 years ago

I just released 0.16.0 containing this patch and the latest version of system. Thanks a lot for contributing!