Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

calling clojurescript functions #1

Open
trevor opened this issue Oct 16, 2013 · 1 comment
Open

calling clojurescript functions #1

trevor opened this issue Oct 16, 2013 · 1 comment

Comments

@trevor
Copy link

trevor commented Oct 16, 2013

I'm probably missing something obvious, but from the readme example:

(ns my.app
  (:require [compojure.core :as c]
            [compojure.handler :as h] handler
            [hiccup.page :as p]
            [persona-kit.core :as i]))

;; On your login page, use include-persona to bring in persona resources, 
;; sign-in-button to show the login button.
(c/defroutes app-routes
  (c/GET "/" [] (p/html5 [:head
                          [:title "Login page"]
                          (i/include-persona)]
                         [:body (i/sign-in-button)])))

How are you getting persona-kit.core to have the cljs functions? Only persona-kit.core/valid? and persona-kit.core/verify-assertion are available to me.

@osbert
Copy link
Owner

osbert commented Nov 7, 2013

Hi, sorry for the lack of a response, I did not get any notification that an issue had been opened, which I will attempt to rectify immediately. This could perhaps be namespaced better, but there are two persona-kit.core namespaces in the project:

  • src/persona_kit/core.clj which is the Clojure namespace that has valid? and verify-assertion.
  • src/cljs/persona_kit/core.cljs which is the ClojureScript namespace that has the ClojureScript functions used in the README snippet above.

When using persona-kit from a ClojureScript project and using cljsbuild, cljsbuild should only build/include the cljs version. However, if you are using a different build system, or trying to use it with Pedestal, I can see this not working as expected and only the Clojure version will be brought in.

Thanks for bringing this potential problem up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants