viebel/klipse

Using klipse reagent inside a reagent project

olymk2 opened this issue · 5 comments

I Thought I would try out klipse in a reagent project I have set everything up, and it kinda works how ever I am seeing errors like below.

Error: No protocol method IDeref.-deref defined for type null:

ERROR: Error: No protocol method ISwap.-swap! defined for type cljs.core/Atom: [object Object]

If I swap the order of the js files in the index.html file, klipse seems to work but messes up the rendering of the clojure app, if the clojure app is loaded first then the klipse plugin then I get the issues above is this an issue with reagent conflicting with itself ?

I guess klipse is loading reagent in the code snippets and my app is also loading reagent, or is this not related and something else could be happening ?

Ended up making this example which shows the issue, clojrue code is fine only the reagent code errors.

https://gitlab.com/olymk2/clojurescript-reagent-klipse-demo

hoping someone can point me in the right direction.

Hey @olymk2 !
For your use case, it's better to consume klipse as a Clojurescript lib instead of loading the compiled javascript file.
See https://gitlab.com/olymk2/clojurescript-reagent-klipse-demo/merge_requests/1 some changes I did to your demo project. The code is much simple now.

I have added the instructions to the README here. Please let me know if it is clear enough.

Also, what kind of app do you build with reagent and Klipse?

awesome I will take a look when I get some time, and thanks for adding it to the readme.

I am partly playing around with clojure, I am trying to make an app which lets you store hiccup reagent snippets and then display and browse them on a web page, think reusable devcards catalog.