Coder Social home page Coder Social logo

martinklepsch / tenzing Goto Github PK

View Code? Open in Web Editor NEW
402.0 11.0 39.0 702 KB

⚡️ Clojurescript application template using Boot

License: Eclipse Public License 1.0

Clojure 96.11% HTML 2.29% CSS 1.61%
clojurescript clojure project-template starter-kit

tenzing's Introduction

Tenzing, the awesome Clojurescript application template

rationale | usage | deployment | getting help

Tenzing is a Clojurescript template offering the following features:

  1. Incremental Clojurescript compilation
  2. Live reloading of your Javascript, CSS, etc.
  3. Browser-REPL

In contrast to some of the options out there it is opinionated in the following ways:

  1. Tenzing uses Boot instead of Leiningen (see below)
  2. Tenzing does not provide a backend layer (see below)
  3. Tenzing allows you to choose between Om, Reagent and others

Rationale

Why Boot?

In contrast to Leiningen Boot offers a clear strategy when it comes to composing multi-step build processes such as compiling stylesheets and Javascript whenever a relevant file changes.

Many Leinigen plugins come with an `auto` task that allows similar behavior. If you want to run multiple of those tasks it's usually done by starting multiple JVM instances which can lead to high memory usage. Boot allows this sort of behaviour to reside in one JVM process while making sure that build steps don't interfere with each other.

You can learn more about Boot in a blog post by one of the authors, its github project or a blog post I wrote about it. Mimmo Costanza's modern-cljs tutorial also uses Boot throughout - Tutorial 2 walks through the setup of a typical Boot-based development environment.

Why #noBackend?

Tenzing is designed with prototyping in mind. Instead of writing your own backend you're encouraged to use services like Firebase, Usergrid and others.

If you figure out that you need a Clojure based backend down the road it's simple to either add it yourself or create it as a standalone service that's being used by your clients.

Please, also consider offline first as an approach for building early iterations of your application.

If you're wondering how files are served during development: there is a boot task `serve` that allows you to serve static files.

Usage

Create a Project

To create a new project, install boot and run:

$ boot -d boot/new new -t tenzing -n your-app

Template options are specified using the -a switch. For example:

$ boot -d boot/new new -t tenzing -n your-app -a +reagent -a +test

Alternatively, if you have leiningen installed, you can run

$ lein new tenzing your-app

or to specify options:

$ lein new tenzing your-app +reagent +test

There are a bunch of options that determine what your newly created project will contain:

  • +om provides a basic Om application and adds relevant dependencies
  • +reagent provides a basic Reagent application and adds relevant dependencies
  • +rum provides a basic Rum application and adds relevant dependencies
  • +garden sets up Garden and integrates into the build process
  • +sass sets up Sass and integrates into the build process (requires libsass)
  • +less sets up Less and integrates into the build process.
  • +test adds a cljs test-runner and adds a test task.
  • +devtools adds a cljs-devtools through boot-cljs-devtools
  • +dirac adds a dirac through boot-cljs-devtools.

If you want to add an option, pull-requests are welcome.

Running it

After you installed Boot you can run your Clojurescript application in "development mode" by executing the following:

$ boot dev

