nrepl / weasel

ClojureScript browser REPL using WebSockets
The Unlicense
324 stars 35 forks source link

Update to comply with new 2-arg arity of IJavaScriptEnv in 0.0-2665. #39

Closed mfikes closed 9 years ago

mfikes commented 9 years ago

Since this is a breaking change, update Weasel version to 0.5.0. Additionally, since this is incompatible with ClojureScript versions prior to 0.0-2665, eliminate the temporary compatibility hack for previous API breakage introduced with 0.0-2371.

This addresses #37. If this is ultimately released, the CHANGES.md can be updated to reflect the breaking change, along with README.md.

shaunlebron commented 9 years ago

@mfikes thanks for doing this. tried out this PR, but having some trouble with piggieback, did you have to modify it? Minimal weasel project here with steps to reproduce in the readme: https://github.com/shaunlebron/new-weasel-example

mfikes commented 9 years ago

@shaunlebron Yes, there are two -setup calls in piggyback that will need to be updated. Locally, I simply passed in nil to get by:

diff --git a/src/cemerick/piggieback.clj b/src/cemerick/piggieback.clj
index 88ea202..052e25b 100644
--- a/src/cemerick/piggieback.clj
+++ b/src/cemerick/piggieback.clj
@@ -147,7 +147,7 @@
   [rhino-env]
   (with-rhino-context
     (doto rhino-env
-      cljsrepl/-setup
+      (cljsrepl/-setup nil)
       ; rhino/rhino-setup maps System/out to "out" and therefore the target of
       ; cljs' *print-fn*! :-(
       (map-stdout *out*)
@@ -185,7 +185,7 @@
       (or (::env/compiler repl-env) (env/default-compiler-env))
       (if (rhino-repl-env? repl-env)
         (setup-rhino-env repl-env)
-        (cljsrepl/-setup repl-env)))
+        (cljsrepl/-setup repl-env nil)))

     (print "Type `")
     (pr :cljs/quit)
shaunlebron commented 9 years ago

Thanks, confirmed it is working. Created a piggieback PR #37 with the necessary changes; we'll have to wait on that before merging here.

Updated working example for verification: https://github.com/shaunlebron/new-weasel-example

tomjakubowski commented 9 years ago

Wonderful! Thank you so much @mfikes and @shaunlebron. Eagerly watching that piggieback PR!

tomjakubowski commented 9 years ago

Released in 0.5.0.