This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-10-04
Channels
- # aleph (3)
- # beginners (37)
- # boot (45)
- # carry (1)
- # cljsrn (15)
- # clojure (78)
- # clojure-austin (2)
- # clojure-brasil (10)
- # clojure-czech (3)
- # clojure-dev (12)
- # clojure-dusseldorf (31)
- # clojure-hamburg (2)
- # clojure-italy (4)
- # clojure-poland (2)
- # clojure-russia (37)
- # clojure-spec (25)
- # clojure-uk (30)
- # clojurescript (160)
- # cursive (40)
- # data-science (1)
- # datomic (31)
- # emacs (7)
- # figwheel (4)
- # hoplon (73)
- # leiningen (1)
- # liberator (5)
- # luminus (7)
- # numerical-computing (1)
- # off-topic (31)
- # om (89)
- # onyx (66)
- # proton (5)
- # protorepl (1)
- # re-frame (18)
- # reagent (2)
- # ring (2)
- # spacemacs (1)
- # untangled (93)
- # vim (19)
- # yada (67)
Does anyone know if there is blog post or has anyone tried to get clojure + clojurescript + Electron + Om.next + boot to co-exist? tl;dr details posted to https://groups.google.com/forum/#!topic/clojurescript/_YMfU2tti6E
@rayk We have a pretty close setup: clojure + clojurescript + electron + internal ui framework + boot
Just read the groups post and we very similar project to what you described: the server is pretty lightweight (any heavy lifting is sent to the server) and the client has most of the code
@kenny Glad to hear that we are not off the beaten track…. Any tricks or catches to look out for… From a developer workflow point of view, would to keep the clojure repl in atom cause that works nice and the UI on in the browser… So folk can code across the whole code base without jumping between projects.
Fortunately, it's actually pretty straight forward and works pretty similarly to normal cljs dev
I recommend using https://github.com/binaryage/cljs-oops so you don't need to deal with Electron externs
Essentially the only task our server has is to persist the data to Datomic. We are using Datascript and Datomic so any time the client has a change that should be persisted the :tx-data
is sent via websocket to the server which transacts it to Datomic. The server then forwards the changes to all necessary connected clients to get "live" updates.
We build the app using electron-builder. cljs is compiled with :optimization
:advanced
and parameterized with closure-defines + adzerk/env
Thanks @kenny ditto on Datomic… and I will chekc out oops. Cursive is cool, I hope @cfleming keeps pushing and pans out for him, just too many years on IntelliJ and the further I can get away from maven feel the better… Hence I have love boot. If I could get my deftask in Cursive like the lein task appear I would be right back there…. Believe it is being worked on...
@kenny last time I looked, I think Cursive need a project.clj, So I use to created a little mapping project.clj so cursive would knew which boot task to run… It did work… I think I just wanted to simplify, get rid of another workaround… So soon as someone finished boot support I will be back
Yo: I have 'om-starter project' up. I added (print ...) in the .clj server file. Is there a way to see that print statement? My lein repl doesn't show it.
Hi, I have a configuration problem on my machine that has stopped me dead for 2 days. Seemingly out of the blue my projects won’t load - there is an error when the goog closure library is bootstrapping itself.
I have been generating projects using luminus, and I have been asking on the luminus channel, but no joy so far - I hope it’s OK to ask here, I’m not sure it’s related to luminus.
When I try to start any project (configured with figwheel in case that’s relevant) I get this in the browser console:
I really can’t think of anything on my system that has changed, but something must have - but I don’t know where to look. These were projects that were working last week.
Probably worth testing with some other templates if you can. Also worth double checking you've nothing in ~/.lein
that looks suspicious.
On the luminus side someone helpfully tried my exact steps and had no problem, so it’s not a bug with the template, it’s me all me.
https://github.com/swannodette/mies I think this is the preferred debugging template. Are you able to try it?
Maybe try pulling in Luminus cljs dependencies, and adding them to a require list of some kind. See if it breaks with them all added. Then comment out until it works.
@credulous there is a stack trace the starts with goog.require
, what does the source code look like for that first element of the trace?
Also: a chestnut template works for me, including the figwheel integration. So it’s certainly something with luminus (but again, I’m the only one who has the problem).
@credulous you’re not going back far enough
@credulous, try wiping any caches or old boot artefacts
@dnolen Thanks.. sorry for being thick in this stuff, the structure is still a bit opaque to me. The generated index.html loads a script: <script src="/js/app.js" type="text/javascript"></script>
@credulous if that doesn't help going back to an earlier, known good version and bisect
with hard problems that's often the only thing that works
var CLOSURE_UNCOMPILED_DEFINES = null;
if(typeof goog == "undefined") document.write('<script src="/js/out/goog/base.js"></script>');
document.write('<script src="/js/out/cljs_deps.js"></script>');
document.write('<script>if (typeof goog == "undefined") console.warn("ClojureScript could not load :main, did you forget to specify :asset-path?");</script>');
document.write('<script>goog.require("hello_world.app");</script>’)
@credulous so then examine the frames in stacktrace
@pesterhazy Where would I see caches or boot artefacts? Also, I can’t get a good version, even brand new projects fail
@credulous probably better asked in #boot
boot
doesn't usually leave old files behind
you could try a fresh checkout of your project in a separate directory
or try removing the target
dir
@credulous what I’m saying is, debug the stacktrace and see where undefined is actually showing up
@pesterhazy If I create a new project with lein new luminus hello-world +cljs
it exhibits this problem for me
also try wiping ~/.m2
and ~/.boot/cache
@credulous also you haven’t pasted the contents of /js/out/cljs_deps.js
also try a different browser ! 🙂 browser caches 🙂
@credulous so are there any undefined
s there? if not then I would do as I suggested - poke around in the stack and figure it out 🙂
What’s weird is that goog.moduleLoaderState_ is defined at the top of the try block with moduleName undefined
@credulous you realize the image you pasted is showing you the bug, right? 🙂
It certainly looks weird to me… but when I dove into that loadModuleFromSource it did an eval() on that
So I assumed there was something Very Very Clever going on with google closure passing around source code and evaling int
For some reason this doesn't work:
(case async-channel
ch1 (.debug js/console "ch1")
ch2 (.debug js/console "ch2"))
and fails with No matching clause: [object Object]
.
But this works:
(if (= async-channel ch1)
(.debug js/console "ch1")
(.debug js/console "ch2"))
What's the catch?@credulous I read through goog.base
, it seems that thenable.js
is considered a module, see goog.addDependency
@credulous when I look at deps.js
which includes all of Closure Libary’s dep graph - I see this seems impossible
@credulous make sure that your project dependencies aren’t messed up somehow
make sure there isn’t a conflict for Closure Compiler, Closure Library using whatever your build tool has for that
What you’re saying makes sense, except that this symptom is happening on virgin projects - right off of lein new
… so I don’t think it’s corrupted dependencies.
something impossible is happening - so start forming a theory about what in the chain is screwing things up
@credulous first thing I would look at of course is deps.js
and the goog.addDependency
line for thenable.js
OK, will do… thanks for the help. That all points to a bug in the template, which is really surprising to me because I’m the only one on the planet having this difficulty.
I did nothing except put a breakpoint inside deps.js and step into goog.addDependecy
@credulous another question is wether luminous caches assets
caching is automatically disabled if the chrome devtools are open IIRC
(when clicking reload)
I did mention trying a different browser a while ago
it’s a setting in devtools that is disabled by default
Where do people stand on reframe vs chestnut?
@rickmoynihan that's a false dichotomy
@noprompt since javelin cells implement IWatchable
they should play well with rum/reactive
mixin, haven't tried it myself
re-frame is an architecture + implementation of that architecture based on reagent, Chestnut is a template that tries to handle as much of the boilerplate as possible so it's easy to start clojure+clojurescript web dev
plexus: I suspected something like that - basically I'm asking for a colleague who wants to get started on front end stuff in cljs... (I've not played with clojurescript since maybe 2 years ago)
is anyone aware of a clojure syntax highlighter in clojurescript? preferably one that produces hiccup rather than html strings, I found glow https://github.com/venantius/glow/tree/master/src/glow but it looks like it’s tied to the jvm
If they just want to do frontend/cljs then I would say start with the Figwheel of re-frame template. Or start with the modern-cljs tutorials which use boot
thanks for the tip - appreciate its not a simple thing to answer
if you wanted to have a basic text editor in the browser, how would you implement it?
just depends, textarea is simplest, there are a variety of JS text editor widgets you can try as well
If you type into a textarea, do you have to submit a form or something in order for the server to be aware of what you've typed?
i was just wanting to make an online text editor that multiple people could "log in" to and work on at the same time
How to include two compiled cljs files on one page? I have two files both of them use reagent, when second one initialize reagent
var already initialized.
one way would be to make a 3rd project which just requires the two and specifies the build
anytime the idea of separate compilation crosses your mind - think of another idea and you will save yourself a lot of trouble 🙂