Fork me on GitHub
#clojurescript
<
2019-07-30
>
fbgava00:07:06

is there any up to date book on cljs? or what is the recommended beginners resource? (i know how to program and a little clj, but don't understand the tooling around cljs)

4
scknkkrer07:07:30

Actually, begginers have may want to start from explore their learning curve. How about your knowledge and understanding of Programming Languages. Lisp is old! It is wise. And Rich Hickey gave us an incredible point of view on top of this Mystery. It’s about data and it’s journey to the desired shape. Sorry about my English. I’m still working on it. Aside from this introduction; ClojureScript Unraveled: http://funcool.github.io/clojurescript-unraveled/ Is an online book on Clojurescript. Transforming Data with ClojureScript: http://langintro.com/cljsbook/index.html Is an another great source about Clojurescript and it’s mentality on modeling and managing Data.

scknkkrer07:07:10

@U7JCZJR0W, @U883WCP5Z. I hope it helps. Do not hesitate to ask anything about Clojure/Clojurescript.

👍 4
jaihindhreddy08:07:29

Thanks! I'm pretty comfortable with Clojure, and so can't get much value from most introductory books. What I am looking for is "the current state of ClojureScript tooling". Stuff like shadow-cljs, figwheel-main, Google Closure, that sort of thing. I guess I'll just have to dive in and build something.

scknkkrer08:07:48

@U883WCP5Z, let me see what I can gather tonight. I’m at work now.

👏 4
Roman Liutikov08:07:43

@U883WCP5Z Documentation for both figwheel and shadow-cljs is pretty good these days, so you can start from there.

👍 8
Ahmed Hassan09:07:40

@U0FR82FU1 When should we use figwheel/figwheel-main instead of shadow-cljs? I'm currently using shadow-cljs.

Roman Liutikov09:07:18

@UCMNZLJ93 they are both build tools for cljs, shadow is more into NPM integration, so I’d say use shadow. I’m personally fine with figwheel + webpack setup

👍 4
scknkkrer12:07:09

@U7JCZJR0W, no problem! 😇

Ahmed Hassan12:07:04

@U0FR82FU1 what benefits do you feel figwheel + webpack setup have over shadow-cljs. I'm fine with shadow-cljs, but just curious about alternatives.

Roman Liutikov14:07:18

@UCMNZLJ93 I don’t think there’s any benefit, I just used to this setup

👍 4
abdullahibra08:07:15

what is the starting point to figure out why my clojurescript code not loading into IE?

abdullahibra08:07:16

is there a way to test if my final app.js will work correctly on IE or not rather than using IE itself ?

abdullahibra08:07:32

some tool to check compatibility ?

abdullahibra09:07:39

SCRIPT5022: Minified React error #200; visit http://reactjs.org/docs/error-decoder.html?invariant=200 for the full message or use the non-minified dev environment for full errors and additional helpful warnings. i found this

abdullahibra09:07:49

anybody can help about this?

abdullahibra09:07:34

is this supposed to work on IE: (.setItem js/localStorage k v)

thheller09:07:40

@abdullahibra depends on the IE version

thheller09:07:01

but the above error is about a DOM node so it looks like something else

thheller09:07:37

make sure the DOM node for your initial render exists at the time of loading

abdullahibra09:07:39

yeah i adjusted it and i got another errors related to save in localstorage

thheller09:07:47

looks like it should be supported

abdullahibra09:07:38

why i got undefined in IE console ?

thheller09:07:08

thats just the return value of console.log

abdullahibra09:07:54

and this not working for localstorage

thheller09:07:05

well yes that is not javascript

thheller09:07:34

try localStorage.setItem("foo", "bar");

abdullahibra09:07:44

i'm trying cljs

abdullahibra09:07:18

this code not working in IE

abdullahibra09:07:28

@thheller can you help in that?

thheller09:07:49

well it uses a bunch of new syntax which IE doesn't support

thheller09:07:13

() => should be function()

thheller09:07:17

const should be var

thheller09:07:44

and pretty sure IE doesn't support .classList either but it might

abdullahibra09:07:15

we need to kill IE

thheller09:07:03

it is more or less. just dying really slowly 😛

4
Mno09:07:52

What is dead will never die

💀 4
scknkkrer10:07:20

I agree with @abdullahibra. What are we waiting ? Natural death ? 😂

abdullahibra10:07:45

'Set' is undefined in IE 11 document mode 10 , how can i support polyfill in the clojurescript ?

abdullahibra10:07:45

:rewrite-polyfills true ?

thheller12:07:37

@abdullahibra it depends on the code that uses Set. CLJS doesn't so it must be some JS lib and it then depends on how you include it

camden16:07:36

Is anyone using cypress for end-to-end tests on their clojurescript apps and writing the tests in clojurescript? If you are doing that, it'd be a life-saver to know what you're doing to make that work.

Roman Liutikov17:07:28

what exactly doesn’t for you?

camden17:07:13

We are currently using shadow-cljs to build a node module (with all the content of the tests) and require that in each of our integration test spec files. we'd like to have hot reloading when developing on them, but cypress doesn't reload the node_modules directory.

Roman Liutikov17:07:44

I think we have this setup, at least you can auto run test while developing. But I’m not sure how that works exactly. Maybe @U9ES37CSZ can tell more

Roman Liutikov17:07:05

Some day we will start an engineering blog 🙂

camden17:07:11

we'd definitely like to write about this once we get it in a state we like, because it seems like the only thing written about this is: https://github.com/eerohele/cypress-clojurescript-demo

mkarp07:07:40

Hey y’all, we’ve decided to write tests in JavaScript, so unfortunately I don’t have experience with the topic

camden17:07:14

thanks for checking in anyways!

scknkkrer17:07:14

Are there any MongoDB Clojurescript wrapper for NodeJS ?

Roman Liutikov17:07:03

I’d say you don’t need a wrapper for that. Use node module directly.

scknkkrer18:07:12

It’s node module. We define wrappers as the idiomatic usage interface between the Host Structures and the Language itself, right ? If are not there any wrapper, I’m volunteer to write such a library.

scknkkrer18:07:33

idiomatic usage means: Clojure way. With it’s data structures and mentality. @U0FR82FU1, If I’m wrong, please correct me.

Roman Liutikov18:07:13

Clojure way would be to issue queries directly against a database, not having an ORM, and get back a collection of maps.

4
Roman Liutikov18:07:57

But what I meant is that you don’t need a wrapper to work with Node’s mongodb driver for example, imo

Roman Liutikov18:07:02

the only thing would probably be to convert json into edn, but that’s just js->clj

Roman Liutikov18:07:35

other than that it’s still a good exercise

scknkkrer19:07:34

@U0FR82FU1, I think it’s a good perspective. I have to think about pros and cons of making a wrapper around a library on Clojurescript. I think this was a good Chapter on my book. But I might be wrong.

scknkkrer19:07:51

I’m writing a book in my Native Language --Turkish-- and I think it is a good idea that implement a wrapper around an library for community. I think it encourages the readers to share knowledge and making useful things. Maybe Productivity, I think.

souenzzo19:07:38

May be a good idea use https://github.com/mfikes/cljs-bean to convert js to cljs

scknkkrer20:07:29

Wow. Amazing idea!

tianshu21:07:02

when we do hot-reload in clojurescript, sometimes there are bugs break the rendering, result in there's nothing left on screen. after fix the bug, it can't recover itself so I have to reload the browser. how can I avoid this?

rgm21:07:31

I have an older lein+cljsbuild+reframe + cljs 1.10.520 project, and I’m scratching my head a bit on what the cljs$node_modules.js file in the cljs dev build folder is all about. The project was loading OK, but now I’m getting an Error: Undefined nameToPath for module$Users$rgm$Projects$my-project$code$node_modules$react$react when I start the app in the browser.

rgm21:07:16

I seem to have :install-deps false in the compiler options … are there any good tips for figuring out which dep is bringing this in?

lilactown21:07:52

have you run npm install?

rgm21:07:17

lein deps :tree is a bit confusing

rgm21:07:35

my rough understanding was that reagent/re-frame would drag in their own React.

lilactown21:07:04

I think it does via cljsjs, yeah

rgm22:07:43

I just don’t recall seeing that cljs$node_modules.js file before.

rgm22:07:52

I get an out/node_modules/react folder (and for other npm deps) but these seem to be Closure-ized in some way

rgm22:07:23

wondering if I somehow opted into the clojurescript compiler’s npm deps stuff by mistake

lilactown22:07:50

could be. do you have :npm-deps true in your project.clj?

lilactown22:07:58

you said it was working ok. did you change anything?

rgm22:07:10

I have :npm-deps { ,,, } in a separate devcards build config … wonder if lein’s picking those up.

rgm22:07:25

I bumped figwheel and clojurescript

rgm22:07:48

might have been a long time since I’d thrown away the /out folder.