After a moment of waiting you can head to localhost:3000 to see a small sample app. If you now go and edit one of the Clojurescript source files or a SASS file (if you've used the +sass option) this change will be picked up by Boot and the respective source file will get compiled. When a compiled file changes through that mechanism it will get pushed to the browser.

If you used the +test option, then you'll be able to run unit tests via boot test. Use boot auto-test to have tests automatically rerun on file changes.

Connecting to the browser REPL

After you started your application with boot dev there will be a line printed like the following:

nREPL server started on port 63518 on host 0.0.0.0

This means there now is an nREPL server that you can connect to. You can do this with your favorite editor or just by running boot repl --client in the same directory.

Once you are connected you can get into a Clojurescript REPL by running (start-repl). At this point I usually reload my browser one last time to make sure the REPL connection is properly setup.

Now you can run things like (.log js/console "test"), which should print "test" in the console of your browser.

How it works

If you look at the build and run tasks in the build.boot file of your newly created project you will see something like the following:

(deftask build [] (comp (speak) (cljs) (sass :output-dir "css")))

(deftask run [] (comp (serve) (watch) (cljs-repl) (reload)
    (build)))

Basically this composes all kinds of build steps into a unified run task that will start our application. From top to bottom:

The build task consists of three other tasks:

  • speak gives us audible notifications about our build process
  • cljs will compile Clojurescript source files to Javascript
  • sass will compile Sass source files to CSS

Now if we just run boot build instead of the aforementioned boot dev we will compile our Clojurescript and Sass exactly once and then the program will terminate.

This is where the run task comes in:

  • serve starts a webserver that will serve our compiled JS, CSS and anything else that is in resources/
  • watch will watch our filesystem for changes and trigger new builds when they occur
  • cljs-repl sets up various things so we can connect to our application through a browser REPL
  • reload will watch the compiled files for changes and push them to the browser
  • build does the things already described above

Please note that all tasks, except the one we defined ourselves have extensive documentation that you can view by running boot <taskname> -h (e.g. boot cljs-repl -h).

Writing build artifacts to disk

By default, none of the tasks in projects generated by tenzing output any files.

For example, when running the dev task, your project's source and resources are compiled to a temporary boot fileset and served from there. When boot quits, the fileset is no longer available.

This is actually boot's default and, at first, might sound like a strange choice for a build tool! However, these managed filesets are at the core of boot's philosophy and provide it with many advantages over declarative, stateful build tools. See the boot homepage or the [filesets wiki entry] (https://github.com/boot-clj/boot/wiki/Filesets) for more info on these concepts.

So how do you output your built project to disk so that you can deploy it for example? Simple! Boot has a [built-in target task] (https://github.com/boot-clj/boot/blob/master/doc/boot.task.built-in.md#target) that you can can compose with other tasks to output their results to a given directory (by convention the directory is named target).

To build a tenzing project with the production settings and output the results to disk you would run the following:

$ boot production build target

If you look in your project directory now, you will see a target directory containing the output of all of the tasks in this chain. By default, this directory is cleaned every time you run boot, unless you pass the no-clean option to the target task.

Should you need to filter, copy, move or rename the output files, or change the directory structure, the sift task will help you do this. If you have complex post-processing needs or want to save typing at the command line, it's a simple matter to define your own tasks.

Deployment

Since Tenzing comes without a backend you can easily deploy your app to Amazon S3 or even host it in your Dropbox. To do that just copy the files in target/ to your desired location.

confetti logo

PS. I'm also working on a tool called Confetti 🎉 that helps you setting up static sites on AWS infrastructure. It's a bit more aimed at people that deploy and manage many static sites but you should probably check it out either way :)

Getting Help

If you run into any problems feel free to open an issue or ping me (martinklepsch) in the ClojureScript room on Riot.im (no signup required).

Credits

The initial release of Tenzing was prompted by the urge to have something like the awesome Chestnut template but built on top of Boot. Many props to Arne Brasseur for making getting started with ClojureScript a lot easier at the time!

License

Copyright © 2014 Martin Klepsch

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

tenzing's People

Contributors

bensu avatar chrisetheridge avatar crisptrutski avatar ddeaguiar avatar frankiesardo avatar iorekz avatar j1mr10rd4n avatar martinklepsch avatar mswift42 avatar naartjie avatar nblumoe avatar pandeiro avatar pepe avatar pesterhazy avatar raffinate avatar rburns avatar thomas-shares avatar vvvvalvalval avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tenzing's Issues

CIDER support

I think all that needs to be done for this is to have a .dir-locals.el file with the following content:

((nil . ((cider-boot-parameters . "dev"))))

This will make it start up the boot dev task to create a development REPL with cider-jack-in. I guess this should just be a template flag.

Consistent Sample Application

Add identical sample applications for bare cljs, +reagent & +om options.
Idea: show cursor position with some simple text and make text color change on click.

Use of undeclared Var cljs.user/start-repl

Seeing this too everytime I start the REPL while on boot dev

~/D/t/michaelh-sandbox ❯❯❯ boot repl --client                                                             master ◼
cli: option vendors: expected optarg, got [str]
cli: option auto-prefix: expected optarg, got #{kw}
Implicit target dir is deprecated, please use the target task instead.
Set BOOT_EMIT_TARGET=no to disable implicit target dir.
REPL-y 0.3.7, nREPL 0.2.12
Clojure 1.8.0
Java HotSpot(TM) 64-Bit Server VM 1.8.0_92-b14
        Exit: Control+D or (exit) or (quit)
    Commands: (user/help)
        Docs: (doc function-name-here)
              (find-doc "part-of-name-here")
Find by Name: (find-name "part-of-name-here")
      Source: (source function-name-here)
     Javadoc: (javadoc java-object-or-class-here)
    Examples from clojuredocs.org: [clojuredocs or cdoc]
              (user/clojuredocs name-here)
              (user/clojuredocs "ns-here" "name-here")
boot.user=> (.log js/console "test")

clojure.lang.Compiler$CompilerException: java.lang.RuntimeException: No such namespace: js, compiling:(/tmp/boot.user8737212468071516672.clj:1:1)
             java.lang.RuntimeException: No such namespace: js
boot.user=> (start-repl)
<< started Weasel server on ws://127.0.0.1:41555 >>
<< waiting for client to connect ... Connection is ws://localhost:41555
Writing boot_cljs_repl.cljs...
 connected! >>
To quit, type: :cljs/quit
nil
cljs.user=> (start-repl)
WARNING: Use of undeclared Var cljs.user/start-repl at line 1 <cljs repl>
#object[TypeError TypeError: cljs.user.start_repl is undefined]

failing with Boot 2.6.0

This seems very similar to #54 of mount .
Downgrading to Boot 2.5.5 (through boot.properties) makes the error disappear.

lein new tenzing proj1
cd proj1
boot dev

results in the following error:

...
     clojure.lang.ExceptionInfo: template already refers to: #'boot.core/template in namespace: adzerk.boot-reload
...

Cannot get cljs repl working

I created a new project with lein new tenzing repltest +om +sass +test and then tried to start a cljs repl (without changing anything in the project) and I get this:

% boot repl
nREPL server started on port 65366 on host 127.0.0.1 - nrepl://127.0.0.1:65366
REPL-y 0.3.5, nREPL 0.2.8
Clojure 1.7.0
Java HotSpot(TM) 64-Bit Server VM 1.8.0_20-b26
        Exit: Control+D or (exit) or (quit)
    Commands: (user/help)
        Docs: (doc function-name-here)
              (find-doc "part-of-name-here")
Find by Name: (find-name "part-of-name-here")
      Source: (source function-name-here)
     Javadoc: (javadoc java-object-or-class-here)
    Examples from clojuredocs.org: [clojuredocs or cdoc]
              (user/clojuredocs name-here)
              (user/clojuredocs "ns-here" "name-here")
boot.user=> (start-repl)

java.io.FileNotFoundException: Could not locate cemerick/piggieback__init.class or cemerick/piggieback.clj on classpath.
boot.user=>

So I added an explicit dependency on the latest version of piggieback:

[com.cemerick/piggieback "0.2.1" :scope "test"]

which led to:

boot.user=> (start-repl)

java.io.FileNotFoundException: Could not locate weasel/repl/websocket__init.class or weasel/repl/websocket.clj on classpath.

so I added an explicit dependency for weasel:

[weasel "0.7.0" :scope "test"]

which gets me to this:

boot.user=> (start-repl)

java.lang.NullPointerException:
boot.user=>

(no other output)

and I'm not quite sure where to go from there. Any advice would be appreciated.

Operating system is OS X for what it's worth.

new project fails to run

Just following the instructions to set up a new vanilla project. With nothing edited, when I run 'boot dev' I get…

  clojure.lang.ExceptionInfo: dbug does not exist
    data: {:file "adzerk/boot_cljs.clj", :line 1}
java.lang.IllegalAccessError: dbug does not exist
                     clojure.core/refer                          core.clj: 3919
etc

I'm not really sure where to take it from there? Any clues?

Divshot is dead.

Divshot has incredible-journeyed:

Divshot has joined the Firebase team at Google! Firebase is a comprehensive suite of products for developers offered by Google, and by joining our vision with theirs, Divshot's mission continues onward at a grander scale!
Firebase Hosting is Firebase's static web hosting service and is now powered in part by Divshot technology. However, all existing Divshot products including static web hosting and Divshot Architect have now shut down.

Probably not much use for the hooks anymore and the suggestion in the README is rather unhelpful since it now just points to that page.

No code produced with "production" build

Everything has been working great using boot dev but when I tried boot production no code was produced. I don't think I have changed anything in the build.boot file.

(set-env!
 :source-paths    #{"src/cljs"}
 :resource-paths  #{"resources"}
 :dependencies '[[adzerk/boot-cljs      "0.0-2814-4" :scope "test"]
                 [adzerk/boot-cljs-repl "0.1.9"      :scope "test"]
                 [adzerk/boot-reload    "0.2.4"      :scope "test"]
                 [pandeiro/boot-http    "0.6.1"      :scope "test"]
                 [quiescent "0.2.0-alpha1"]
                 [cljs-http "0.1.35"]
                 [org.clojure/core.async "0.1.346.0-17112a-alpha"]])

(require
 '[adzerk.boot-cljs      :refer [cljs]]
 '[adzerk.boot-cljs-repl :refer [cljs-repl start-repl]]
 '[adzerk.boot-reload    :refer [reload]]
 '[pandeiro.boot-http    :refer [serve]])

(deftask build []
  (comp (speak)

        (cljs)
        ))

(deftask run []
  (comp (serve)
        (watch)
        (cljs-repl)
        (reload)
        (build)))

(deftask production []
  (task-options! cljs {:optimizations :advanced
                       ;; pseudo-names true is currently required
                       ;; https://github.com/martinklepsch/pseudo-names-error
                       ;; hopefully fixed soon
                       :pseudo-names true})
  identity)

(deftask development []
  (task-options! cljs {:optimizations :none
                       :unified-mode true
                       :source-map true}
                 reload {:on-jsload 'timeline.app/init})
  identity)

(deftask dev
  "Simple alias to run application in development mode"
  []
  (comp (development)
        (run)))

Doc and source commands not working in repl.

I created a brand new app with lein new tenzing myapp +reagent +divshot.
Started it with boot dev and it runs correctly in the browser.

Then I setup the browser repl with boot repl --client and ran (start-repl) but doc and source do not work.

REPL-y 0.3.5, nREPL 0.2.8
Clojure 1.7.0
Java HotSpot(TM) 64-Bit Server VM 1.8.0_25-b17
        Exit: Control+D or (exit) or (quit)
    Commands: (user/help)
        Docs: (doc function-name-here)
              (find-doc "part-of-name-here")
Find by Name: (find-name "part-of-name-here")
      Source: (source function-name-here)
     Javadoc: (javadoc java-object-or-class-here)
    Examples from clojuredocs.org: [clojuredocs or cdoc]
              (user/clojuredocs name-here)
              (user/clojuredocs "ns-here" "name-here")
boot.user=> (doc first)
-------------------------
clojure.core/first
([coll])
  Returns the first item in the collection. Calls seq on its
    argument. If coll is nil, returns nil.
nil
boot.user=> (start-repl)
Writing boot_cljs_repl.cljs...
<< Started Weasel server on ws://127.0.0.1:0 >>
Type `:cljs/quit` to stop the ClojureScript REPL
Writing boot_cljs_repl.cljs...
nil
cljs.user=> (doc first)
WARNING: Use of undeclared Var cljs.user/doc at line 1 <cljs repl>

clojure.lang.ExceptionInfo: #object[TypeError TypeError: Cannot read property 'call' of undefined]
cljs.user=> 

+hoplon Option?

Your Video from January was an eye-opener; i am so grateful that you took the time to present such valuable information!

I'm also grateful that you've included so many useful options...could you please add a hoplon option?

Thank you!

Calvin

rename test task to avoid collision

Martin,

First of all great work with tenzing. Awesome bootstrap for cljs with boot!

Just skimmed the generated build.boot and noticed your comment about the name collision:

;;; This prevents a name collision WARNING between the test task and
;;; clojure.core/test, a function that nobody really uses or cares
;;; about.
(ns-unmap 'boot.user 'test)
(deftask test []
  (comp (testing)
        (test-cljs :js-env :phantom
                   :exit?  true)))

Did you know about replace-task! in boot? With the following you can easily redefine an existing task:

(replace-task!
 [t test] (fn [& xs] (comp (testing) (test-cljs :js-env :phantom :exit?  true))))

;; or if you still want to invoke the original, redefined task something along the lines:
;;(replace-task! [t test] (fn [& xs] (comp (testing) (apply t xs))))

Anyways,
Thansk for the great work!

Server option

Opening this issue to facilitate some discussion about how to best integrate some server side component into Tenzing. Integrating some basic server is simple. Serving the index.html via that server is a little more complex though as currently different optimization levels require different <script> tags.

Options I currently see regarding those <script> tags:

  1. Modify some html template with Leiningen to account for :optimisations :none.
  2. Provide separate files index-dev.html & index-prod.html
  3. Make additional boot task that makes new main.js loading Javascript files depending on how they were compiled.

Boot source/resource paths

I have no idea why this happens, but when I do lein new tenzing myapp +reagent +divshot +garden, a build.boot is generated with the following:

(set-env!
 :src-paths   #{"src/cljs" "src/clj"}
 :rsc-paths #{"resources"}
 :dependencies '[[adzerk/boot-cljs      "0.0-2411-3" :scope "test"]
                 [adzerk/boot-cljs-repl "0.1.7"       :scope "test"]
                 [adzerk/boot-reload    "0.2.0"       :scope "test"]
                 [pandeiro/boot-http "0.3.0"]
                 [reagent "0.4.3"]
                 [boot-garden "1.2.5-1"]
                 [cljsjs/react "0.11.2"]])

:src-paths should be :source-paths and :rsc-paths should be :resource-paths. From a quick look, the code in your repo looks correct, so maybe the lein template is behind a version or two? I have no idea, but I thought I'd mention it. (I spent an embarrassingly long time debugging that lol)

Remote development environment request?

Hi Martin,

Thanks for solving the issue I posted last time btw!
tenzing works perfectly for my re-frame projects :)

Anyhow, I develop via ssh onto a Digital Ocean droplet therefore my browser should connect to that remote IP,
I was wondering what are the options I should set in build.boot regarding the cljs-repl and boot-reload plugins to swap the default IP from localhost/127.0.0.1 to it?

If you don't know off the top of your head, no worries, just curious!

java.util.concurrent.ExecutionException: java.nio.file.NoSuchFileException: target/js/app.out

Seeing this everytime in the middle of boot dev

Compiling ClojureScript...
• js/app.js
java.util.concurrent.ExecutionException: java.nio.file.NoSuchFileException: target/js/app.out/cljs_deps.js
      java.nio.file.NoSuchFileException: target/js/app.out/cljs_deps.js
    file: "target/js/app.out/cljs_deps.js"
 sun.nio.fs.UnixException.translateToIOException           UnixException.java:   86
   sun.nio.fs.UnixException.rethrowAsIOException           UnixException.java:  102
   sun.nio.fs.UnixException.rethrowAsIOException           UnixException.java:  107
      sun.nio.fs.UnixPath.openForAttributeAccess                UnixPath.java:  787
sun.nio.fs.UnixFileAttributeViews$Basic.setTimes  UnixFileAttributeViews.java:   74
                                             ...                                   
                          boot.filesystem/touch!               filesystem.clj:   44
                          boot.filesystem/patch!               filesystem.clj:   84
                                             ...                                   
                 clojure.core/apply/invokeStatic                     core.clj:  652
                         clojure.core/partial/fn                     core.clj: 2534
                                             ...                                   
       boot.core/fileset-syncer/fn/iter/fn/fn/fn                     core.clj:  777
             clojure.core/binding-conveyor-fn/fn                     core.clj: 1938
                                             ...                                   
Elapsed time: 0.451 sec

local server routes

Hi,
I'm using divshot to deploy my app (I discover it thanks to you).
I'm using the routes key in divshot.json

"routes": {
    "*": "index.html"
  },

I also need some more custom route for some images.
Any idea how I could configure the local app to allow such routes ?

Reagent template isn't working

I wanted to try out tenzing and created a new project with:

$ lein new tenzing website +reagent

However I get an error when running $ boot dev (included below). There appears to be a naming conflict with boot.core/template in adzerk.boot-reload, I'm not sure where the error is coming from and am happy to follow up with the boot-reload repo if needed.

Thanks,
codeape

Error:

$ boot dev
     clojure.lang.ExceptionInfo: template already refers to: #'boot.core/template in namespace: adzerk.boot-reload
    data: {:file "adzerk/boot_reload.clj", :line 1}
java.lang.IllegalStateException: template already refers to: #'boot.core/template in namespace: adzerk.boot-reload
                                       ...                                        
                        clojure.core/refer                          core.clj: 4098
                                       ...                                        
                        clojure.core/apply                          core.clj:  632
                     clojure.core/load-lib                          core.clj: 5730
                                       ...                                        
                        clojure.core/apply                          core.clj:  632
                    clojure.core/load-libs                          core.clj: 5749
                                       ...                                        
                        clojure.core/apply                          core.clj:  632
                      clojure.core/require                          core.clj: 5832
                                       ...                                        
adzerk.boot-reload/eval436/loading--auto--                   boot_reload.clj:    1
                adzerk.boot-reload/eval436                   boot_reload.clj:    1
                                       ...                                        
                      clojure.core/load/fn                          core.clj: 5866
                         clojure.core/load                          core.clj: 5865
                                       ...                                        
                     clojure.core/load-one                          core.clj: 5671
                  clojure.core/load-lib/fn                          core.clj: 5711
                     clojure.core/load-lib                          core.clj: 5710
                                       ...                                        
                        clojure.core/apply                          core.clj:  632
                    clojure.core/load-libs                          core.clj: 5749
                                       ...                                        
                        clojure.core/apply                          core.clj:  632
                      clojure.core/require                          core.clj: 5832
                                       ...                                        
                          boot.user/eval63  boot.user5399777186078888994.clj:    7
                                       ...                                        
                        boot.main/-main/fn                          main.clj:  196
                           boot.main/-main                          main.clj:  196
                                       ...                                        
                          boot.App.runBoot                          App.java:  399
                             boot.App.main                          App.java:  488
                                       ...                                        
                                 Boot.main                         Boot.java:  258

$ boot dev fails with:

clojure.lang.ExceptionInfo: dbug does not exist

data: {:file "adzerk/boot_cljs.clj", :line 1}

java.lang.IllegalAccessError: dbug does not exist

$ ~/local/../.. javac -version
javac 1.7.0_67
$ ~/local/../.. java -version
java version "1.7.0_67"
Java(TM) SE Runtime Environment (build 1.7.0_67-b01)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)

OS: mac os 10.9 , I'm happy to share the full stack trace.
Just let me know. Wondering if I'm doing something
wrong on my end.

the template for reagent doesn't work with kioo

I create a template for reagent using command:
lein new tenzing reagent +reagent

Then in the boot.build, add the dependency of kioo.

(set-env!
 :source-paths    #{"src/cljs"}
 :resource-paths  #{"resources"}
 :dependencies '[[adzerk/boot-cljs      "0.0-2814-4" :scope "test"]
                 [adzerk/boot-cljs-repl "0.1.9"      :scope "test"]
                 [adzerk/boot-reload    "0.2.4"      :scope "test"]
                 [pandeiro/boot-http    "0.6.1"      :scope "test"]
                 [kioo "0.4.0"] 
                 [reagent "0.5.0"]])

But it throw the following error when run boot, after I remove [kioo "0.4.0"] in the dependencies section, it goes back to normal. Could you please add the support for kioo?
boot/reagent $ boot dev
temp-dir! was deprecated, please use tmp-dir! instead
Writing boot_cljs_repl.cljs...
<< started reload server on ws://localhost:34279 >>
Writing boot_reload.cljs...
WARNING: Different CLJS version via transitive dependency: 0.0-2156
2015-07-19 17:09:22.280:INFO:oejs.Server:jetty-7.6.13.v20130916
2015-07-19 17:09:22.314:INFO:oejs.AbstractConnector:Started [email protected]:3000
<< started Jetty on http://localhost:3000 >>

Starting file watcher (CTRL-C to quit)...

clojure.lang.Compiler$CompilerException: java.lang.IllegalArgumentException: No single method: _setup of interface: cljs.repl.IJavaScriptEnv found for function: -setup of protocol: IJavaScriptEnv, compiling:(cemerick/piggieback.clj:150:5)
java.lang.IllegalArgumentException: No single method: _setup of interface: cljs.repl.IJavaScriptEnv found for function: -setup of protocol: IJavaScriptEnv
...

httpkit-related ClassNotFound error on start

Running boot 2.4.1 with a fresh project created with lein new tenzing foo +reagent +sass.

