hoplon/javelin

Warnings with latest versions of libraries

Engelberg opened this issue · 14 comments

With the following entries in my project file:

  :dependencies [[org.clojure/clojure "1.6.0"]
                 [org.clojure/clojurescript "0.0-2311"]
                 [tailrecursion/javelin "3.6.0"]
                 [org.clojure/core.async "0.1.319.0-6b1aca-alpha"]
                 [prismatic/dommy "0.1.3"]]

  :plugins [[lein-cljsbuild "1.0.3"]]

I am receiving a bunch of warnings like the following:

WARNING: Symbol ILookup is not a protocol at line 7 file:/C:/Users/mark/.m2/repository/tailrecursion/cljs-priority-map/1.0.3/cljs-priority-map-1.0.3.jar!/tailrecursion/priority_map.cljs

It appears that the formula cells are not working properly, due to these warnings.

Any idea what is causing these warnings, or can you suggest a combination of relatively recent dependencies known to work with javelin?

I know that javelin works with [org.clojure/clojurescript "0.0-2234"]. After 2234 there were some breaking changes on cljs that made it compatible only with clojure 1.6.0 and I think that's causing trouble.

I tried changing the clojurescript version to 2234, but that alone did not fix things. Perhaps, some of the other versions (clojure, async, cljsbuild, or javelin) need to be changed as well?

CLJS version 2202 is the latest version that works with Javelin. After that there are changes to the way case* works in CLJS that broke things. As a workaround for now you could just refrain from using cljs.core/case in your formulas, lifting it out into a regular function like so:

(defn workaround [x]
  (case x 100 :foo 200 :bar))

(defc= ok (workaround other-cell))

Other than the case issue, CLJS version 2311 should work fine.

Thanks for looking at this. It doesn't appear to have anything to do with case, and I've now tried a lot of old versions of cljs, cljsbuild, etc. I keep getting warnings like this:

WARNING: Symbol ILookup is not a protocol at line 7 file:/C:/Users/mark/.m2/repository/tailrecursion/cljs-priority-map/1.0.3/cljs-priority-map-1.0.3.jar!/tailrecursion/priority_map.cljs
WARNING: Symbol IPrintWithWriter is not a protocol at line 7 file:/C:/Users/mark/.m2/repository/tailrecursion/cljs-priority-map/1.0.3/cljs-priority-map-1.0.3.jar!/tailrecursion/priority_map.cljs
WARNING: Symbol IMeta is not a protocol at line 7 file:/C:/Users/mark/.m2/repository/tailrecursion/cljs-priority-map/1.0.3/cljs-priority-map-1.0.3.jar!/tailrecursion/priority_map.cljs
WARNING: Symbol ICounted is not a protocol at line 7 file:/C:/Users/mark/.m2/repository/tailrecursion/cljs-priority-map/1.0.3/cljs-priority-map-1.0.3.jar!/tailrecursion/priority_map.cljs
WARNING: Symbol IStack is not a protocol at line 7 file:/C:/Users/mark/.m2/repository/tailrecursion/cljs-priority-map/1.0.3/cljs-priority-map-1.0.3.jar!/tailrecursion/priority_map.cljs
WARNING: Symbol IReversible is not a protocol at line 7 file:/C:/Users/mark/.m2/repository/tailrecursion/cljs-priority-map/1.0.3/cljs-priority-map-1.0.3.jar!/tailrecursion/priority_map.cljs
WARNING: Symbol IHash is not a protocol at line 7 file:/C:/Users/mark/.m2/repository/tailrecursion/cljs-priority-map/1.0.3/cljs-priority-map-1.0.3.jar!/tailrecursion/priority_map.cljs
WARNING: Symbol IEquiv is not a protocol at line 7 file:/C:/Users/mark/.m2/repository/tailrecursion/cljs-priority-map/1.0.3/cljs-priority-map-1.0.3.jar!/tailrecursion/priority_map.cljs
WARNING: Symbol IEmptyableCollection is not a protocol at line 7 file:/C:/Users/mark/.m2/repository/tailrecursion/cljs-priority-map/1.0.3/cljs-priority-map-1.0.3.jar!/tailrecursion/priority_map.cljs
WARNING: Symbol IMap is not a protocol at line 7 file:/C:/Users/mark/.m2/repository/tailrecursion/cljs-priority-map/1.0.3/cljs-priority-map-1.0.3.jar!/tailrecursion/priority_map.cljs
WARNING: Symbol IAssociative is not a protocol at line 7 file:/C:/Users/mark/.m2/repository/tailrecursion/cljs-priority-map/1.0.3/cljs-priority-map-1.0.3.jar!/tailrecursion/priority_map.cljs
WARNING: Symbol ISeqable is not a protocol at line 7 file:/C:/Users/mark/.m2/repository/tailrecursion/cljs-priority-map/1.0.3/cljs-priority-map-1.0.3.jar!/tailrecursion/priority_map.cljs
WARNING: Symbol IWithMeta is not a protocol at line 7 file:/C:/Users/mark/.m2/repository/tailrecursion/cljs-priority-map/1.0.3/cljs-priority-map-1.0.3.jar!/tailrecursion/priority_map.cljs
WARNING: Symbol ICollection is not a protocol at line 7 file:/C:/Users/mark/.m2/repository/tailrecursion/cljs-priority-map/1.0.3/cljs-priority-map-1.0.3.jar!/tailrecursion/priority_map.cljs
WARNING: Symbol ISorted is not a protocol at line 7 file:/C:/Users/mark/.m2/repository/tailrecursion/cljs-priority-map/1.0.3/cljs-priority-map-1.0.3.jar!/tailrecursion/priority_map.cljs
WARNING: Symbol cljs.core/IWatchable is not a protocol at line 70 file:/C:/Users/mark/.m2/repository/tailrecursion/javelin/3.6.1/javelin-3.6.1.jar!/tailrecursion/javelin.cljs
WARNING: Symbol cljs.core/ISwap is not a protocol at line 70 file:/C:/Users/mark/.m2/repository/tailrecursion/javelin/3.6.1/javelin-3.6.1.jar!/tailrecursion/javelin.cljs
WARNING: Symbol cljs.core/IReset is not a protocol at line 70 file:/C:/Users/mark/.m2/repository/tailrecursion/javelin/3.6.1/javelin-3.6.1.jar!/tailrecursion/javelin.cljs
WARNING: Symbol cljs.core/IDeref is not a protocol at line 70 file:/C:/Users/mark/.m2/repository/tailrecursion/javelin/3.6.1/javelin-3.6.1.jar!/tailrecursion/javelin.cljs
WARNING: Symbol cljs.core/IMeta is not a protocol at line 70 file:/C:/Users/mark/.m2/repository/tailrecursion/javelin/3.6.1/javelin-3.6.1.jar!/tailrecursion/javelin.cljs
WARNING: Symbol cljs.core/IPrintWithWriter is not a protocol at line 70 file:/C:/Users/mark/.m2/repository/tailrecursion/javelin/3.6.1/javelin-3.6.1.jar!/tailrecursion/javelin.cljs

