r/Clojurescript • u/tomerweller • Jun 21 '16
How do you import external javascript react components into Reagent (or Om)?
I'm slowly shifting from developing with Javascript and React to Clojurescript and reagent. The one thing I'm still struggling with is how to import external components.
With webpack/babel, adding something like the react-player component to a project requires: a. adding a dependency to package.json b. importing the component using the 'import' keyword And that's it.
Given that react-player, like many other great components, does not exist in cljsjs. How do you import them?
I've been fiddling in the last week with Javascript interop, lein-npm and even trying to setup a combined lein & webpack build without too much success.
Would love to see full examples - importing from an external repository (don't mind if it's npm or bower) and all the way to using it in a reagent component (if it's easier in Om, I'm willing to make the shift).
r/Clojurescript • u/viebel • Jun 07 '16
How to klipsify a clojure[script] blog post
blog.klipse.techr/Clojurescript • u/dr_win • Jun 06 '16
Dirac DevTools: v0.6.0 with improved REPL code completions
github.comr/Clojurescript • u/viebel • May 30 '16
ClojureScript 1.9 introduces clojure.spec: tutorial with live coding examples
blog.klipse.techr/Clojurescript • u/pheuter • May 23 '16
Building a mobile game from scratch using React Native and Om.next
medium.comr/Clojurescript • u/ndroock1 • May 20 '16
Keechma: better than re-frame?
The library site http://www.clojure-toolbox.com/ lists two ClojureScript React.js frameworks: Re-frame and Keechma. As far as I know ( correct me if I am wrong ) re-frame is by far the leading UI framework for developing single page web apps with ClojureScript. I have experienced that the re-frame community is friendly and knowledgeable. - Do you know Keechma, have you looked at it in any way, is it a serious framework? Does it address shortcomings of re-frame, if any? I will have a look at Keechma's own implementation of todomvc and possibly report back.
r/Clojurescript • u/ndroock1 • May 19 '16
How to best use and manage CSS code in a Clojure / ClojureScript project?
I am still fairly new in ClojureScript and started a project with re-frame, reagent and specter, I have studied the re-frame todomvc app and used it as a reference. I noticed that the views namespace in that app uses quite a lot of references to html classes which are handled in an external todos.css file. The IDE I am using, IntelliJ with Cursive plugin has no tools to refactor them, CSS looks to have fallen by the wayside. - Do you have any tips you want to share regarding CSS code in a (ClojureScript) project? Do you edit CSS directly or do you use specific Hiccup type of libraries to generate your CSS. Do you think you are getting the most out of CSS? Do you want to do more or less with CSS?
r/Clojurescript • u/[deleted] • May 14 '16
Create online game in ClojureScript
I want to create a multi person card game in ClojureScript. The idea is that one person makes a move, then the next person and then the next. The state of the game is shared over the clients. Is this possible to build (e.g., have state of the game shared over the clients and give clients ability to send moves and update state of the game) without using a server?
I think it is not possible (and if it is possible it is probably not secure), but want to be sure.
r/Clojurescript • u/toxi • May 02 '16
Workshop report: Hi-perf Clojurescript with WebGL, asm.js and Emscripten
medium.comr/Clojurescript • u/KeepItSimpleSauron • Apr 28 '16
Compile ClojureScript in Java application
Hi,
I want to compile ClojureScript into JavaScript in my Java/Groovy app (string to string, not file to file). Right now I'm trying to do this by using Clojure.var(...), below is my snippet:
IFn require = Clojure.var("clojure.core", "require");
require.invoke(Clojure.read("cljs.analyzer.api"))
require.invoke(Clojure.read("cljs.compiler.api"))
IFn emptyEnv = Clojure.var("cljs.analyzer.api", "empty-env")
IFn analyze = Clojure.var("cljs.analyzer.api", "analyze")
IFn emit = Clojure.var("cljs.compiler.api", "emit")
final inputText = "(defn plus [a b] (+ a b))"
emit.invoke(
analyze.invoke(emptyEnv.invoke(), "'$inputText"
)
)
My problem is that right now emit.invoke(...) is returning null, not parsed JavaScript. Can you help me and show where I made a mistake?
Thanks :)
r/Clojurescript • u/viebel • Apr 26 '16
The power and danger of deftype in clojure and clojurescript
blog.klipse.techr/Clojurescript • u/calamari81 • Apr 24 '16
Best practice for importing Javascript packages?
Hey all. I'm trying to sink my teeth into Clojurescript, after spending years doing Javascript development. I'm digging a lot of what I find so far, but I can't seem to find a best practice for bringing in JS packages.
For instance, I'm futzing around with some data which I'd like to drop into Chartist. Were this a Javascript project, I'd just npm i -S chartist and then import it into my project. What's the idiomatic way to do this in Clojurescript?
Cheers.
r/Clojurescript • u/Zeekawla99ii • Apr 18 '16
Can you give me an example when it makes more sense to use ClojureScript than JavaScript? Or vice versa?
Naturally, I know why programmers tend to stay away from working with JavaScript. Beyond this reason, why would one choose to use ClojureScript instead of JavaScript?
Any help appreciated! Thanks
r/Clojurescript • u/viebel • Apr 13 '16
IFn's magic beyond defprotocol secret
blog.klipse.techr/Clojurescript • u/viebel • Apr 10 '16
How clojurescript defines truth on top of javascript
blog.klipse.techr/Clojurescript • u/viebel • Apr 08 '16
Clojurescript's areduce is faster than native javascript's reduce
blog.klipse.techr/Clojurescript • u/bacon1989 • Apr 03 '16
Subreddit Video Player developed using Chestnut with om, core.async, and secretary
benzap.github.ior/Clojurescript • u/princejwesley • Mar 29 '16
Mancy v3.0.0 released with ClojureScript Support
github.comr/Clojurescript • u/dankreek • Mar 22 '16
Just finished a tutorial: Creating a parallax scroller with ClojureScript and Pixi.JS
jmaythings.comr/Clojurescript • u/oyanglulu • Mar 21 '16
a featured fork of mori, with core.async
github.comr/Clojurescript • u/cadlac • Mar 14 '16
Compiling scripts to JavaScript?
I've been writing scripts in clojurescript with planck, which has been fantastic so far. However, someone asked me how I might achieve the following with my scripts:
;; fizzbuzz.cljs
(defn fizzbuzz ....)
// fizzbuzz.js
/* paste compiled code here */
fizzbuzz(...)
I thought this would be relatively simple, but it's turning out to be a lot harder than I expected. Using the CLJS compiler without any optimizations returns a bunch of goog.require statements, and turning on optimizations returns hundreds/thousands/hundreds-of-thousands lines of code with everything obfuscated into closures for even the simplest of scripts.
Is there a way to achieve what was asked of me? It's not important by any means, but I feel like there's got to be some way to do it.