error log

$ boot dev
temp-dir! was deprecated, please use tmp-dir! instead
Writing boot_cljs_repl.cljs...
             clojure.lang.ExceptionInfo: java.lang.NoClassDefFoundError: clojure/lang/IFn, compiling:(org/httpkit/server.clj:23:11)
    data: {:file "/tmp/boot.user3779293133337330592.clj", :line 21}
java.util.concurrent.ExecutionException: java.lang.NoClassDefFoundError: clojure/lang/IFn, compiling:(org/httpkit/server.clj:23:11)
clojure.lang.Compiler$CompilerException: java.lang.NoClassDefFoundError: clojure/lang/IFn, compiling:(org/httpkit/server.clj:23:11)
         java.lang.NoClassDefFoundError: clojure/lang/IFn
       java.lang.ClassNotFoundException: clojure.lang.IFn
                                             ...                                        
                            clojure.core/load/fn                          core.clj: 5866
                               clojure.core/load                          core.clj: 5865
                                             ...                                        
                           clojure.core/load-one                          core.clj: 5671
                        clojure.core/load-lib/fn                          core.clj: 5711
                           clojure.core/load-lib                          core.clj: 5710
                                             ...                                        
                              clojure.core/apply                          core.clj:  632
                          clojure.core/load-libs                          core.clj: 5749
                                             ...                                        
                              clojure.core/apply                          core.clj:  632
                            clojure.core/require                          core.clj: 5832
                                             ...                                        
