dribnet / strokes

Let's pretend d3 was written in ClojureScript.
374 stars 28 forks source link

Advanced Compilation #7

Closed beandipper closed 11 years ago

beandipper commented 11 years ago

Is there a way to do advanced compilation together with strokes? I'm getting errors like:

Jul 27, 2013 4:23:09 PM com.google.javascript.jscomp.LoggerErrorManager println
WARNING: /home/albert/programming/clojure/jitsudojo-backend/resources/public/app/js/bin-debug/mrhyde/typepatcher.js:1615: WARNING - dangerous use of this in static method mrhyde.typepatcher.set_partition_key
var t = this;

So far I only have simple optimzations compiling:

dribnet commented 11 years ago

The warnings themselves can be ignored, though some things will not work in advanced compilation mode. Mainly: javascript cannot access clojurescript maps as javascript objects. In addition, last time I checked d3 itself does not have a comprehensive externs file, though I and others have worked on this - which prevents most of d3 itself for being available in advanced compilation mode. (though mike bostock is not interested in this, @soheilhy was once interested in improving my implementation and I now see @federico-b does seem to have what looks to be a pretty through one now here)

Some relevant links:

mrhyde library which strokes depends on has a test suite that reports what functionality is working under different compilation modes (and everything works optimizations set to simple). And as the hinted in the project.clj, the hull example in strokes repo does work in advanced compilation mode using this my own d3 externs file.