Fork me on GitHub
#clojurescript
<
2017-09-17
>
dnolen00:09:26

@dfcarpenter what version of ClojureScript? 1.9.908?

dnolen00:09:07

@dfcarpenter probably means we can’t resolve packages like animated yet

dfcarpenter00:09:03

@dnolen Ahh ok. Thanks! ill stick to transition group for now

thheller00:09:34

RuntimeException: INTERNAL COMPILER ERROR.
Please report this problem.

EXPR_RESULT 86 [length: 6] [source_file: node_modules/animated/lib/index.js]
  Node(NAME spring): node_modules/animated/lib/index.js:86:4
var spring=function spring(
  Parent(VAR): node_modules/animated/lib/index.js:86:0
var spring=function spring(

	com.google.common.base.Preconditions.checkState (Preconditions.java:444)
	com.google.javascript.rhino.IR.assign (IR.java:424)
	com.google.javascript.jscomp.ProcessCommonJSModules$RewriteModule.updateNameReference (ProcessCommonJSModules.java:1100)
	com.google.javascript.jscomp.ProcessCommonJSModules$RewriteModule.maybeUpdateName (ProcessCommonJSModules.java:982)
	com.google.javascript.jscomp.ProcessCommonJSModules$RewriteModule.visit (ProcessCommonJSModules.java:727)

thheller00:09:48

seems like closure can’t quite compile it yet (that a closure compiler error when importing)

danielsu09:09:20

Hi i'm trying to connect to figwheel from a external computer, so that i could see the result of my app on this external computers screen. I use luminus as a base for my app . I tried setting :server-ip in project.clj but i see in the browser console on the external computer that it still tries to connect to localhost:3449. How do i configure the figwheel server ip?

Geoffrey Gaillard09:09:38

@danielsu give :websocket-host "0.0.0.0" a try 🙂

danielsu09:09:51

Thanks, actually setting server-ip to 0.0.0.0 and websocket-host to the actual ip of the server did work :)

tomaas12:09:24

hi, suddenly the emacs command cider-jack-in-clojurescript throws me this error Failed to compile "target/cljsbuild/public/js/app.js" in 5.551 seconds. OutOfMemoryError PermGen space [trace missing]

erwinrooijakkers19:09:10

Are you on the latest version of Java?

erwinrooijakkers19:09:27

You can give the JVM more memory in project.clj via :jvm-opts ["-Xmx1G"] ;; or more

erwinrooijakkers19:09:10

Oh wait, that gives more memory for the project’s JVM. You need to give the compiler more memory.

erwinrooijakkers19:09:28

Ah that jvm-opts settings also works for the compiler. See https://github.com/clojure-emacs/refactor-nrepl/issues/94 So that will fix it for now. Next up might be finding out why your code is using so much memory.

tomaas12:09:04

if I do lein figwheel and lein repl from powershell, the project inits well with no such error

lxsameer12:09:55

looking for some resources about performance comparison between cljs and js any suggestion ?

darwin13:09:35

@lxsameer I doubt anyone could produce general performance comparison which would stay relevant and useful. 1) javascript engines are moving targets 2) google closure compiler is a moving target as well 3) coding style is a big factor a well - you can write code in cljs which would compile into plain straightforward javascript (e.g. interop or raw loop-recur) or you could write code which will rely heavily on persistent data structures, laziness and dynamic protocol dispatch and similarly on the js side you can write old-school vanilla javascript or use more modern functional approach or libraries.

lxsameer13:09:06

I'm aware of these things

lxsameer13:09:26

the point i want to make is that cljs performance is good and acceptable

lxsameer13:09:54

so a simple comparison would be enough

darwin13:09:59

well, "cljs performance is good and acceptable" is not generally true, you wrote it because you have some use-case in mind

darwin13:09:43

example: cljs performance is not acceptable for webgl stuff, or heavy d3.js work

darwin13:09:01

I mean "game engine"-like use-cases

lxsameer13:09:00

hmmm did you run a experiment ?

lxsameer13:09:03

I'm using cljs with d3 and it's as good as the js version

lxsameer13:09:15