adzerk.boot-reload.server/eval54/loading--auto--                        server.clj:    1
                adzerk.boot-reload.server/eval54                        server.clj:    1
                                             ...                                        
                            clojure.core/load/fn                          core.clj: 5866
                               clojure.core/load                          core.clj: 5865
                                             ...                                        
                           clojure.core/load-one                          core.clj: 5671
                        clojure.core/load-lib/fn                          core.clj: 5711
                           clojure.core/load-lib                          core.clj: 5710
                                             ...                                        
                              clojure.core/apply                          core.clj:  632
                          clojure.core/load-libs                          core.clj: 5749
                                             ...                                        
                              clojure.core/apply                          core.clj:  632
                            clojure.core/require                          core.clj: 5832
                                             ...                                        
                           boot.pod/eval-fn-call                           pod.clj:  182
                               boot.pod/call-in*                           pod.clj:  191
                                             ...                                        
                               boot.pod/call-in*                           pod.clj:  194
                 adzerk.boot-reload/start-server                   boot_reload.clj:   26
                   adzerk.boot-reload/eval396/fn                   boot_reload.clj:   79
                                             ...                                        
                              clojure.core/apply                          core.clj:  630
                      boot.user/eval639/fn/fn/fn  boot.user3779293133337330592.clj:   15
                                             ...                                        
                            boot.user/eval577/fn  boot.user3779293133337330592.clj:   11
                                             ...                                        
                            boot.user/eval692/fn  boot.user3779293133337330592.clj:   17
                                             ...                                        
                              clojure.core/apply                          core.clj:  630
                       boot.core/construct-tasks                          core.clj:  684
                                             ...                                        
                              clojure.core/apply                          core.clj:  630
                               boot.core/boot/fn                          core.clj:  712
             clojure.core/binding-conveyor-fn/fn                          core.clj: 1916
                                             ...  