When I run the code, I get errors as soon as javelin tries to call one of these protocol functions. So I'm a little baffled; I know these are legitimate protocols, so I don't know why they aren't being recognized by the clojurescript compiler. Both of these libraries that trigger these warnings are tailrecursion projects; I haven't seen these warnings with any other clojurescript library.

Does Javelin only work with the hoplon compiler?

You can run the Javelin tests (which use lein-cljsbuild, nothing to do with Hoplon) to verify. I just ran them here and got no errors.

lein with-profile devz cljsbuild clean
lein with-profile devz cljsbuild once test
test/run.sh

That will build Javelin with clojure 1.6.0 and CLJS 2311, and run all tests (code coverage is very good).

Oh also, you did lein cljsbuild clean, right? It Likes To Be Clean™.

Yes, I did clean, but thanks for the reminder.

I wonder if it could be a Windows thing (although offhand, I can't think of
why it would be an issue). I'll try to figure out a way to run the test
suite on Windows, and I'll let you know the results.

On Sun, Aug 17, 2014 at 1:33 PM, Micha Niskin notifications@github.com
wrote:

You can run the Javelin tests to verify. I just ran them here and got no
errors.

lein with-profile devz cljsbuild clean
lein with-profile devz cljsbuild once test
test/run.sh

That will build Javelin with clojure 1.6.0 and CLJS 2311, and run all
tests (code coverage is very good).

Reply to this email directly or view it on GitHub
#17 (comment)
.

Awesome, thanks!

Btw, if test/run.sh is a problem on windows you can just open test/test.html in your browser and look at the test results in the browser JS console. I'll document this in the README file.

The test suite passes for both javelin, and cljs-priority-map.

So I'm a bit baffled. I'll try further to isolate this.

Since it's not working for me when I drop javelin into an existing project, I'm trying to "build up" a project from the bare minimum that uses Javelin, to see where things go wrong.

As a starting point, I checked out javelin-demos, which appears to be based on a much older version and won't compile. For example, the cljs files refer to things like
(:require-macros [tailrecursion.javelin.macros :refer [cell]])
but this file appears to no longer exist in the javelin distribution.

So, is there a good starter template or project I can use as a starting point?

I did my best to update the Javelin demos project to use modern conventions. Unfortunately, I observe the behavior you did when I compiled: I see a bunch of missing protocol warnings, and then the demos don't behave as I expect.

I tried Javelin versions 3.0.0 and 3.1.0 and noticed the same bad behavior, but no protocol warnings. I experimented mostly with the "lettercount" demo because it's the simplest, and was unable to get it working with any Javelin version.

My sense of the behavior is that reset! on input cells doesn't seem to trigger propagation, but I didn't confirm this conclusively. I just know that the simplest version of letter count I could muster doesn't update when I type in the box.

Another data point is this fork of Mori that bundles Javelin 3.3.2.

I used it to write a small application in Javascript and didn't encounter any of the problems we are now with ClojureScript compilation.

this issue is super old and references thoroughly obsolete versions of cljs/javelin.

please feel free to reopen/comment if this is still a problem.