Skip to content
This repository was archived by the owner on Oct 21, 2022. It is now read-only.

Commit 103ba11

Browse files
committed
Merge branch 'master' into remove-unused-behavior
Conflicts: clojure_compiled.js clojure_compiled.js.map
2 parents 6d3edc2 + 3c2d2bd commit 103ba11

3 files changed

Lines changed: 32 additions & 8 deletions

File tree

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,19 @@ There are 3 ways to eval ClojureScript, 2 of which use your ClojureScript javasc
2424
* Release the new version of lein-light-nrepl to [clojars](https://clojars.org/lein-light-nrepl)
2525
* No process for upgrading `clojure-mode.js` until [this issue](https://github.com/LightTable/Clojure/issues/26) is addressed.
2626

27-
###License
27+
## ClojureScript Workflows
28+
29+
For ClojureScript projects:
30+
31+
Your project is connected to a browser. Recompile cljs outside of LT with project's cljs compile tool e.g. `lein cljsbuild auto`.
32+
Most changes can be evaled. However, if adding project dependencies or requires to ns, refresh the browser page after cljs has been compiled.
33+
34+
For LightTable plugins:
35+
36+
Your project is connected to `LightTable UI`. When you save any plugin cljs file, compiled js is generated and saved. Any change
37+
can be eval-ed.
38+
39+
## License
2840

2941
Copyright (C) 2013 Kodowa Inc.
3042

clojure.behaviors

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,13 @@
5454
:lt.plugins.clojure/on-eval.custom]
5555

5656
:editor.clj.eval [:lt.plugins.clojure/on-eval.one
57-
:lt.plugins.clojure/on-eval
57+
:lt.plugins.clojure/on-eval.clj
5858
:lt.plugins.clojure/eval-location]
5959

60+
:editor.cljs.eval [:lt.plugins.clojure/on-eval.one
61+
:lt.plugins.clojure/on-eval.cljs
62+
:lt.plugins.clojure/eval-location]
63+
6064
:editor.clj [(:lt.object/add-tag :editor.clj.common)
6165
(:lt.object/add-tag :editor.clj.eval)
6266
:lt.plugins.clojure/eval-print
@@ -75,7 +79,7 @@
7579
:lt.plugins.clojure/print-clj-doc]
7680

7781
:editor.cljs [(:lt.object/add-tag :editor.clj.common)
78-
(:lt.object/add-tag :editor.clj.eval)
82+
(:lt.object/add-tag :editor.cljs.eval)
7983
:lt.plugins.clojure/eval-print
8084
:lt.plugins.clojure/eval-print-err
8185
:lt.plugins.clojure/exec.cljs!

src/lt/plugins/clojure.cljs

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,16 +93,24 @@
9393
(or (clients/by-name local-name)
9494
(run-local-server (clients/client! :nrepl.client))))))
9595

96-
(behavior ::on-eval
96+
(behavior ::on-eval.clj
9797
:triggers #{:eval}
9898
:reaction (fn [editor]
9999
(object/raise clj-lang :eval! {:origin editor
100100
:info (assoc (@editor :info)
101101
:print-length (object/raise-reduce editor :clojure.print-length+ nil)
102-
:code (watches/watched-range editor nil nil (if (object/has-tag? editor :editor.cljs)
103-
cljs-watch
104-
clj-watch)))})
105-
))
102+
:code (watches/watched-range editor nil nil clj-watch))})))
103+
(behavior ::on-eval.cljs
104+
:triggers #{:eval}
105+
:reaction (fn [editor]
106+
(object/raise clj-lang :eval! {:origin editor
107+
:info (assoc (@editor :info)
108+
:print-length (object/raise-reduce editor :clojure.print-length+ nil)
109+
;; COMPILED temporarily enabled to turn off goog.provide ns errors
110+
:code (str
111+
"(set! js/COMPILED-temp js/COMPILED) (set! js/COMPILED true) "
112+
(watches/watched-range editor nil nil cljs-watch)
113+
"(set! js/COMPILED js/COMPILED-temp)"))})))
106114

107115
(behavior ::on-eval.one
108116
:triggers #{:eval.one}

0 commit comments

Comments
 (0)