Should missing dependencies be warned or provided?

I noticed that you can start a project with +sass without having libsass completely set up; it will naturally fail when it gets to the sass compilation step (until you build sassc).

Would it be helpful to have a warning message or an automatic bundling of deps if options like +sass are chosen?

front page errors

The front page has a few issues:

  • the first link to Tenzing goes to 404
  • the title appears twice
    screen shot 2015-07-23 at 15 22 59

FileNotFoundException: priority_map

$ lein -version
Leiningen 2.5.3 on Java 1.8.0_66 Java HotSpot(TM) 64-Bit Server VM
$ lein new tenzing your-app
Exception in thread "main" java.lang.ExceptionInInitializerError
...
Caused by: java.io.FileNotFoundException: Could not locate clojure/data/priority_map__init.class or clojure/data/priority_map.clj on classpath.

Update to CLJS 0.0-3308

Despite the requirement on Clojure 1.7, it would be good to track boot-cljs while tools are still in flux. As one example, the tmp-file warnings are coming from the old version of boot-cljs, and are likely to distract new users.

Anecdotally, also finding that the phantomjs test runner via doo (#28) hangs with boot-cljs 0.0-2814-4 and works perfectly with 0.0-3308-0.

+rum option

A +rum option would be a great addition I think.

Browser REPL?

Hi Martin, the README says that tenzing includes a browser repl, like chestnut, but I have not been able to figure out how to connect to it. As far as I can tell, I should be able to just type (start-repl) in the cider REPL, but that does not work.

Would it be possible to add a couple of lines to the README explaining how to get the REPL working?

Thanks!

+datascript option

Well, datascript is a must have for any cljs app that aims to be offline, and also really good for prototyping.

Also, this is a very good addtion if we are expecting om.next to be used soon :)

