Giter VIP home page Giter VIP logo

om-tut's Introduction

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.

om-tut's People

Contributors

magomimmo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

skhurram

om-tut's Issues

(browser-repl) NPE when upgrading to OM 0.5 & CLJS 0.0-2173

I tried upgrading OM to 0.5 and CLJS 0.0-2173. I use CCW. When I start headless REPL (Alt-L,H), I see
Compiling ClojureScript.
Compiling "dev-resources/public/js/om_tut.js" from ("src/cljs" "test/cljs" "dev-resources/tools/repl")...
WARNING: Referred var om-tut.core/foo does not exist at line 3 test\cljs\om_tut\core_test.cljs
�[32mSuccessfully compiled "dev-resources/public/js/om_tut.js" in 56.423206327 seconds.�[0m

I issue (run) from the REPL pane and get
2014-02-27 05:40:07.565:INFO:oejs.Server:jetty-7.6.8.v20121106
2014-02-27 05:40:07.653:INFO:oejs.AbstractConnector:Started [email protected]:3000

(browser-repl) fails with
NullPointerException
clojure.core/complement/fn--4048 (core.clj:1357)
clojure.core/filter/fn--4226 (core.clj:2529)
clojure.lang.LazySeq.sval (LazySeq.java:42)
clojure.lang.LazySeq.seq (LazySeq.java:60)
clojure.lang.RT.seq (RT.java:484)
clojure.core/seq (core.clj:133)
clojure.core/map/fn--4207 (core.clj:2479)
clojure.lang.LazySeq.sval (LazySeq.java:42)
clojure.lang.LazySeq.seq (LazySeq.java:60)
clojure.lang.RT.seq (RT.java:484)
clojure.core/seq (core.clj:133)
clojure.core/filter/fn--4226 (core.clj:2523)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.