-
Notifications
You must be signed in to change notification settings - Fork 51
Conversation
…ser input By assuming common defaults for html files, cljs eval can be automated. If none of the default paths are found, it reverts to existing behavior.
* default-cljs-client could be configurable with a behavior * Could add a behavior to disable this feature for more advanced users
Once #52 lands we'll have modern clojurescript eval and I'd like to make this a part of that release. @rundis @tonsky @kenny-evitt @stephenbrady Any thoughts on or objections to this? |
(defn find-default-html-file | ||
"Searches browser-paths for first relative path to exist and returns it." | ||
[ed] | ||
(let [project-dir (files/parent (files/walk-up-find (get-in @ed [:info :path]) "project.clj"))] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is all great. A little love for build.boot
would be a nice touch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed but boot only works for browser external connections and this currently only supports browser (internal) connections. I'll add boot if we ever add browser external support for 'ClojureScript Browser'
@cldwalker No objections – only happy thoughts! |
Not sure why I’m in that list, but obviously I don’t mind :) |
Default client to :auto mode to auto distinguish between LT projects and everything else
Also add error message for no connection url found and support urls for cljs-browser-paths
Thanks for the feedback all. I've made both the default cljs client and the relative paths/urls to look for configurable via behaviors. I'll be releasing later today |
👍 |
This is an attempt to make a clojurescript eval that just works for your project, much like clojure's eval and inspired by realizations in #8. Try it out:
EDIT: Not working with new clojurescript versions until #52 lands:lein new mies-om om-test
cd om-test && lein cljsbuild once
(enable-console-print!)
The client auto-magically works by looking for a number of common places for index.html and opening it. We can make this a configurable behavior as well as disabling this feature entirely for power users. We could also make opening to an external browser a configurable behavior.
As for implementation, I resorted to a new connection as we may want to open an internal or external browser. We could reuse the existing internal browser connection and same for the external one. However, that will require changing their :connects to kick off behaviorw and this feature will block until the next release. As for placement of the :connect call, I tried placing it in
:exec.cljs
behavior to less success. Current placement seems reasonable. If we don't like the tag check, we could change :create to point to a trigger e.g.:create-eval-connection
@LightTable/committers Would love to get feedback. I'm also going to open this up to the community on a mailing list thread.