Running Clara rules in a browser

82 views
Skip to first unread message

Alessandro Di Bella

unread,
Oct 1, 2021, 7:00:36 AM10/1/21
to Clara
Hi,

I'm evaluation options to implement validation rules that could be run both in the browser (React.js client) and back-end. Based on the  documentation, the combination of  Clara rules and ClojureScript sounds like a possible solution.

However, I can't find any sample or documentation that shows how this could be achieved.

If anyone could point me in the right direction, it would be greatly appreciated.

Thank you in advance.

Alessandro

Mike Rodriguez

unread,
Oct 5, 2021, 11:28:56 AM10/5/21
to Clara
some examples of compiling the clara-rules to cljs to be used on the client-side.

This is currently done via the defsession macro. The rules are compiled on the compiler-jvm/clojure-side, but then the session can be evaluated against within the cljs/js space.

Some of the test code usages of cljs here are dated, so disregard those.

Note: I have a long outstanding issue working to try to remodel the cljs compilation in clara since it has had some issues with modern dev tooling and modern cljs versions that I'd like to eventually address. https://github.com/cerner/clara-rules/issues/388  However, it still should be functional for use as of now.
Reply all
Reply to author
Forward
0 new messages