Skip to content

A port of OM Tutorial from Light Table to nrepl compatible editors/IDEs

License

Notifications You must be signed in to change notification settings

magomimmo/om-tut

Repository files navigation

om-tut

A port of OM Tutorial from Light Table to any nrepl compliant editor/IDE.

Quickstart

Emacs/cider

Clone the om-tut repo

git clone https://github.com/magomimmo/om-tut.git

OPTIONAL: Launch the ClojureScript compilation in auto mode

cd om-tut
lein cljsbuild auto
Compiling ClojureScript.
Compiling "dev-resources/public/js/om_tut.js" from ("src/cljs" "test/cljs" "dev-resources/tools/repl")...
Successfully compiled "dev-resources/public/js/om_tut.js" in 20.222298 seconds.

Open the core.cljs file in emacs an issue the C-C M-j command (or M-x cider-jack-in)

Run the http-server from the nREPL

; CIDER 0.5.0alpha (package: 20131210.726) (Clojure 1.5.1, nREPL 0.2.3)
user> (run)
#<Server org.eclipse.jetty.server.Server@3a9bb797>
user>

Run the Browser Connected REPL (bREPL) from the nREPL

user> (browser-repl)
Browser-REPL ready @ http://localhost:56796/802/repl/start
Type `:cljs/quit` to stop the ClojureScript REPL
nil
cljs.user> 

Activate the bREPL: visit the http://localhost:3000 page

Evaluate form by form the content of core.cljs by using the usual C-c C-e shortcut. It's important to start by evaluating the ns form.

Live feedback in the browser

Change the value of the :text key in the app-state atom from `"Hello World!" to something different.

Re-evaluate both the app-state form and the om/root form starting from the first.

You should now see the browser being updated with the new value you set to the :text key.

Eclipse/CCW

Clone the om-tut repo

git clone https://github.com/magomimmo/om-tut.git

Create a generic project

New->General->Project and click next.

Project name: om-tut. Uncheck Use default location, click Browse, select the om-tut folder and click Finish.

Convert to Leiningen project

From the contextual menu: Configure->Convert to Leiningen Project.

Run om-tut

Form the contextual menu: Leiningen->Launch Headless REPL for the project.

Launch the htt-server and the Browser Connected REPL form the opened REPL.

(run)
; CIDER 0.5.0alpha (package: 20131210.726) (Clojure 1.5.1, nREPL 0.2.3)
user> (run)
#<Server org.eclipse.jetty.server.Server@3a9bb797>
user> (browser-repl)
Browser-REPL ready @ http://localhost:56796/802/repl/start
Type `:cljs/quit` to stop the ClojureScript REPL
nil
cljs.user> 

Activate the bREPL: visit the http://localhost:3000 page

Open the core.cljs file and evaluate form by form its content of by using the usual ctrl/command ENTER shortcut. It's important to start by evaluating the ns form.

Live feedback in the browser

Change the value of the :text key in the app-state atom from `"Hello World!" to something different.

Re-evaluate both the app-state form and the om/root form starting from the first.

You should now see the browser being updated with the new value you set to the :text key.

License

Copyright © 2014 FIXME

Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.

About

A port of OM Tutorial from Light Table to nrepl compatible editors/IDEs

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published