Demo of a restartable back-end in the REPL + hot-reloadable front-end in the browser.
Clojure
130
51 commits
updated Sep 30, 2017
* Holy grail
#+BEGIN_QUOTE
Well, on second thought, let's not go to Camelot -- it is
a silly place. — King Arthur
#+END_QUOTE
** What is it?
This demonstrates the *holy grail* workflow for web development the way I envision it: an auto-restartable back-end in the REPL + a hot-reloadable front-end in the browser.
This workflow is built on top of [[http://boot-clj.com/][Boot]], a build tool, and [[https://github.com/danielsz/system/tree/master/examples/boot][system]], a component library.
** Installation
Clone this repo, cd into it and start the development pipeline build.
#+BEGIN_SRC shell
$ git clone git@github.com:danielsz/holygrail.git
$ cd holygrail
$ boot dev
#+END_SRC
** Principle of operation
Compose a build pipeline:
#+BEGIN_SRC clojure
(deftask dev
"Run a restartable system in the Repl"
[]
(comp
(environ :env {:http-port 3000})
(watch)
(system :sys #'dev-system :auto true :files ["handler.clj"])
(reload)
(cljs)
(repl :server true)))
#+END_SRC
Start it:
#+BEGIN_SRC shell
$ boot dev
#+END_SRC
The headless REPL advertises its coordinates.
#+BEGIN_SRC shell
nREPL server started on port 49722 on host 127.0.0.1 - nrepl://127.0.0.1:49722
#+END_SRC
You can connect to it if you plan to do development in the REPL (~M-x cider-connect~ in Emacs works great).
Your web app is started and listening at [[http://localhost:3000]].
The ~auto~ option in the ~system~ boot task takes care of your application lifecycle. Your system will automatically be reset after editing ~handler.clj~. Changes elsewhere that do not require a system restart will be reloaded on the fly everytime you save your work.
*Note:* The ~build.boot~ in this repo already contains those options.
** Demo
A demo video that tries to demonstrate how developing for the web can be a liberating and seamless experience.
#+HTML: <a href="http://www.youtube.com/watch?feature=player_embedded&v=eoxsSrFK_Is" target="_blank"><img src="http://img.youtube.com/vi/eoxsSrFK_Is/0.jpg" alt="Holy Grail demo" width="240" height="180" border="10" /></a>
Do you feel the creative juices flow? Are you ready for endless hours of sheer creative output?
Not written in Markdown, so it's shown here as plain text — view it formatted on GitHub.
Clojure
89.2%
HTML
7.8%
CSS
3.0%
Demo of a restartable back-end in the REPL + hot-reloadable front-end in the browser.
Clojure
130
51 commits
updated Sep 30, 2017
* Holy grail
#+BEGIN_QUOTE
Well, on second thought, let's not go to Camelot -- it is
a silly place. — King Arthur
#+END_QUOTE
** What is it?
This demonstrates the *holy grail* workflow for web development the way I envision it: an auto-restartable back-end in the REPL + a hot-reloadable front-end in the browser.
This workflow is built on top of [[http://boot-clj.com/][Boot]], a build tool, and [[https://github.com/danielsz/system/tree/master/examples/boot][system]], a component library.
** Installation
Clone this repo, cd into it and start the development pipeline build.
#+BEGIN_SRC shell
$ git clone git@github.com:danielsz/holygrail.git
$ cd holygrail
$ boot dev
#+END_SRC
** Principle of operation
Compose a build pipeline:
#+BEGIN_SRC clojure
(deftask dev
"Run a restartable system in the Repl"
[]
(comp
(environ :env {:http-port 3000})
(watch)
(system :sys #'dev-system :auto true :files ["handler.clj"])
(reload)
(cljs)
(repl :server true)))
#+END_SRC
Start it:
#+BEGIN_SRC shell
$ boot dev
#+END_SRC
The headless REPL advertises its coordinates.
#+BEGIN_SRC shell
nREPL server started on port 49722 on host 127.0.0.1 - nrepl://127.0.0.1:49722
#+END_SRC
You can connect to it if you plan to do development in the REPL (~M-x cider-connect~ in Emacs works great).
Your web app is started and listening at [[http://localhost:3000]].
The ~auto~ option in the ~system~ boot task takes care of your application lifecycle. Your system will automatically be reset after editing ~handler.clj~. Changes elsewhere that do not require a system restart will be reloaded on the fly everytime you save your work.
*Note:* The ~build.boot~ in this repo already contains those options.
** Demo
A demo video that tries to demonstrate how developing for the web can be a liberating and seamless experience.
#+HTML: <a href="http://www.youtube.com/watch?feature=player_embedded&v=eoxsSrFK_Is" target="_blank"><img src="http://img.youtube.com/vi/eoxsSrFK_Is/0.jpg" alt="Holy Grail demo" width="240" height="180" border="10" /></a>
Do you feel the creative juices flow? Are you ready for endless hours of sheer creative output?
Not written in Markdown, so it's shown here as plain text — view it formatted on GitHub.
Clojure
89.2%
HTML
7.8%
CSS
3.0%