there are some issues which is not related to performance but it's good with d3 , I don't know about webgl usage though

darwin13:09:47

sure, we can find specific use-cases where the performance is ok, but if you need to push browser to the limits you need to go to raw javascript without persistent data

darwin13:09:34

but this is not my point, I just wanted to say that you cannot make general statement that "cljs performance is good" without saying the other half of the sentence "for what exactly"

darwin13:09:51

and "under what environment"

darwin13:09:56

I personally don't care about it, because I know that I can always benchmark my own cljs code and rewrite performance bottlencecks in js in case of performance problems

lxsameer13:09:58

alright , I'll include that in my slides as well

darwin13:09:33

but I don't write much performance critical code anyways, I suspect rewriting in js would be last resort, first thing would be to try to redesign the algorithm or write more interoppy cljs 🙂

dnolen15:09:29

@lxsameer you can write performant code directly in CLJS - not particularly idiomatic but that’s how the persistent data structures are implemented

dnolen15:09:40

we would have written those in JS if there were any real problems

lxsameer15:09:59

@dnolen I see, I'm totally agree with you, I'm going to give a talk on clojurescript in a ruby community, I'm looking for some comparisons or facts to show them that clojurescript code can be really performant

dnolen16:09:34

@lxsameer I don’t really understand what you are looking for?

dnolen16:09:49

we intentionally provide constructs that map to known fast JS operations

lxsameer16:09:14

cool, thanks

dnolen16:09:52

loop/recur, mutable locals, deftype etc.

dnolen16:09:04

you can just write the same type of code you would in JS

ErhardtMundt20:09:02

guys, I'm playing around with cljs and I came to the point that I need a humanized string representation of a time delta (inseconds)

ErhardtMundt20:09:15

is there any cljs library I can use for the purpose?

ErhardtMundt20:09:47

I'm using the reagent leiningen template, is there any recommendation for including js stuff in the project?

ingesol22:09:29

https://dev.clojure.org/jira/browse/CLJS-2334?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel After this fix I tried again to build a clojurescript (with 1.9.930) project where a CLJS file requires a JS :es6 file, which again requires another JS :es6 file in the same folder. JS -> JS require still doesn't work for me. Am I doing it wrong?

ingesol22:09:19

I'm setting my js-folder as the file of my foreign :es6 lib

ingesol22:09:26

First JS file: import worldy from 'world'; export var main = function() { console.log("hello/main here") };

ingesol22:09:57

Second JS file, named world.js in same folder: export var worldy = function() { console.log("world.worldy here") };

ingesol22:09:29

The error: Compiling "resources/public/js/compiled/splort.js" from ["src"]... Installing Node.js dependencies events.js:160 throw er; // Unhandled 'error' event ^ Error: Can't resolve 'world' in '/Users/inge/dev/hng/splort' at onError (/Users/inge/dev/hng/splort/node_modules/enhanced-resolve/lib/Resolver.js:61:15) at loggingCallbackWrapper (/Users/inge/dev/hng/splort/node_modules/enhanced-resolve/lib/createInnerCallback.js:31:19) at runAfter (/Users/inge/dev/hng/splort/node_modules/enhanced-resolve/lib/Resolver.js:158:4) at innerCallback (/Users/inge/dev/hng/splort/node_modules/enhanced-resolve/lib/Resolver.js:146:3) at loggingCallbackWrapper (/Users/inge/dev/hng/splort/node_modules/enhanced-resolve/lib/createInnerCallback.js:31:19) at next (/Users/inge/dev/hng/splort/node_modules/tapable/lib/Tapable.js:252:11) at innerCallback (/Users/inge/dev/hng/splort/node_modules/enhanced-resolve/lib/Resolver.js:144:11) at loggingCallbackWrapper (/Users/inge/dev/hng/splort/node_modules/enhanced-resolve/lib/createInnerCallback.js:31:19) at next (/Users/inge/dev/hng/splort/node_modules/tapable/lib/Tapable.js:249:35) at resolver.doResolve.createInnerCallback (/Users/inge/dev/hng/splort/node_modules/enhanced-resolve/lib/DescriptionFilePlugin.js:44:6)