Server-side rendering option

I'm totally behind not putting your api in the static web project, but server-side rendering seems a bit different to me. It's a UI concern, and I don't think anyone's gotten it right yet. Clojure[Script] seems like the ideal environment for it, whether it's all cljs running on node or some mix of clj and rhino.. but I'm only just learning Clojure.

I'd like to help with this where I can, but I'm not sure I could get it started. My background is in JavaScript/Node and .net, so I'm not too familiar with Jetty/http-kit, but I haven't seen anything doing this yet.

New project fails

Using a fresh version of boot:

#https://github.com/boot-clj/boot
#Mon Jul 27 12:46:53 CEST 2015
BOOT_CLOJURE_VERSION=1.6.0
BOOT_VERSION=2.0.0-rc14
#App version: 2.0.0

Creating a new project, like:

$ lein new tenzing hallo-martin +reagent
Generating fresh 'lein new' tenzing project.

... results in failure:

$ cd hallo-martin/
$ boot
clojure.lang.ExceptionInfo: Unable to resolve symbol: tmp-path in this context
   data: {:file "adzerk/boot_reload.clj", :line 22}
java.lang.RuntimeException: Unable to resolve symbol: tmp-path in this context
                    ...
   clojure.core/load/fn                          core.clj: 5866
      clojure.core/load                          core.clj: 5865
                    ...
  clojure.core/load-one                          core.clj: 5671
