This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-07-16
Channels
- # aleph (4)
- # bangalore-clj (10)
- # beginners (39)
- # boot (24)
- # cljs-dev (66)
- # cljsrn (79)
- # clojure (39)
- # clojure-italy (7)
- # clojure-russia (6)
- # clojure-spec (4)
- # clojure-uk (1)
- # clojurescript (91)
- # core-async (1)
- # core-typed (2)
- # datomic (49)
- # hoplon (42)
- # lumo (2)
- # nyc (1)
- # off-topic (1)
- # parinfer (20)
- # pedestal (2)
- # reagent (4)
- # rum (14)
- # vim (2)
@mobileink i've personally never been a big fan of material design, it makes things look either like Android or a Google service
I hear that
i'm having an odd problem since upgrading from an old version of cljs, when using :advanced. I use long.js (https://github.com/dcodeIO/long.js) and there is a
.toNumber
function on the objects it returns. This function works fine in :simple opts but returns NaN in :advanced. I call it like (.toNumber .....)
has anything changed with respect to how you call member functions like this that I'm i'm missing?i wonder if somehow there is some name mangling going on. I do have an externs file for long.min.js
> long.js - A Long class for representing a 64 bit two鈥檚-complement integer value derived from the Closure Library for stand-alone use and extended with unsigned support.
i assume those goog libraries are automatically :advanced compatible with externs implicitly handled?
i'm simply (:import [goog.Math.Long]) without any change to project.clj and then just use the api like an ordinary js library?
how does the namespacing work on that when I call those functions, i.e. the constructor for "new Long" is currently (.-Long js/dcodeIO) -- would it be (.-Long js/Long) or something like that?
I need websockets. Is https://github.com/jarohen/chord the library to use, or something else? the two sides are clj and cljs
hello 馃檪 , using mongodb/mongoose/node.js/express etc from clojurescript its easy? or you have to use clojurescript libraries?
you can just use any javascript library from clojurescript
no wrappers needed mostly
roughly anything you can do in javascript, you can do in cljs
though ES5 example may be easier to translate
@pesterhazy @takis_ I pass now this problem... I want use npm React component in my re-frame project... No success yet... I tried use lein-npm, but when i run nodejs/require "module", in browser require is undefined 馃槙 馃槄
i noticed that cljs is missing from this popular benchmark: https://github.com/krausest/js-framework-benchmark if I had the time I'd take a stab at it
@ajs That would be nice for reference! But it鈥檚 probably not a huge loss. Clojure/Script is after all a language created to improve performance after the threshold at which cognition, rather than computing resources, becomes the performance bottleneck.
@henrik true. that's also true of Elm and some of the other items in that benchmark. I mentioned this only because someone asked me why cljs wasn't on there.
@pesterhazy @takis_ have you examples the clojurescript using express, or other npm library?
@renan here's a rough example of using express: https://github.com/pesterhazy/unravel/blob/864613c340a67b1a6a02857f611f0813f260a0b1/src/unravel/loop.cljs#L257
I'm trying to make a plugin for LightTable and can not save settings. I don't understand why my state atom has nils in ::on-close-destroy behavior: https://github.com/okilimnik/renatal-lt-plugin/blob/master/src/lt/plugins/renatal.cljs
@pesterhazy Oh! Thanks! But this example use express of npm package?... Because this is my problem, I want use a react component by npm... But I don't got yet
yes it uses the npm package
@pesterhazy oh... Ok... But this equal for using another npm package ? For example, how to install anda import this package https://www.npmjs.com/package/@atlaskit/button in my project? You have another example of this ? Or links about this?
@alice what version of CLJS are you using? 馃檪
so you can use :npm-deps
just tried it and it worked
1 sec
;; build.clj
(require '[cljs.build.api :as b])
(b/build
"src"
{:optimizations :none
:main 'foo.core
:npm-deps {:dom-to-image "2.5.2"}
:closure-warnings {:non-standard-jsdoc :off}
:compiler-stats true
:parallel-build true
:asset-path "/out"
:verbose true
:output-dir "out"
:output-to "out/main.js"})
where foo.core
is:
(ns foo.core
(:require [dom-to-image]))
(enable-console-print!)
(println "Use dom-to-image:" dom-to-image)
thanks to Closure Compiler JS module processing you can just use its functions too:
(dom-to-image/toPng ...)
^ all this module support works in 1.9.671, and it鈥檚 greatly improved in the version to be released this week, as per: https://clojurescript.org/news/2017-07-12-clojurescript-is-not-an-island-integrating-node-modules
it still feels like magic to me too
@alice where do you see Boot?
hah, no. That鈥檚 using a simple Clojure script to interact with the ClojureScript API
(`lein-cljsbuild` calls cljs.build.api/build
for you)
there鈥檚 no build tool involved in my example
just drop the relevant compiler options in your CLJS compiler options
this should be build tool agnostic
let me know if you run into any problem
I'm curious, what's dom-to-image useful for?
looks like it takes SVG / PNG captures of a web page
or rather, a DOM node
I never used it before, but was curious to see if it worked with the JS module processing 馃檪
turns out, it does
@alice, I'm curious why you (or other) take screenshots of dom nodes from javascript
aren't there service for this? I'd use a service (if I had a budget)
seems like a job for an API to me
there鈥檚 also the open graph metadata that Youtube probably sends
<meta property="og:site_name" content="YouTube">
<meta property="og:url" content="https://www.youtube.com/watch?v=wZZ7oFKsKzY">
<meta property="og:title" content="Nyan Cat 10 hours (original)">
<meta property="og:image" content="https://i.ytimg.com/vi/wZZ7oFKsKzY/hqdefault.jpg">