Fork me on GitHub
#clojurescript
<
2017-11-13
>
jeaye00:11:11

Reported to CLJS-2397

mfikes11:11:38

@jeaye The issue you reported with instrument and :advanced is actually instead due to :static-fns. See https://dev.clojure.org/jira/browse/CLJS-2397 for more details.

sirwobin12:11:36

Hi, I'm using a javascript dependency that is packaged with cljsjs. I can't find any documentation for the translation between the JS object methods and cljs. Is there a primer someone can point me to?

scknkkrer12:11:04

@ertucetin Ertuğrul hi, is your project open-source ?

pesterhazy13:11:34

not Ertugrul but I like the project

mfikes14:11:00

Just be aware that it incorrectly recommends aget on objects in places.

mfikes14:11:21

Also—in printed form—ClojureScript: Up and Running covers this. (An updated edition of that book is in the works as well.)

baptiste-from-paris15:11:47

hello friends, I am trying to use Cursive and Lumo together by using Tubular socket REPL client. It is working but I have to type my code in a new small prompt with the “Enter string for standard input” and it’s not manageable. Someone know what’s happening ? Thanks a lot

mfikes15:11:40

@baptiste-from-paris Did you choose “Use clojure.main in normal JVM process”? (See the note in the Tubular README.md)

baptiste-from-paris15:11:28

I read all the README.md

mfikes15:11:08

Cool. Usually the little dialog pops up owing to I/O handling and using a “plain” REPL avoids that aspect. Hrm.

baptiste-from-paris15:11:39

do you have to specify some parameters (JVM args, env...)

baptiste-from-paris15:11:22

ok, restarded IDE and it’s working...

mfikes15:11:23

Let me check with the latest Cursive… perhaps something broke. You shouldn’t have to supply any extra params.

mfikes15:11:30

Ahh. Cool! 🙂

mfikes15:11:41

This makes me wonder if there is now an extra step where you need to restart the entire IntelliJ IDE. Hmm.

baptiste-from-paris15:11:57

@mfikes by the way, are you able to send a form to the REPL (in the Tubular context) ? I have the “Cannot load Clojurescript form into Clojure REPL” error

mfikes15:11:39

@baptiste-from-paris Yes, in Cursive, ensure that the little language pulldown in the REPL UI indicates “cljs” instead of “clj”.

baptiste-from-paris15:11:13

forgot this one ...

mfikes15:11:29

(Cursive will automatically switch language if it sees To quit, type: :cljs/quit, but Lumo / Planck don’t print that out.)

baptiste-from-paris16:11:28

@mfikes do you have symbol resolution in cursive for free without conf (no the repl but files) ?

mfikes16:11:46

@baptiste-from-paris IIRC, yes. If you have a project.clj file set up then Cursive will index your source files.

baptiste-from-paris16:11:19

😞 js/require and such js fn’s are not recognized

mfikes16:11:44

Oh, well, Cursive has no source to index to find something like that perhaps.

mfikes16:11:59

Cursive can index JavaScript, but those are special fns in Node, I guess.

baptiste-from-paris16:11:22

ok ok, it’s still a great UX

wpcarro18:11:36

Can anyone recommend a more readable alternative for string interpolation in ClojureScript that is similar to "This is a #{value}."? I saw strint in core.incubator. I don’t expect to be able to use that in CLJS though — unless I’m mistaken

wpcarro19:11:34

Is it idiomatic to use goog.string.format?

dnolen19:11:25

yes, but goog.string.format is discouraged by Closure Library maintainers themselves - limited functionality and DCE unfriendly

dnolen19:11:44

which is why we don’t provide format out of the box anymore

wpcarro19:11:58

Yea I read the deprecation notice. Is it common in CLJS to use macros like the strint macro defined in core.incubator? Seems to have a nice API

wpcarro19:11:11

I worry that it may only expand into Clojure friendly-code though

wpcarro19:11:25

although after reading the source it seems like it’s relying on str, which seems promising

wpcarro19:11:30

For anyone future readers, it does work, and its syntax is fantastic: (<< "My name is: ~{name}.") desugars into (str "My name is: " name)

thheller19:11:02

why not write (str "My name is: " name) directly?

wpcarro20:11:16

@thheller it is not as readable as the alternative syntax. esp. when the string interpolation has nested quotation marks etc. I’m using string-interpolation for composing queries

sirwobin20:11:46

@mfikes Just read your advice. Will take a look tomorrow. Thank you!

wpcarro20:11:15

languages like Ruby, Elixir, JS support both string concatenation and string interpolation for these reasons

wpcarro20:11:33

nice to see that Clojure has it slated in the incubator

fbielejec20:11:26

I'm importing a react component (using :npm-deps feature) and wrapping it with the adapt-react-class adapter, this fails with Uncaught TypeError: Cannot call a class as a function, but only when :optimizations :advanced. I reproduced behaviour in a minimal repo: https://github.com/fbielejec/npm-deps-demo

borkdude20:11:32

Just checking, but are (set! (.-y item) 10) kind of expressions also vulnerable to DCE?

borkdude20:11:52

The name of y I mean

Audrius20:11:32

hi, ho someone know how in hiccup set text input to max 4 lines height but default to one. (the overflowing top line should just hide)

Dustin Getz21:11:30

Streamy HTTP library for cljs (or js) - anyone know a good one?

Dustin Getz21:11:38

Apparently this is a very rare need

mfikes21:11:45

@borkdude Are you worried about renaming? (As opposed to DCE.)

mfikes21:11:17

@borkdude Your set! example will compile to JavaScript that looks like item.y = 10. In other words it is not really different than (.-y item) by itself, which is subject to renaming under :advanced.

borkdude21:11:33

yes, I noticed.. thanks 🙂

sandbags22:11:52

Is there an obvious, likely, cause for when the ClojureScript compiler says "No such namespace x.y.z, could not locate x/y/z.cljs ..." when z.cljs is right there next to other namespaces under x.y that it is finding?

dnolen22:11:54

the location of namespaces must match the classpath

sandbags22:11:31

@dnolen i can parse that sentence but not interpret it

sandbags22:11:50

darnit, letter blindness... i should have tried copying the path from the error... two characters transposed

sandbags22:11:58

problem was in the :require not the file, sorry for the noise

athomasoriginal23:11:05

I am running a CLJS project and things were working well and than CLJS stopped tracking the web socket connection correctly. I am getting this error: WebSocket connection to '' failed: Error in connection establishment: The app compiles correctly. Any pointers on how to debug this issue? I have tried stopping and restarting the app. You can see the app itself here: https://github.com/tkjone/clojurescript-30/tree/master/34-calendar-fun

athomasoriginal23:11:17

Its odd because that is not the connection that the socket is listening on...its like its caching an old socket address

athomasoriginal23:11:02

And the answer: clear your cache