This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-06-29
Channels
- # aleph (2)
- # architecture (1)
- # beginners (5)
- # boot (7)
- # cider (24)
- # clara (28)
- # cljs-dev (7)
- # cljsjs (3)
- # cljsrn (24)
- # clojure (145)
- # clojure-italy (2)
- # clojure-nl (7)
- # clojure-uk (54)
- # clojurescript (159)
- # cursive (49)
- # data-science (8)
- # datomic (23)
- # editors (10)
- # emacs (2)
- # fulcro (123)
- # graphql (12)
- # hoplon (2)
- # java (23)
- # jobs (1)
- # jobs-discuss (2)
- # leiningen (17)
- # mount (5)
- # nrepl (5)
- # off-topic (20)
- # om (2)
- # onyx (25)
- # parinfer (2)
- # pedestal (1)
- # re-frame (8)
- # reagent (7)
- # ring-swagger (1)
- # shadow-cljs (24)
- # spacemacs (7)
- # specter (6)
- # tools-deps (7)
- # vim (2)
trying to follow the clojurescript quick start and not getting a repl prompt. Any idea how to debug? Get the "hello world!" and the web page but that's where it stops
it goes into repl if I omit both the --main cljs.main and the --compile hello-world.core parts
@vigilancetech try to add -r
at the end of the command without removing compile and main
@richiardiandrea it already has --repl at the end
Oh ok, in that case I would not know what's wrong then..
probably some corrupt file or library. I've reinstalled everything I can think of
other than the whole OS
@vigilancetech there are ways to debug this, try cljs --main cljs.main
when the browser pops open you should look at the browser console log for errors
Also I happen to be working on a quick start doc for figwheel.main
http://rigsomelight.com/figwheel-main/quick_start.html it may help you get up and running.
the document is in it's very early stages and isn't complete but you should be able to get a working REPL
Can I get om-next to normalise nested lists into its default db format? I currently have a list of persons where each has a list of contact-persons and om-next only normalises the top level person list when loading its app state.
@andreasklein I don't know the answer but there is an active #om channel
@bhauman thank you. I will ask around there. There is also a dead? #om-next channel
question about cljs.main
: i’m trying out the ghostwheel tool for the first time and I’m supposed to pass a compiler option to get it to run. is this the right way of doing it? clj --main cljs.main -co "{:ghostwheel true}" --compile tst.core --repl
I’ve never passed an arbitrary compiler option to a library like this before
I’m worried I’m doing this wrong because the cljs.main web page uses it by calling directly to java rather than clj
Hi. I’m trying to jack-in
clojurescript repl. it seems like it’s all working fine - it says connected
at the bottom of the screen but when I try to evaluate anything, it says that I need to jack-in clojurescript repl
@lee.justin.m That's right. :thumbsup: I didn't realize arbitrary compiler parameters could be used like that, but that matches up to what the ghostwheel readme says to to.
Has anyone run across javascript like this:
exports.default = exampleFunction;
module.exports = exports['default'];
I'm not sure why the convention exists, but the cljs compiler doesn't consume it properly:
Uncaught TypeError: Cannot set property 'default' of undefined
Here's an example of the output it generates. (It tried to define ['default']['default']
and then later define ['default']
as that values.)
goog.provide("module$data$prs$dev$timesheet$node_modules$inline_style_prefixer$utils$isObject");
goog.provide("module$inline_style_prefixer$utils$isObject");
var module$data$prs$dev$timesheet$node_modules$inline_style_prefixer$utils$isObject={};
module$data$prs$dev$timesheet$node_modules$inline_style_prefixer$utils$isObject["default"]["default"]=function(value){return value instanceof Object&&!Array.isArray(value)};
Object.defineProperty(module$data$prs$dev$timesheet$node_modules$inline_style_prefixer$utils$isObject["default"],"__esModule",{value:true});
module$data$prs$dev$timesheet$node_modules$inline_style_prefixer$utils$isObject["default"]=module$data$prs$dev$timesheet$node_modules$inline_style_prefixer$utils$isObject["default"]["default"]
Running ClojureScript 1.10.339
those two lines of javascript don’t make sense to me. the first line is how you emulate es6 default exports in es5
@lee.justin.m Right, it definitely seemed wrong to me. It is; I've seen it in a lot of npm module dependencies. Interestingly, I just looked up the code for the dep and it's different from what I got from npm: https://github.com/rofrischmann/inline-style-prefixer/blob/master/modules/static/createPrefixer.js vs http://ix.io/1fpl
I guess the latter is the output of babel or something.
@ghopper it might be this https://github.com/webpack/webpack/issues/706#issuecomment-71461351
It looks like there is some disagreement as how to do default exports when there is only one export
Huh, interesting. I'm only vaguely familiar with the es6 export stuff.
So the problem here is that the closure compiler can't consume modules using the .default
method?
I'm still not sure where the ['default']['default']
is coming from.
@lee.justin.m ClojureScript doesn’t really care what you pass, and yes that should work
@dnolen Alright, I'll try to find the minimum reproducible.
haven’t people been talking about being able to run gists using clj + cljs.main? i want to make this test case easily reproable without zipping up the deps.edn and source and uploading it to github. this seems like the ideal case where i could just slap it on a gist and then paste a one-liner in the issue
The deps.edn
could be on the command line, no?
@ghopper the .default.default
comes from Closure rewriting ES6 files that were rewritten by babel to be commonjs
which unfortunately is a won't fix in closure https://github.com/google/closure-compiler/issues/2971
@thheller Why does closure think it's ES6 if it's already been compiled to commonjs?
Which should be fine, right? Babel already changed it from ES6 to commonjs.
no, closure does not detect the __esModule
marker and since commonjs doesn't have a default
export it just rewrites it like any other exported property
I'll read that issue and try to understand.
Thanks
@thheller Alright, so I understand the .default.default
thing, I think.
However, the generated output should still not throw errors, right? I should be able to manually get the default
property and use it?
Is there any workaround for consuming these modules from clojurescript at the moment?
@andreasklein #om is the om.next channel - however I’m too swamped with ClojureScript stuff these days to be all that active anymore - note there are lot of alternatives these days Fulcro etc.
@bhauman it says "Uncaught SyntaxError: Invalid or unexpected token" at main.js:1 which is: "#!/usr/bin/env node"
@vigilancetech I'll need some more context as that doesn't give me much
@vigilancetech what command are you using?
clj --main cljs.main
cljs isn't found
{:deps {org.clojure/clojurescript {:mvn/version "1.10.339"}}}
#!/usr/bin/env node
if(typeof Math.imul == "undefined" || (Math.imul(0xffffffff,5) == 0)) {
Math.imul = function (a, b) {
var ah = (a >>> 16) & 0xffff;
var al = a & 0xffff;
var bh = (b >>> 16) & 0xffff;
var bl = b & 0xffff;
// the shift by 0 fixes the sign on the high part
// the final |0 converts the unsigned value into a signed value
return ((al * bl) + (((ah * bl + al * bh) << 16) >>> 0)|0);
}
}
var path = require("path");
try {
require("source-map-support").install();
} catch(err) {
}
require(path.join(path.resolve("."),"out","goog","bootstrap","nodejs.js"));
require(path.join(path.resolve("."),"out","cljs_deps.js"));
goog.global.CLOSURE_UNCOMPILED_DEFINES = {"cljs.core._STAR_target_STAR_":"nodejs"};
goog.require("hello_world.core");
goog.require("cljs.nodejscli");
same error
ah, no more error 🙂 Now to see if it will fire up a repl
yes cleaning main.js
and the out
directory while you are trying different commands is important
still waiting on a repl
@vigilancetech the above command should start a REPL
I added a -r to the end
clj by itself gives me one. clj -m cljs.main doesn't. It gives me the parking page and just hangs
no error
no change
I did the compile hello_world and printed that to the term, but no repl
clj -m cljs.main -c hello_world.core -r
Hello world!
2x cuz of the reload
enter in the terminal just gives blank lines
nothing
the 1 echoed when I typed it, but nothing came back
bash and the latest sabayon
had to look up sabayon, man one of these days they are simply going to run out of names for linux distros
chromium
lol, yeah, well, its been around for while. Well know to gentooists
I was on it for a long time, but I got tired of compiling. Sabayon gives you the best of both
but I want to move to guixSD cuz I'm sick of collisions/corruption like's most likely causing this
put it in the deps.edn?
I think it doesn't like my hostname. My /etc/hostname only has this machine's name and not the domain. Exception in thread "Thread-1" java.net.UnknownHostException: scuttle: scuttle: Name or service not known
still no repl
@vigilancetech well that sucks
I have systemd. IIRC that handles it somehow
obviously *mis*handling in this case 🙂
probably quickest way to get this is to reboot, brb
the error message is gone but still no repl (using the same code)
I deleted my bhauman folder out of .m2/repository and re-ran the command
Exception in thread "main" java.io.FileNotFoundException: Could not locate figwheel/main__init.class or figwheel/main.clj on classpath.
drops back to the $ prompt
IT WORKED!!! Thanks! BTW, I really liked your "Developing ClojureScript With Figwheel" 2015 speech. You should try some open-mic nite stand-up comedy 😄
will I get that version by just deleting your stuff in the .m2?
so basically my main problem was cuz my host(s) weren't set up properly (and maybe your code wasn't handling it elegantly)?
👍 Thanks again! I have a big deadline monday eve. This will help A LOT!
thx! Looking forward to using this
can I compose anync use-fixtures
? the ones with :before
and :after
. Can they be compose-fixtures
-ed?
oh, I am reading "NOTE: Incompatible with map fixtures." in the doc