clojure.core/load-lib/fn                          core.clj: 5711
  clojure.core/load-lib                          core.clj: 5710
                    ...
     clojure.core/apply                          core.clj:  632
 clojure.core/load-libs                          core.clj: 5749
                    ...
     clojure.core/apply                          core.clj:  632
   clojure.core/require                          core.clj: 5832
                    ...
      boot.user/eval248  boot.user6554720971515145768.clj:   17
                    ...
     boot.main/-main/fn                          main.clj:  158
        boot.main/-main                          main.clj:  158
                    ...
       boot.App.runBoot                          App.java:  231
          boot.App.main                          App.java:  338

on-jsreload should not point to init

Init should be reserved for state related initialization on page load. reload should be a different thing. Please consider having something like this:

(defn reload []
  (reagent/render-component [calling-component]
                            (.getElementById js/document "container")))

(defn init []
  (reload))

As even simple apps benefit from this distinction. (typically init contains "run once" semantics, and app state should be preserved through reloads).

+electron task template

https://github.com/Gonzih/cljs-electron seems like a really nice setup for electron development, but i really like tenzing.

from a quick glance at the project.clj file there, it looks like the main build tasks that make it tick are builds by filetype to the public folder, but i haven't gone much deeper into it yet.

what else would it take on the tenzing side?


edit: it looks like https://github.com/martinklepsch/electron-and-clojurescript is a good place to start from, so i guess i just need to go through the tenzing templates and work from there.

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.