News for hackers. Stuff that matters.
Re:Using JavaScript Modules in ClojureScript by babbeloski on Friday January 27, 2017 @11:43PM (#13504947)
Clojurescript is the most complete to JS languange. The build and developer tools are _ahead_ of Javascript. The language is great too, and it's pretty 1:1 with javascript, plus all the other goodies. It's not going to satisfy haskellers, but when you look at the big picture it wins over Elm (at the moment, I love Elm too)
Re:Using JavaScript Modules in ClojureScript by ethagnawl on Friday January 27, 2017 @08:51PM (#13504338)
Is anyone else having trouble following along at home?

I'm met with an error when running `node main.js`.

> SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode

Re:Using JavaScript Modules in ClojureScript by Arnavion on Friday January 27, 2017 @09:09PM (#13504391)
Try `node --use_strict main.js`
Re:Using JavaScript Modules in ClojureScript by ethagnawl on Friday January 27, 2017 @09:12PM (#13504412)
Thanks - that worked!

Do you know why that's necessary and why it wasn't mentioned in the tutorial?

Re:Using JavaScript Modules in ClojureScript by swannodette on Friday January 27, 2017 @09:13PM (#13504418)
You probably need to install a more recent version of Node.js. That's one of the first things mentioned.
Re:Using JavaScript Modules in ClojureScript by ethagnawl on Friday January 27, 2017 @09:43PM (#13504539)
Thanks, David. Upgrading to Node 7.4.0 allowed me to run `node main.js` without having to pass the flag.

Granted, I was using an outdated version of Node, but perhaps it'd be helpful to add a >= version number to the Node dependency blurb (a la JDK 8).

Either way, thanks for your continued efforts!

Re:Using JavaScript Modules in ClojureScript by ethagnawl on Friday January 27, 2017 @10:06PM (#13504638)
One more thing: the `repl/repl*` function call's map argument is missing a closing `}`.
Re:Using JavaScript Modules in ClojureScript by tomerweller on Saturday January 28, 2017 @02:19PM (#13508246)
The fact that their example includes using cljsjs package for externs is troubling. For the meanwhile, to avoid worrying about extern files, I'd stick to using a separate build process for npm packages.

Shameless self promotion: http://blob.tomerweller.com/reagent-import-react-components-...

Re:Using JavaScript Modules in ClojureScript by apviitanen on Saturday January 28, 2017 @05:41PM (#13509952)
Yeah, but without externs this breaks on advanced compilation, right? So, while using webpack to bundle npm deps is a good idea (that might also get unnecessary in the future with things like node module resolution landing in cljs compiler), you still need externs for the functions you're going to call from your cljs code. Luckily the latest cljs compiler will help you get those right.
Re:Using JavaScript Modules in ClojureScript by reilly3000 on Friday January 27, 2017 @11:05PM (#13504836)
I'm super stoked about this. Also, it sucks that I can't just name NPM packages in my project.cljs and move on.

Because then I can play with NPM packages on my phone while I commute. Let's do this!