-
Notifications
You must be signed in to change notification settings - Fork 42
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
Add partial ClojureScript support for building queries #26
Conversation
Upgrade Clojure dependency to 1.7.0-beta3
I think this is outside the scope of this library. Just requiring the needed parts in another library is probably better. |
Hi @apa512, to be able to use the Query parts of your library, they either need to be copied into .cljs files with the parts that don't work removed, or add Reader Conditionals or cljx to let the Clojure and ClojureScript compilers only see the parts they need. Probably the best and cleanest solution would be to:
With those two things done, we could require this library into our own library and add any other code we needed in there. Would that work for you? |
I don't like cljx (more dependencies and annoying compile step) but cljc seems fine. that's still a very experimental feature though? |
CLJC is a new feature in Clojure 1.7 which is expected to be released quite soon. So it's pretty new, although it's probably past the experimental stage though. However it isn't backwards compatible with Clojure 1.6 or below, so it may make more sense to maintain this in a parallel branch until you're happy to drop 1.6 support. |
Continuing in #59 |
This isn't ready to merge, I'm opening it for discussion and feedback while it's WIP.
The project I'm working on needs to generate RethinkDB queries in the browser with ClojureScript, then send them to a server to be evaluated. This pull request implements partial ClojureScript support for the query portion of clj-rethinkdb.
I know you said that you weren't interested in ClojureScript support in #21, but wondered if this would route would be acceptable to you. Another possibility would be splitting the project in two, making the query building Clojure/ClojureScript compatible, and leaving the network communications part in Clojure. Unless you were going to use ClojureScript on NodeJS I'm not sure that it would be possible or make sense to port this whole library to ClojureScript.
What are your thoughts?
Shortcuts I took to get this working: