Git Product home page Git Product logo

cljs-electron's Introduction

License Build

Clojurified Electron

My attempt to recreate ClojureScript development workflow while developing desktop apps with electron.

What is currently included

  • ClojureScript (init script and ui code)
  • Figwheel for interactive development
  • Reagent for UI
  • Advanced compilation with externs inference in release compilation targets

Running it

npm install electron -g # install electron binaries

Terminal

lein cooper                      # compile cljs and start figwheel
electron .                       # start electron from another terminal

Emacs REPL

lein cljsbuild once

M-x cider-jack-in-cljs figwheel

electron .

Releasing

lein do clean, cljsbuild once frontend-release, cljsbuild once electron-release
electron . # start electron to test that everything works

After that you can follow distribution guide for the electron.

The easiest way to package an electron app is by using electron-packager:

npm install electron-packager -g                                            # install electron packager
electron-packager . HelloWorld --platform=darwin --arch=x64 --electron-version=1.4.8 # package it!

cljs-electron's People

Contributors

alexx-g avatar arronmabrey avatar austinc avatar elkiwy avatar gonzih avatar grinkers avatar joshuamiller avatar t3chnoboy avatar visibletrap 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cljs-electron's Issues

why is window background only white.

I execute "lein cooper" and "electron ." and hello-world window appear. but It has only white content.

Although I changed root-component in ui/core.clj, It has only white background.
figwheel mark appear but It is same.

How to set the Electron window title?

I can't figure out how to set the window title. I tried

1.updating index.html <title> tag,
2. (.setTitle ^js/electron.BrowserWindow @main-window "My App")
3. (.on ^js/electron.BrowserWindow @main-window "page-title-updated" (fn [e] (.preventDefault e)))

But none of those seem seem to work. I know this is more about Electron than cljs-electron, but I think it would be helpful to cljs-electron users :)

Rendering directly to Document body is discouraged

Hi @Gonzih ,

I really love the work you've put into this template, this is amazing.

But when I run it with the Emacs + nrepl based Figwheel repl the devConsole throws this error. It's not causing any hinderance but I'd really like to know what's expected by React-render method.

Thanks


Warning: react.inc.js 

 render(): Rendering components directly into document.body is discouraged, since its children are often manipulated by third-party scripts and browser extensions. This may lead to subtle reconciliation issues. Try rendering into a container element created for your app.

Document packaging steps

Just wanted to say this project was very helpful for getting me up and running. Any chance you could document a good route for packing this application for production.

Cider

How would one connect a repl via cider?

[newbie] how to start this template ?

I downloaded whole repo into my local, then install electron via npm install electron -g.
after that , I did "lein deps" in the right folder, then I try lein cooper
but terminal shows error
"
image
"
any configuration I should do before running lein cooper?

my env: windows 10 ,

*advice* electron api unclear interop

Really enjoying this project as a way of introducing myself to cljs and electron.

However it's a bit unclear how the electron.core calls the electron api in the renderer process. For example how would we be able to utilise the web-frame options or create menu objects?

Defining .-web-frame in the same way as .-BrowserWindow causes a compile error in the foreman task.

Figwheel error

I just cloned the project and performed all the steps in the README. On Windows, I needed to delete the env/fast-trampoline lines from the PROCFILE, and then it worked.

Only problem I'm having is a figwheel error related to output-dir, which I find baffling because I don't see any duplication in output-dir in the config, despite the error message. Have you encountered this?:

