domkm / silk

Routing for Clojure & ClojureScript
222 stars 13 forks source link

Arrive/depart error in cljs #2

Closed pleasetrythisathome closed 9 years ago

pleasetrythisathome commented 9 years ago

the following from your examples works fine in clojure, not in cljs

(def user-routes (silk/routes [[:users-index [["users"]]] [:users-show [["users" (silk/int :id)]]]]))

(silk/arrive user-routes "users/40") (silk/depart user-routes :users-show {:id 42})

not sure how far this extends to other functions, but makes the current distribution unuseable

Error: Assert failed: (pattern? ptrn) at match (http://localhost:8080/out/dev/domkm/silk.js:412:9) at domkm.silk.Route.domkm$silk$Pattern$_match$arity$2 (http://localhost:8080/out/dev/domkm/silk.js:922:64) at _match (http://localhost:8080/out/dev/domkm/silk.js:284:15) at match (http://localhost:8080/out/dev/domkm/silk.js:414:86) at http://localhost:8080/out/dev/domkm/silk.js:962:68 at some (http://localhost:8080/out/dev/cljs/core.js:9035:30) at domkm.silk.Routes.domkm$silk$Pattern$_match$arity$2 (http://localhost:8080/out/dev/domkm/silk.js:961:44) at _match (http://localhost:8080/out/dev/domkm/silk.js:284:15) at match (http://localhost:8080/out/dev/domkm/silk.js:414:86) at domkm.silk.arrive.arrive__3 (http://localhost:8080/out/dev/domkm/silk.js:1009:86)

domkm commented 9 years ago

I'm unable to replicate this on Clojure 1.6.0 and ClojureScript 0.0-2322. What versions are you running?

Also, is this the full code or a minimal example? If the latter, could you check to make sure that the error happens with this specific code?

pleasetrythisathome commented 9 years ago

seems to have resolved itself during refactoring....can you cut a release so that I use a consistent jar?

domkm commented 9 years ago

Sure thing.