C:\Users\mark\Documents\GitHub\electron>foreman start
15:22:26 electron.1 | started with pid 14112
15:22:26 ui.1       | started with pid 10828
15:22:32 ui.1       | Figwheel: Cutting some fruit, just a sec ...
15:22:32 electron.1 | Watching for changes before compiling ClojureScript...
15:22:55 ui.1       | Figwheel: Validating the configuration found in project.clj
15:22:55 ui.1       | ------ Figwheel Configuration Error ------
15:22:55 ui.1       |
15:22:55 ui.1       |
15:22:55 ui.1       |
15:22:55 ui.1       | Error at [:cljsbuild :builds 2 :compiler :output-dir]
15:22:55 ui.1       | All ClojureScript build config :output-dir parameters should be unique
15:22:55 ui.1       |
15:22:55 ui.1       |
15:22:55 ui.1       |
15:22:55 ui.1       |   {:cljsbuild
15:22:55 ui.1       |
15:22:55 ui.1       |    {:builds
15:22:55 ui.1       |
15:22:55 ui.1       |     [{:compiler
15:22:55 ui.1       |
15:22:55 ui.1       |       {:output-to "resources/main.js"
15:22:55 ui.1       |
15:22:55 ui.1       |        :optimizations :simple
15:22:55 ui.1       |
15:22:55 ui.1       |        :pretty-print true
15:22:55 ui.1       |
15:22:55 ui.1       |        :cache-analysis true
15:22:55 ui.1       |
15:22:55 ui.1       |        :output-dir ...
15:22:55 ui.1       |
15:22:55 ui.1       |        ^----
15:22:55 ui.1       |
15:22:55 ui.1       |        }}]}}
15:22:55 ui.1       |
15:22:55 ui.1       |
15:22:55 ui.1       |
15:22:55 ui.1       |
15:22:55 ui.1       | -- Docs for key :output-dir --
15:22:55 ui.1       |
15:22:55 ui.1       | Sets the output directory for output files generated during
15:22:55 ui.1       | compilation.
15:22:55 ui.1       |
15:22:55 ui.1       | Defaults to  "out".
15:22:55 ui.1       |
15:22:55 ui.1       |   :output-dir "resources/public/js/out"
15:22:55 ui.1       |
15:22:55 ui.1       |
15:22:55 ui.1       |
15:22:55 ui.1       | ------------------------------------------
15:22:55 ui.1       |
15:22:55 ui.1       |
15:22:55 ui.1       |
15:22:55 ui.1       | Figwheel: There are errors in your configuration file - project.clj
15:22:55 ui.1       | Figwheel: Would you like to ...
15:22:55 ui.1       | (f)ix the error live while Figwheel watches for config changes?
15:22:55 ui.1       | (q)uit and fix your configuration?
15:22:55 ui.1       | (s)tart Figwheel anyway?
q
15:24:24 ui.1       | exited with code 0
15:24:24 system     | sending SIGKILL to all processes
15:24:24 system     | sending SIGKILL to electron.1 at pid 14112
15:24:24 electron.1 | exited with code 0

Compile warning on Hello World

Hi there & thanks for this project!

When I clone this repo and run the default example, then try to change text in ui/core.cljs (for instance, replace the "Electron" string, I get the following compiler error:

screen shot 2017-08-06 at 1 57 25 pm

I don't need access to the file system just now, and once I comment out the run-process form and delete the the input where it is used, everything is fine, so it isn't a blocker for me or anything. Just wanted to let you know. 😃

foreman error

While starting on a brand new project, the foreman ui process fails to work correctly.
This happens with any project name.
The version of Java is openjdk version 1.8.0_111.

➜ darude git:(master) foreman start
13:19:23 electron.1 | started with pid 6273
13:19:23 ui.1 | started with pid 6274
13:19:33 ui.1 | Figwheel: Starting server at http://localhost:3449
13:19:33 ui.1 | Figwheel: Watching build - frontend-dev
13:19:33 ui.1 | Compiling "resources/public/js/ui-core.js" from ["ui_src" "dev_src"]...
13:19:34 ui.1 | Successfully compiled "resources/public/js/ui-core.js" in 0.836 seconds.
13:19:34 ui.1 | clojure.lang.ExceptionInfo: Error in component :figwheel-system in system com.stuartsierra.component.SystemMap calling #'com.stuartsierra.component/start {:reason :com.stuartsierra.component/component-function-threw-exception, :function #'com.stuartsierra.component/start, :system-key :figwheel-system, :component #figwheel_sidecar.system.FigwheelSystem{:system #object[clojure.lang.Atom 0x447d14a9 {:status :ready, :val #}]}, :system #}
13:19:34 ui.1 | at clojure.core$ex_info.invokeStatic(core.clj:4617)
13:19:34 ui.1 | at clojure.core$ex_info.invoke(core.clj:4617)
13:19:34 ui.1 | at com.stuartsierra.component$try_action.invokeStatic(component.cljc:119)
13:19:34 ui.1 | at com.stuartsierra.component$try_action.invoke(component.cljc:116)
13:19:34 ui.1 | at com.stuartsierra.component$update_system$fn__16511.invoke(component.cljc:139)
13:19:34 ui.1 | at clojure.lang.ArraySeq.reduce(ArraySeq.java:109)
13:19:34 ui.1 | at clojure.core$reduce.invokeStatic(core.clj:6544)
13:19:34 ui.1 | at clojure.core$reduce.invoke(core.clj:6527)
13:19:34 ui.1 | at com.stuartsierra.component$update_system.invokeStatic(component.cljc:135)
13:19:34 ui.1 | at com.stuartsierra.component$update_system.doInvoke(component.cljc:129)
13:19:34 ui.1 | at clojure.lang.RestFn.invoke(RestFn.java:445)
13:19:34 ui.1 | at com.stuartsierra.component$start_system.invokeStatic(component.cljc:163)
13:19:34 ui.1 | at com.stuartsierra.component$start_system.invoke(component.cljc:155)
13:19:34 ui.1 | at com.stuartsierra.component$start_system.invokeStatic(component.cljc:161)
13:19:34 ui.1 | at com.stuartsierra.component$start_system.invoke(component.cljc:155)
13:19:34 ui.1 | at com.stuartsierra.component.SystemMap.start(component.cljc:178)
13:19:34 ui.1 | at figwheel_sidecar.system$start_figwheel_BANG_.invokeStatic(system.clj:588)
13:19:34 ui.1 | at figwheel_sidecar.system$start_figwheel_BANG_.invoke(system.clj:585)
13:19:34 ui.1 | at figwheel_sidecar.repl_api$start_figwheel_from_lein.invokeStatic(repl_api.clj:137)
13:19:34 ui.1 | at figwheel_sidecar.repl_api$start_figwheel_from_lein.invoke(repl_api.clj:136)
13:19:34 ui.1 | at user$eval18236.invokeStatic(3a21556c5edadad4510d86eef7e49e6a47c707f3-init.clj:1)
13:19:34 ui.1 | at user$eval18236.invoke(3a21556c5edadad4510d86eef7e49e6a47c707f3-init.clj:1)
13:19:34 ui.1 | at clojure.lang.Compiler.eval(Compiler.java:6927)➜ darude git:(master) foreman start
13:19:23 electron.1 | started with pid 6273
13:19:23 ui.1 | started with pid 6274
13:19:33 ui.1 | Figwheel: Starting server at http://localhost:3449
13:19:33 ui.1 | Figwheel: Watching build - frontend-dev
13:19:33 ui.1 | Compiling "resources/public/js/ui-core.js" from ["ui_src" "dev_src"]...
13:19:34 ui.1 | Successfully compiled "resources/public/js/ui-core.js" in 0.836 seconds.
13:19:34 ui.1 | clojure.lang.ExceptionInfo: Error in component :figwheel-system in system com.stuartsierra.component.SystemMap calling #'com.stuartsierra.component/start {:reason :com.stuartsierra.component/component-function-threw-exception, :function #'com.stuartsierra.component/start, :system-key :figwheel-system, :component #figwheel_sidecar.system.FigwheelSystem{:system #object[clojure.lang.Atom 0x447d14a9 {:status :ready, :val #}]}, :system #}
13:19:34 ui.1 | at clojure.core$ex_info.invokeStatic(core.clj:4617)
13:19:34 ui.1 | at clojure.core$ex_info.invoke(core.clj:4617)
13:19:34 ui.1 | at com.stuartsierra.component$try_action.invokeStatic(component.cljc:119)
13:19:34 ui.1 | at com.stuartsierra.component$try_action.invoke(component.cljc:116)
13:19:34 ui.1 | at com.stuartsierra.component$update_system$fn__16511.invoke(component.cljc:139)
13:19:34 ui.1 | at clojure.lang.ArraySeq.reduce(ArraySeq.java:109)
13:19:34 ui.1 | at clojure.core$reduce.invokeStatic(core.clj:6544)
13:19:34 ui.1 | at clojure.core$reduce.invoke(core.clj:6527)
13:19:34 ui.1 | at com.stuartsierra.component$update_system.invokeStatic(component.cljc:135)
13:19:34 ui.1 | at com.stuartsierra.component$update_system.doInvoke(component.cljc:129)
13:19:34 ui.1 | at clojure.lang.RestFn.invoke(RestFn.java:445)
13:19:34 ui.1 | at com.stuartsierra.component$start_system.invokeStatic(component.cljc:163)
13:19:34 ui.1 | at com.stuartsierra.component$start_system.invoke(component.cljc:155)
13:19:34 ui.1 | at com.stuartsierra.component$start_system.invokeStatic(component.cljc:161)
13:19:34 ui.1 | at com.stuartsierra.component$start_system.invoke(component.cljc:155)
13:19:34 ui.1 | at com.stuartsierra.component.SystemMap.start(component.cljc:178)
13:19:34 ui.1 | at figwheel_sidecar.system$start_figwheel_BANG_.invokeStatic(system.clj:588)
13:19:34 ui.1 | at figwheel_sidecar.system$start_figwheel_BANG_.invoke(system.clj:585)
13:19:34 ui.1 | at figwheel_sidecar.repl_api$start_figwheel_from_lein.invokeStatic(repl_api.clj:137)
13:19:34 ui.1 | at figwheel_sidecar.repl_api$start_figwheel_from_lein.invoke(repl_api.clj:136)
13:19:34 ui.1 | at user$eval18236.invokeStatic(3a21556c5edadad4510d86eef7e49e6a47c707f3-init.clj:1)
13:19:34 ui.1 | at user$eval18236.invoke(3a21556c5edadad4510d86eef7e49e6a47c707f3-init.clj:1)
13:19:34 ui.1 | at clojure.lang.Compiler.eval(Compiler.java:6927)
13:19:34 ui.1 | at clojure.lang.Compiler.eval(Compiler.java:6917)
13:19:34 ui.1 | at clojure.lang.Compiler.load(Compiler.java:7379)
13:19:34 ui.1 | at clojure.lang.Compiler.loadFile(Compiler.java:7317)
13:19:34 ui.1 | at clojure.main$load_script.invokeStatic(main.clj:275)
13:19:34 ui.1 | at clojure.main$init_opt.invokeStatic(main.clj:277)
13:19:34 ui.1 | at clojure.main$init_opt.invoke(main.clj:277)
13:19:34 ui.1 | at clojure.main$initialize.invokeStatic(main.clj:308)
13:19:34 ui.1 | at clojure.main$null_opt.invokeStatic(main.clj:342)
13:19:34 ui.1 | at clojure.main$null_opt.invoke(main.clj:339)
13:19:34 ui.1 | at clojure.main$main.invokeStatic(main.clj:421)
13:19:34 ui.1 | at clojure.main$main.doInvoke(main.clj:384)
13:19:34 ui.1 | at clojure.lang.RestFn.invoke(RestFn.java:421)
13:19:34 ui.1 | at clojure.lang.Var.invoke(Var.java:383)
13:19:34 ui.1 | at clojure.lang.AFn.applyToHelper(AFn.java:156)
13:19:34 ui.1 | at clojure.lang.Var.applyTo(Var.java:700)
13:19:34 ui.1 | at clojure.main.main(main.java:37)
13:19:34 ui.1 | Caused by: clojure.lang.ExceptionInfo: Error in component autobuild-frontend-dev in system com.stuartsierra.component.SystemMap calling #'com.stuartsierra.component/start {:reason :com.stuartsierra.component/component-function-threw-exception, :function #'com.stuartsierra.component/start, :system-key "autobuild-frontend-dev", :component #figwheel_sidecar.components.cljs_autobuild.CLJSAutobuild{:build-config {:source-paths ["ui_src" "dev_src"], :id "frontend-dev", :build-options {:output-to "resources/public/js/ui-core.js", :output-dir "resources/public/js/ui-out", :source-map true, :asset-path "js/ui-out", :optimizations :none, :cache-analysis true, :main "dev.core"}, :compiler-env #object[clojure.lang.Atom 0x7ba9104f {:status :ready, :val #CompilerEnv{}}]}, :figwheel-server #figwheel_sidecar.components.figwheel_server.FigwheelServer{:connection-count #object[clojure.lang.Atom 0x617b1e76 {:status :ready, :val {}}], :browser-callbacks #object[clojure.lang.Atom 0x4d0f96ac {:status :ready, :val {}}], :ring-handler tools.figwheel-middleware/app, :file-change-atom #object[clojure.lang.Atom 0x4f880f30 {:status :ready, :val ()}], :compile-wait-time 10, :builds {"electron-dev" {:source-paths ["electron_src"], :id "electron-dev", :build-options {:output-to "resources/main.js", :optimizations :simple, :pretty-print true, :cache-analysis true, :output-dir "resources/out"}, :compiler-env #object[clojure.lang.Atom 0x7c9055e6 {:status :ready, :val #CompilerEnv{}}]}, "frontend-dev" {:source-paths ["ui_src" "dev_src"], :id "frontend-dev", :build-options {:output-to "resources/public/js/ui-core.js", :output-dir "resources/public/js/ui-out", :source-map true, :asset-path "js/ui-out", :optimizations :none, :cache-analysis true, :main "dev.core"}, :compiler-env #object[clojure.lang.Atom 0x7ba9104f {:status :ready, :val #CompilerEnv{}}]}, "electron-release" {:source-paths ["electron_src"], :id "electron-release", :build-options {:output-to "resources/main.js", :optimizations :simple, :pretty-print true, :cache-analysis true, :output-dir "resources/out"}, :compiler-env #object[clojure.lang.Atom 0x45a16cac {:status :ready, :val #CompilerEnv{}}]}, "frontend-release" {:source-paths ["ui_src"], :id "frontend-release", :build-options {:output-to "resources/public/js/ui-core.js", :output-dir "resources/public/js/ui-release-out", :source-map "resources/public/js/ui-core.js.map", :optimizations :simple, :cache-analysis true, :main "ui.core"}, :compiler-env #object[clojure.lang.Atom 0x74aa2842 {:status :ready, :val #CompilerEnv{}}]}}, :server-port 3449, :resolved-ring-handler #'tools.figwheel-middleware/app, :server-ip nil, :cljs-build-fn #object[figwheel_sidecar.components.cljs_autobuild$eval17988$figwheel_start_and_end_messages__17991$fn__17993 0x5951d91 "figwheel_sidecar.components.cljs_autobuild$eval17988$figwheel_start_and_end_messages__17991$fn__17993@5951d91"], :http-server #object[clojure.lang.AFunction$1 0x371c8e30 "clojure.lang.AFunction$1@371c8e30"], :open-file-command nil, :unique-id "/home/mtweddell/MEGA/MEGAsync/2016/Computer Science/ComputerScienceIA/darude", :log-writer #object[java.io.BufferedWriter 0x1ac864d7 "java.io.BufferedWriter@1ac864d7"], :file-md5-atom #object[clojure.lang.Atom 0x2fce09c0 {:status :ready, :val {}}], :http-server-root "public"}}, :system #}
13:19:34 ui.1 | at clojure.core$ex_info.invokeStatic(core.clj:4617)
13:19:34 ui.1 | at clojure.core$ex_info.invoke(core.clj:4617)
13:19:34 ui.1 | at com.stuartsierra.component$try_action.invokeStatic(component.cljc:119)
13:19:34 ui.1 | at com.stuartsierra.component$try_action.invoke(component.cljc:116)
13:19:34 ui.1 | at com.stuartsierra.component$update_system$fn__16511.invoke(component.cljc:139)
13:19:34 ui.1 | at clojure.lang.ArraySeq.reduce(ArraySeq.java:114)
13:19:34 ui.1 | at clojure.core$reduce.invokeStatic(core.clj:6544)
13:19:34 ui.1 | at clojure.core$reduce.invoke(core.clj:6527)
13:19:34 ui.1 | at com.stuartsierra.component$update_system.invokeStatic(component.cljc:135)
13:19:34 ui.1 | at com.stuartsierra.component$update_system.doInvoke(component.cljc:129)
13:19:34 ui.1 | at clojure.lang.RestFn.invoke(RestFn.java:445)
13:19:34 ui.1 | at com.stuartsierra.component$start_system.invokeStatic(component.cljc:163)
13:19:34 ui.1 | at com.stuartsierra.component$start_system.invoke(component.cljc:155)
13:19:34 ui.1 | at com.stuartsierra.component$start_system.invokeStatic(component.cljc:161)
13:19:34 ui.1 | at com.stuartsierra.component$start_system.invoke(component.cljc:155)
13:19:34 ui.1 | at com.stuartsierra.component.SystemMap.start(component.cljc:178)
13:19:34 ui.1 | at com.stuartsierra.component$eval16452$fn__16453$G__16442__16455.invoke(component.cljc:5)
13:19:34 ui.1 | at com.stuartsierra.component$eval16452$fn__16453$G__16441__16458.invoke(component.cljc:5)
13:19:34 ui.1 | at clojure.lang.Atom.swap(Atom.java:37)
13:19:34 ui.1 | at clojure.core$swap_BANG_.invokeStatic(core.clj:2260)
13:19:34 ui.1 | at clojure.core$swap_BANG_.invoke(core.clj:2253)
13:19:34 ui.1 | at figwheel_sidecar.system.FigwheelSystem.start(system.clj:119)
13:19:34 ui.1 | at com.stuartsierra.component$eval16452$fn__16453$G__16442__16455.invoke(component.cljc:5)
13:19:34 ui.1 | at com.stuartsierra.component$eval16452$fn__16453$G__16441__16458.invoke(component.cljc:5)
13:19:34 ui.1 | at clojure.lang.Var.invoke(Var.java:379)
13:19:34 ui.1 | at clojure.lang.AFn.applyToHelper(AFn.java:154)
13:19:34 ui.1 | at clojure.lang.Var.applyTo(Var.java:700)
13:19:34 ui.1 | at clojure.core$apply.invokeStatic(core.clj:648)
13:19:34 ui.1 | at clojure.core$apply.invoke(core.clj:641)
13:19:34 ui.1 | at com.stuartsierra.component$try_action.invokeStatic(component.cljc:117)
13:19:34 ui.1 | ... 36 more
13:19:34 ui.1 | Caused by: java.io.IOException: User limit of inotify watches reached
13:19:34 ui.1 | at sun.nio.fs.LinuxWatchService$Poller.implRegister(LinuxWatchService.java:264)
13:19:34 ui.1 | at sun.nio.fs.AbstractPoller.processRequests(AbstractPoller.java:260)
13:19:34 ui.1 | at sun.nio.fs.LinuxWatchService$Poller.run(LinuxWatchService.java:329)
13:19:34 ui.1 | at java.lang.Thread.run(Thread.java:745)
13:19:35 ui.1 | exited with code 1
13:19:35 system | sending SIGTERM to all processes
13:19:35 electron.1 | exited with code 143

13:19:34 ui.1 | at clojure.lang.Compiler.eval(Compiler.java:6917)
13:19:34 ui.1 | at clojure.lang.Compiler.load(Compiler.java:7379)
13:19:34 ui.1 | at clojure.lang.Compiler.loadFile(Compiler.java:7317)
13:19:34 ui.1 | at clojure.main$load_script.invokeStatic(main.clj:275)
13:19:34 ui.1 | at clojure.main$init_opt.invokeStatic(main.clj:277)
13:19:34 ui.1 | at clojure.main$init_opt.invoke(main.clj:277)
13:19:34 ui.1 | at clojure.main$initialize.invokeStatic(main.clj:308)
13:19:34 ui.1 | at clojure.main$null_opt.invokeStatic(main.clj:342)
13:19:34 ui.1 | at clojure.main$null_opt.invoke(main.clj:339)
13:19:34 ui.1 | at clojure.main$main.invokeStatic(main.clj:421)
13:19:34 ui.1 | at clojure.main$main.doInvoke(main.clj:384)
13:19:34 ui.1 | at clojure.lang.RestFn.invoke(RestFn.java:421)
13:19:34 ui.1 | at clojure.lang.Var.invoke(Var.java:383)
13:19:34 ui.1 | at clojure.lang.AFn.applyToHelper(AFn.java:156)
13:19:34 ui.1 | at clojure.lang.Var.applyTo(Var.java:700)
13:19:34 ui.1 | at clojure.main.main(main.java:37)
13:19:34 ui.1 | Caused by: clojure.lang.ExceptionInfo: Error in component autobuild-frontend-dev in system com.stuartsierra.component.SystemMap calling #'com.stuartsierra.component/start {:reason :com.stuartsierra.component/component-function-threw-exception, :function #'com.stuartsierra.component/start, :system-key "autobuild-frontend-dev", :component #figwheel_sidecar.components.cljs_autobuild.CLJSAutobuild{:build-config {:source-paths ["ui_src" "dev_src"], :id "frontend-dev", :build-options {:output-to "resources/public/js/ui-core.js", :output-dir "resources/public/js/ui-out", :source-map true, :asset-path "js/ui-out", :optimizations :none, :cache-analysis true, :main "dev.core"}, :compiler-env #object[clojure.lang.Atom 0x7ba9104f {:status :ready, :val #CompilerEnv{}}]}, :figwheel-server #figwheel_sidecar.components.figwheel_server.FigwheelServer{:connection-count #object[clojure.lang.Atom 0x617b1e76 {:status :ready, :val {}}], :browser-callbacks #object[clojure.lang.Atom 0x4d0f96ac {:status :ready, :val {}}], :ring-handler tools.figwheel-middleware/app, :file-change-atom #object[clojure.lang.Atom 0x4f880f30 {:status :ready, :val ()}], :compile-wait-time 10, :builds {"electron-dev" {:source-paths ["electron_src"], :id "electron-dev", :build-options {:output-to "resources/main.js", :optimizations :simple, :pretty-print true, :cache-analysis true, :output-dir "resources/out"}, :compiler-env #object[clojure.lang.Atom 0x7c9055e6 {:status :ready, :val #CompilerEnv{}}]}, "frontend-dev" {:source-paths ["ui_src" "dev_src"], :id "frontend-dev", :build-options {:output-to "resources/public/js/ui-core.js", :output-dir "resources/public/js/ui-out", :source-map true, :asset-path "js/ui-out", :optimizations :none, :cache-analysis true, :main "dev.core"}, :compiler-env #object[clojure.lang.Atom 0x7ba9104f {:status :ready, :val #CompilerEnv{}}]}, "electron-release" {:source-paths ["electron_src"], :id "electron-release", :build-options {:output-to "resources/main.js", :optimizations :simple, :pretty-print true, :cache-analysis true, :output-dir "resources/out"}, :compiler-env #object[clojure.lang.Atom 0x45a16cac {:status :ready, :val #CompilerEnv{}}]}, "frontend-release" {:source-paths ["ui_src"], :id "frontend-release", :build-options {:output-to "resources/public/js/ui-core.js", :output-dir "resources/public/js/ui-release-out", :source-map "resources/public/js/ui-core.js.map", :optimizations :simple, :cache-analysis true, :main "ui.core"}, :compiler-env #object[clojure.lang.Atom 0x74aa2842 {:status :ready, :val #CompilerEnv{}}]}}, :server-port 3449, :resolved-ring-handler #'tools.figwheel-middleware/app, :server-ip nil, :cljs-build-fn #object[figwheel_sidecar.components.cljs_autobuild$eval17988$figwheel_start_and_end_messages__17991$fn__17993 0x5951d91 "figwheel_sidecar.components.cljs_autobuild$eval17988$figwheel_start_and_end_messages__17991$fn__17993@5951d91"], :http-server #object[clojure.lang.AFunction$1 0x371c8e30 "clojure.lang.AFunction$1@371c8e30"], :open-file-command nil, :unique-id "/home/mtweddell/MEGA/MEGAsync/2016/Computer Science/ComputerScienceIA/darude", :log-writer #object[java.io.BufferedWriter 0x1ac864d7 "java.io.BufferedWriter@1ac864d7"], :file-md5-atom #object[clojure.lang.Atom 0x2fce09c0 {:status :ready, :val {}}], :http-server-root "public"}}, :system #}
13:19:34 ui.1 | at clojure.core$ex_info.invokeStatic(core.clj:4617)
13:19:34 ui.1 | at clojure.core$ex_info.invoke(core.clj:4617)
13:19:34 ui.1 | at com.stuartsierra.component$try_action.invokeStatic(component.cljc:119)
13:19:34 ui.1 | at com.stuartsierra.component$try_action.invoke(component.cljc:116)
13:19:34 ui.1 | at com.stuartsierra.component$update_system$fn__16511.invoke(component.cljc:139)
13:19:34 ui.1 | at clojure.lang.ArraySeq.reduce(ArraySeq.java:114)
13:19:34 ui.1 | at clojure.core$reduce.invokeStatic(core.clj:6544)
13:19:34 ui.1 | at clojure.core$reduce.invoke(core.clj:6527)
13:19:34 ui.1 | at com.stuartsierra.component$update_system.invokeStatic(component.cljc:135)
13:19:34 ui.1 | at com.stuartsierra.component$update_system.doInvoke(component.cljc:129)
13:19:34 ui.1 | at clojure.lang.RestFn.invoke(RestFn.java:445)
13:19:34 ui.1 | at com.stuartsierra.component$start_system.invokeStatic(component.cljc:163)
13:19:34 ui.1 | at com.stuartsierra.component$start_system.invoke(component.cljc:155)
13:19:34 ui.1 | at com.stuartsierra.component$start_system.invokeStatic(component.cljc:161)
13:19:34 ui.1 | at com.stuartsierra.component$start_system.invoke(component.cljc:155)
13:19:34 ui.1 | at com.stuartsierra.component.SystemMap.start(component.cljc:178)
13:19:34 ui.1 | at com.stuartsierra.component$eval16452$fn__16453$G__16442__16455.invoke(component.cljc:5)
13:19:34 ui.1 | at com.stuartsierra.component$eval16452$fn__16453$G__16441__16458.invoke(component.cljc:5)
13:19:34 ui.1 | at clojure.lang.Atom.swap(Atom.java:37)
13:19:34 ui.1 | at clojure.core$swap_BANG_.invokeStatic(core.clj:2260)
13:19:34 ui.1 | at clojure.core$swap_BANG_.invoke(core.clj:2253)
13:19:34 ui.1 | at figwheel_sidecar.system.FigwheelSystem.start(system.clj:119)
13:19:34 ui.1 | at com.stuartsierra.component$eval16452$fn__16453$G__16442__16455.invoke(component.cljc:5)
13:19:34 ui.1 | at com.stuartsierra.component$eval16452$fn__16453$G__16441__16458.invoke(component.cljc:5)
13:19:34 ui.1 | at clojure.lang.Var.invoke(Var.java:379)
13:19:34 ui.1 | at clojure.lang.AFn.applyToHelper(AFn.java:154)
13:19:34 ui.1 | at clojure.lang.Var.applyTo(Var.java:700)
13:19:34 ui.1 | at clojure.core$apply.invokeStatic(core.clj:648)
13:19:34 ui.1 | at clojure.core$apply.invoke(core.clj:641)
13:19:34 ui.1 | at com.stuartsierra.component$try_action.invokeStatic(component.cljc:117)
13:19:34 ui.1 | ... 36 more
13:19:34 ui.1 | Caused by: java.io.IOException: User limit of inotify watches reached
13:19:34 ui.1 | at sun.nio.fs.LinuxWatchService$Poller.implRegister(LinuxWatchService.java:264)
13:19:34 ui.1 | at sun.nio.fs.AbstractPoller.processRequests(AbstractPoller.java:260)
13:19:34 ui.1 | at sun.nio.fs.LinuxWatchService$Poller.run(LinuxWatchService.java:329)
13:19:34 ui.1 | at java.lang.Thread.run(Thread.java:745)
13:19:35 ui.1 | exited with code 1
13:19:35 system | sending SIGTERM to all processes
13:19:35 electron.1 | exited with code 143

Live Changes not appearing live in Electron

Hey there!

Great project. Very easy to get up and running.

One issue I'm having: Figwheel doesn't appear to be working correctly.

After saving my code, I wait a few seconds and then see the CLJS logo appear in the bottom-left corner, but the UI doesn't change. I need to hard-refresh in order to see my changes appear in the UI.

Any tips in chasing this one down?

Many thanks!

Help adding a

I'm really enjoying playing around with this template, but need some help, probably because I am still rather new to the cljs tooling ecosystem used here.

I have an idea for a program I would like to use for work, but it requires somewhat intensive processing of a large number of pdfs. Based on this article, I think I should have that happen in a separate process that the main process communicates with.

So I added a "pdf_src" directory, put in a pdf.core namespace, and added the following to the :builds defined in project.clj :
{:source-paths ["pdf_src"] :id "pdf-dev" :compiler {:output-to "resources/pdf.js" :output-dir "resources/public/js/pdf-dev" :optimizations :simple :pretty-print true :cache-analysis true}}

I added pdf: env LEIN_FAST_TRAMPOLINE=y lein trampoline cljsbuild auto pdf-dev to the procfile.

My goal is to put the code for the background tasks in the pdf.js file and then fork a node process to run that file from main.

But running lein cooper gives me a whole stack of compilation errors.

Compiling ["resources/pdf.js"] failed. clojure.lang.ExceptionInfo: null #:clojure.error{:phase :compilation} at cljs.util$compilation_error.invokeStatic(util.cljc:23) at cljs.util$compilation_error.invoke(util.cljc:22) at cljs.closure$write_js_QMARK_.invokeStatic(closure.clj:2058) at cljs.closure$write_js_QMARK_.invoke(closure.clj:2047) at cljs.closure$source_on_disk.invokeStatic(closure.clj:2064) at cljs.closure$source_on_disk.invoke(closure.clj:2060) at cljs.closure$build$fn__6208.invoke(closure.clj:3020) at clojure.core$map$fn__5851.invoke(core.clj:2755) at clojure.lang.LazySeq.sval(LazySeq.java:42) at clojure.lang.LazySeq.seq(LazySeq.java:51) at clojure.lang.Cons.next(Cons.java:39) at clojure.lang.RT.next(RT.java:709) at clojure.core$next__5371.invokeStatic(core.clj:64) at clojure.core$dorun.invokeStatic(core.clj:3142) at clojure.core$doall.invokeStatic(core.clj:3148) at clojure.core$doall.invoke(core.clj:3148) at cljs.closure$build.invokeStatic(closure.clj:3020) at cljs.closure$build.invoke(closure.clj:2919) at cljs.build.api$build.invokeStatic(api.clj:208) at cljs.build.api$build.invoke(api.clj:189) at cljs.build.api$build.invokeStatic(api.clj:195) at cljs.build.api$build.invoke(api.clj:189) at cljsbuild.compiler$compile_cljs$fn__709.invoke(compiler.clj:61) at cljsbuild.compiler$compile_cljs.invokeStatic(compiler.clj:60) at cljsbuild.compiler$compile_cljs.invoke(compiler.clj:48) at cljsbuild.compiler$run_compiler.invokeStatic(compiler.clj:168) at cljsbuild.compiler$run_compiler.invoke(compiler.clj:129) at user$eval838$iter__886__890$fn__891$fn__917.invoke(form-init7740181582868617844.clj:1) at user$eval838$iter__886__890$fn__891.invoke(form-init7740181582868617844.clj:1) at clojure.lang.LazySeq.sval(LazySeq.java:42) at clojure.lang.LazySeq.seq(LazySeq.java:51) at clojure.lang.RT.seq(RT.java:531) at clojure.core$seq__5387.invokeStatic(core.clj:137) at clojure.core$dorun.invokeStatic(core.clj:3133) at clojure.core$doall.invokeStatic(core.clj:3148) at clojure.core$doall.invoke(core.clj:3148) at user$eval838.invokeStatic(form-init7740181582868617844.clj:1) at user$eval838.invoke(form-init7740181582868617844.clj:1) at clojure.lang.Compiler.eval(Compiler.java:7176) at clojure.lang.Compiler.eval(Compiler.java:7166) at clojure.lang.Compiler.load(Compiler.java:7635) at clojure.lang.Compiler.loadFile(Compiler.java:7573) at clojure.main$load_script.invokeStatic(main.clj:452) at clojure.main$init_opt.invokeStatic(main.clj:454) at clojure.main$init_opt.invoke(main.clj:454) at clojure.main$initialize.invokeStatic(main.clj:485) at clojure.main$null_opt.invokeStatic(main.clj:519) at clojure.main$null_opt.invoke(main.clj:516) at clojure.main$main.invokeStatic(main.clj:598) at clojure.main$main.doInvoke(main.clj:561) at clojure.lang.RestFn.applyTo(RestFn.java:137) at clojure.lang.Var.applyTo(Var.java:705) at clojure.main.main(main.java:37) Caused by: java.lang.Exception: Could not write JavaScript nil ... 51 more Subprocess failed

What am I missing? Any help would be much appreciated.

Question: live-reloading electron-dev

Above all, thank you very much for this great info.

I know that this question is not appopriate here.

I am so sorry about that but I have no choice but to write here.

My question is as follows.

Live-reloading frontend-dev works well by using figwheel but
do you happen to know how to live-relaod electron-dev?

lean cooper command failing

Hi,

I have cloned the repo, ran npm install electron-prebuilt -g but then when I run the lein cooper command i get the following stack trace:
image

If I run: lein trampoline cljsbuild auto electron-dev and lein trampoline figwheel frontend-dev separately it works fine until I want to make any changes and re-run the application. It will then hang on Waiting for changes..

Apologies for my gap in knowledge. I am new to using clojure in this way.

How to create a simpler template

Hi @Gonzih , have another question regarding the template.

Clearly this is a production level template - what I really want to know is to create a bare-essential template. I've tried experimenting with the various configurations but I can't get past the dev.core hurdle.

Could you, please help me create a much simpler template, for practice.

Thanks, looking forward to the response.

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.