Fork me on GitHub
#clojurescript
<
2015-06-09
>
maria00:06:16

@dspiteself: sorry, I don’t really understand your question. Could you try to rephrase?

dnolen00:06:16

@dspiteself: the only issue would be that some transformed commonjs modules may need externs because of reliance on strings for JavaScript properties.

dnolen00:06:02

but there’s no need for anything “new” here

dspiteself00:06:54

sorry @maria I was curious if we had to add options to the clojurescript compiler options if the library did not support google's advanced compile. @dnolen answered my question.

maria00:06:28

Ah, I see. Thanks @dnolen for answering simple_smile One of my tasks for this and the coming weeks will be to test if we run into any problem when converting bigger and more commonly used modules instead of just simple example modules.

dspiteself00:06:03

@dnolen: will we create an extern file or use goog.export?

maria00:06:34

@dspiteself: If I understand correctly, we will continue to use externs because the code that we are including is external. From my understanding, you should use export when writing your own Google Closure library and want to expose some functions. Also, I think if we would want to use export, we would need to modify the code of the module before converting it.

maria00:06:26

@dspiteself: Externs instead are written to a separate file, so there is no need to go in and directly change the code of the module.

maria00:06:50

@dspiteself: The second part of my project will actually focus on generating those externs automatically, to make it easier to include existing JavaScript libs 😉

maria00:06:52

dnolen, feel free to correct me if I get things wrong 😉

dspiteself00:06:53

@maria: Nice. One of the reasons we adopted clojurescript early is we had a large google Closure codebase and cljsbuild was as a decent build tool on compared to the other gclosure alternative. It will be great to have an easier migration path for other codebases.

dnolen01:06:53

@maria: that’s the plan simple_smile exciting stuff!

cfleming05:06:34

Holy moly, I no longer have to pay Apple to put apps on my iOS device

cfleming05:06:46

React Native fiddling just got easier

robert-stuttaford05:06:59

so glad to see proprietary languages going open-source like this!

cfleming05:06:28

@robert-stuttaford: Yeah, although I don’t care much about Swift

cfleming05:06:42

I just want to get my own CLJS apps on my device

robert-stuttaford05:06:58

me neither. but it’s a nice trend. vindicates our belief in OSS simple_smile even the biggest companies in the world are doing it

robert-stuttaford05:06:08

yeah. i look forward to that day myself

cfleming05:06:38

Of course, I’m peddling closed source, so I can’t talk simple_smile

robert-stuttaford05:06:45

patiently watching the great work that @mfikes and the react native crew (as well as many others like your august self) are doing and will take a dip in a couple months

robert-stuttaford06:06:11

-grin- you don’t have a 700bn market cap. i think you’re well within your rights to ask for a little money for your efforts simple_smile

cfleming06:06:14

Yeah, I think it’s going to be exciting, I’m amped for RN - I think it has the potential to be CLJS’s killer app

cfleming06:06:33

Maybe the 700bn will come with version 2 of Cursive

robert-stuttaford06:06:49

solid plan -grin-

cmdrdats06:06:22

@cfleming: You don’t have to pay to put apps on your iOS device? Did I miss the memo?

robert-stuttaford06:06:42

they announced at wwdc yesterday @cmdrdats

cfleming06:06:42

@cmdrdats: Announced at WWDC

cmdrdats06:06:57

awesome simple_smile that’s brilliant

cmdrdats06:06:38

when do they plan on making that happen?

cfleming06:06:41

Not sure, generally they release things more or less when they announce them, so I assume now-ish

cmdrdats06:06:48

So they are open sourcing Swift and opening up your device to let you upload stuff without that dev cert ($99 per year)?

sander06:06:18

the swift thing is "later this year", xcode 7 beta (which supposedly supports cert-less uploading) is out now

cmdrdats06:06:24

sorry, I can find the open source swift part online, but not the part where you don’t need that annoying license

cmdrdats06:06:53

that’s going to shake things up somewhat

sander06:06:37

just tested, works indeed simple_smile

martinklepsch07:06:52

@maria: is that externs generation stuff only for a certain subset of JS libs/module types or is the idea to completely remove the need for (human-maintained) externs? :)

cfleming07:06:10

@cmdrdats: They’ve also merged the OSX and iOS programs, so if you do pay your $99 you can now make apps for both.

cmdrdats07:06:45

@cfleming: but that’s now just to get it into the app store, right?

cfleming07:06:07

Previously you needed it even to install on your own device.

cmdrdats07:06:15

ye, that was such a pain

cfleming08:06:34

@dnolen: Wow, the CLJS resolution in Cursive is indeed seriously borked - sorry about that. I’ll fix that now and check why tests didn’t catch it.

ricardo08:06:32

Well, this is weird, and I'm in serious need of some rubberducking.

ricardo08:06:11

I had a reference to reagent-forms 0.5.1. I'm not using it, so I replace it with a direct reference to reagent 0.5.0 (the same version reagent-forms requires).

ricardo08:06:16

That's the only change in the project. I now get WARNING: Use of undeclared Var clojure.walk/prewalk on a cljs

ricardo08:06:29

There we go. reagent-forms specifies clojurescript as a :dev dependency explicitly, which wasn't on my main project where the :scope was "provided".

cfleming09:06:07

@dnolen: Actually, my mistake, I broke some stuff with the type inference change.

martinklepsch09:06:17

What do people use for client-side CLJS error tracking? Considering Sentry (https://www.getsentry.com/for/javascript/)

martinklepsch09:06:14

Curious about other options simple_smile

borkdude09:06:13

I never have errors in clojurescript, it's so good

martinklepsch09:06:41

I just encountered a really weird one that I thought was gone: https://github.com/martinklepsch/pseudo-names-error Weirdly it was only reproducable on some computers and not on mine. Deploying with :pseudo-names true fixed it

borkdude09:06:24

where was that overview of different cljs versions and its functions?

borkdude09:06:26

made by @shaunlebron I think

borkdude09:06:11

I was wondering from what version on pprint is supported and in which namespace it is

borkdude09:06:40

it was mentioned by @dnolen

borkdude09:06:53

can anyone confirm that lein figwheel is working with then newest clojurescript 3308?

borkdude09:06:22

I get: Could not locate cljs/repl__init.class or cljs/repl.clj

minimal09:06:34

been working for me

ul10:06:14

@borkdude: update clojure dep to RC1

ul10:06:24

bumped in it about an hour ago

borkdude10:06:44

no go for me then, can't use compojure with that clojure version

minimal10:06:58

No? I’ve been using compojure with rc1

borkdude10:06:12

last time I tried something broke. I'll try again

borkdude10:06:53

damn, losing more time than I wished just to get pprint simple_smile

minimal10:06:40

you need to make sure you are using latest instaparse, think compojure updated if it uses it

borkdude10:06:10

I updated compojure, but I think I should also update yesql

mikethompson10:06:12

@martinklepsch: we ended up with a short list of two: https://raygun.io/ and https://airbrake.io/ and choose raygun. I no longer remember the reasons, but I do remember it was a coin toss between the two.

mikethompson10:06:57

Both could read sourcemaps to give cljs stacktraces, etc.

borkdude10:06:06

upgraded all deps and seems to work now. finally passed the 1.6.0 -> 1.7.0-RC1 barrier!

martinklepsch10:06:14

@mikethompson: Sentry also seems to be capable of doing that — did you evaluate it as well?

mikethompson10:06:34

I don't remember it.

mikethompson10:06:49

Without looking at the technical side of it, Sentry has the advantage of allowing for unlimited projects on the small plan.

martinklepsch10:06:00

And there is a free plan for when your code is almost bug free 😉 😆

tcrayford11:06:09

@mikethompson: @martinklepsch : BUY MY PRODUCT 😉

martinklepsch11:06:03

@tcrayford: Is Yeller supporting client-side error tracking? I checked but didn’t find any indication of it

tcrayford11:06:28

@martinklepsch: yep! Guess I gotta work on my marketing site a bunch

martinklepsch11:06:11

well then. TAKE MY MONEY bowtie

martinklepsch12:06:01

should have scrolled to the bottom of the page haha 😄

cfleming12:06:10

@dnolen: Ok, I’ve fixed a bunch of those cljs cases - most warnings are now interop

dnolen12:06:54

@cfleming: hurrah! simple_smile

dnolen12:06:20

@martinklepsch: re: externs, it should be easy to do generation for ClojureScript where we can observe foreign library usage (via leading js/). For foreign JS libraries you will still need hand written externs.

martinklepsch12:06:18

@dnolen: to me these to sentences seem conflicting? When does one use foreign libs without js/? (I haven’t)

martinklepsch12:06:43

also could work in that direction be reused to generate (somewhat) complete extern files?

dnolen12:06:03

@martinklepsch: transformed foreign libraries become Google Closure namespaces. They can be part of the build. For libraries like React you won’t need js/.

dnolen12:06:32

for foreign libraries which cannot be part of the build externs inference via js/ becomes useful.

martinklepsch12:06:12

ah, ok. Think I got it now simple_smile

dnolen12:06:11

yeah the externs inference bit is to address the problems we have today.

dnolen12:06:41

only time will tell if the foreign library module conversion is superior most of the time.

meow15:06:13

@martinklepsch: tenzing is awesome! So glad you did it. Was just what I was looking for. simple_smile

martinklepsch15:06:50

@meow: very happy to hear. Please ping back if you encounter any issues or would like to see something added simple_smile

meow15:06:32

Anyone interested in bootstrapping cljs apps using boot should definitely check out tenzing: https://github.com/martinklepsch/tenzing

meow15:06:30

@martinklepsch: Well ... since you asked. Here is my goal du jour. I want to create a single page app that uses hiccup syntax and garden, but have the css all be dynamic. It looks to me like the use of garden in tenzing is to generate a .css file. But I'm very new to all of this so I might be completely wrong. 😉

martinklepsch15:06:42

dynamic as in “generated on the client”?

meow15:06:51

I'm still trying to grok all the dom manipulation options out there. Google closure has one, om has one, dommy, domina, js/getElementById, etc.

martinklepsch15:06:32

@meow: getting familiar with using closurelib Closure is time well spent

dnolen15:06:02

@meow: Om doesn’t really have one. It’s just React. And agreed with @martinklepsch get familiar with using Closure for this stuff before going to the wrappers.

meow15:06:04

@martinklepsch: yes, but "injected" into the elements from garden code without using an actual css file - I don't have all the lingo down yet...

dnolen15:06:08

pkobrien: you generally want to avoid the browser stuff unless you don’t care about browser differences.

martinklepsch15:06:33

@meow: boot-garden (which is used in Tenzing) is primarily made for the “compile Garden to file” scenario.

martinklepsch15:06:11

@meow: are you using some React wrapper? if so it might be easiest to just supply styles to those components as maps without the intermediate step of garden

shaun-mahood15:06:22

@meow: Have you looked at any of the stuff Priyatam Mudivarti has built or presented on? I haven't gone in to the Garden stuff past generating a .css file, but he mentioned it at his Cloure West talk about Garden

meow15:06:02

I have long-term goals but am focusing on simple, intermediate steps at this point. One inspiration is this: https://www.youtube.com/watch?v=VjBjtuMer2c

meow15:06:43

@dnolen: thank you for the advice. simple_smile

martinklepsch15:06:07

@meow: didn’t watch the full video but maybe you mean dynamic as in “it’s reloaded automatically”?

meow15:06:27

@shaun-mahood: Priyatam Mudivarti's work with garden and "grids" (as defined by graphic designers) is my other big inspiration right now, yes.

meow15:06:24

@martinklepsch: According to the video there are no html or css source files.

martinklepsch15:06:53

yeah, in that video it might work differently — question is “what effect do you want to achieve?"

shaun-mahood15:06:54

@meow: Well I hope you come up with something cool! Using figwheel, reagent and 'lein garden auto' is working well for me now, but defining the CSS dynamically is one of my goals too.

martinklepsch15:06:38

for this kind of live coding it’s fine to load the css from a file, reloading mechanisms like boot-reload or figwheel will pick it up and send the changed file to the client

martinklepsch15:06:23

just try it out: 1) start app with boot dev 2) go to site 3) modify styles.clj 4) save file & watch browser styling change

meow15:06:34

The effect I want to achieve is this: have all html and css in cljs, not in source files (beyond a bootstrap index.html file). Enable live coding with the simplest mechanism possible before moving to om or reagent or re-frame.

martinklepsch15:06:27

then it’s probably best to just follow the setup that @danielsz has in his example

meow15:06:39

I also want to use boot, rather than leiningen.

shaun-mahood15:06:31

I haven't looked into boot at all, is there something as nice as figwheel for cljs development?

meow15:06:44

I will be creating several spa's in cljs that have no server dependencies.

meow15:06:16

@shaun-mahood: definitely check out tenzing

shaun-mahood16:06:58

Will do, thonks

shaun-mahood16:06:18

wow that's an ugly typo

ul16:06:05

boring people say thanks, real monks say thonks, real monkey say thonkeys, and clojurians used to be caught in thankfullnessless closures 😉 sorry simple_smile

shaun-mahood16:06:27

Ok, that made me laugh

borkdude19:06:35

is this serious? "600+ pages of professional-grade Angular ebook content"...

ul19:06:30

“incredibly easy”... but what about simplicity? 😉

ul19:06:53

however, there are much space for improvement in cljs space too, including react realms

quentin19:06:09

@borkdude: i am working with angular at work. recently, i read an article with tips about avoiding some side effects. It looked complex and overkill. But it’s actually the kinds of things you will do a lot. So a 600+ pages isn’t surprising to me.

borkdude19:06:40

@quentin: what do you mean avoid side effects? angular is one big side effect?

borkdude19:06:03

@quentin: can you give an example?

jarofghosts19:06:32

that is the best most terse explanation of what i don't like about angular i have seen

jarofghosts19:06:36

kudos, @borkdude

jarofghosts19:06:02

first class side effects

borkdude19:06:12

@quentin: I don't mean it unfriendly btw. Sincerely curious about your experiences.

quentin19:06:16

@borkdude: for example, side-effects that can happen with scoping

quentin19:06:28

or with 2-way binding

quentin19:06:52

(don’t worry, just busy here, will finish explanation after 😉 )

quentin20:06:40

@borkdude: so yeah, one concrete example would be this : recently, i made a directive (i guess you would call that a component) that render a graph with data that is on the scope of the controller. But the data is provided by an angular service, which retrieve the data from the server via ajax. the data lives in this service but is passed to the controller. The controller pass the data on the scope, the directive has access to the scope. You have 2 way binding, but the way the directive detect the change on the scope doesn’t work with any way of changing the data. So you need to know the proper way to update data that will make the directive understanding that there’s new data to read from.

shaun-mahood20:06:18

@quentin: Just reading that makes my head hurt

borkdude20:06:47

so the directive/component does not get notified when its data is changed? or it's watching data that gets overriden so it's not subscribed anymore, something like that?

quentin20:06:04

"it's watching data that gets overriden so it's not subscribed anymore” -> this

borkdude20:06:19

the object it's watching gets replaced

quentin20:06:47

yeah, so you need to do it a way that will change the object without replacing it

borkdude20:06:02

a wrapper object?

quentin20:06:50

well, in this case it was already on a wrapper object. this object contained multiple attributes, one of them contained a list. this list was the data to be rendered. The directive only watched the list, not the whole object. When i received the data, my first approach was to process the data into a new list and replace the previous list. This doesn’t work. You need to empty the previous list and add each list element with a loop. This way it works. Or you could nest another wrapper into the wrapper and watch this instead.

borkdude20:06:57

this reminds me of a problem I had with channels and Om actually simple_smile

quentin20:06:15

In both methods, you have some kind of additional complexity that makes the code harder to change/read.

quentin20:06:37

haven’t tried om seriously so cannot judge

borkdude20:06:59

I just mean these kind of problems have counterparts in other stacks

quentin20:06:05

yeah i am sure

borkdude20:06:53

what happened in my case was: I didn't realize that every time the component was mounted, a new channel was created. so I had a go loop that was still listening to an old channel

quentin20:06:55

to me the main issue of angular 1.x is that there’s just too much different kinds of components, filters, services, scopes options, weird methods...

quentin20:06:25

but they are aware of the issue and it looks like angular 2 will be much cleaner

borkdude20:06:28

@quentin: is that going to improve in angular 2?

borkdude20:06:36

ah... I'll wait for that then 😜

quentin20:06:00

it won’t be perfect of course, but nothing is simple_smile

quentin20:06:35

oh, the issue you had is interesting

quentin20:06:55

need to remember that it can happen when i will play with om

markstang20:06:19

@borkdude: Mount once 😉

borkdude20:06:48

@markstang: that's not always a good solution

borkdude20:06:01

@markmandel: you just need to know what's going on and handle that

borkdude20:06:24

@markstang: for example close the channel on willUnmount etc.

martinklepsch20:06:27

Uncaught TypeError: Cannot read property 'cljs$core$IFn$_invoke$arity$1' of undefined caused by the (apply every-pred @filters) here:

(let [filters  (reaction (map filter-mechanisms (get-in @db [:products/filtering] #{})))
      products (reaction (filter (apply every-pred @filters) (get-in @db [:products])))] 
  …)

martinklepsch20:06:11

wrangling this for some 30min now without a clue — anyone spotting something?

denik20:06:33

no need for apply?

martinklepsch20:06:22

if I replace the @filter with what it’s returning when derefíng in a log statement it works just fine.

martinklepsch20:06:08

@denik: if I have a collection of filters it’s needed I think

denik20:06:17

makes sense

dnolen20:06:43

@martinklepsch: you should have a stack trace for that error.

ul20:06:00

@martinklepsch: are you sure that filters alway derefed in a list?

ul20:06:16

may be nil in some point of rime

martinklepsch20:06:56

What’s confusing me is that it seems that the deref implicitly evaluates the fn it contains or so

martinklepsch20:06:36

@dnolen: trace is lost in ioc_helpers, probably upgrading chrome could fix that though

dnolen20:06:29

@martinklepsch: seems weird, still even inside a go loop if you break on exceptions you will be in the exact place where something went wrong

dnolen20:06:46

i.e. inside the apply call where it doesn’t work

ul20:06:13

@martinklepsch:

(filter (apply every-pred [nil]) [1 2 3])
ExceptionInfo #<TypeError: Cannot read property 'cljs$core$IFn$_invoke$arity$1' of null>  clojure.core/ex-info (core.clj:4591)

ul20:06:17

make sure you haven't mistype filter function name

ul20:06:20

in filters list

ul20:06:24

check compiler warnings

ul20:06:46

i guess it gives undefined in the list

ul20:06:51

(filter (apply every-pred [qw]) [1 2 3])
WARNING: Use of undeclared Var cljs.user/qw at line 1 <cljs repl>
ExceptionInfo #<TypeError: Cannot read property 'cljs$core$IFn$_invoke$arity$1' of undefined>  clojure.core/ex-info (core.clj:4591)

rauh20:06:45

@danielcompton: typo "agin"

rauh20:06:29

also a closing paren needed in the first pseudo code ex.

danielcompton20:06:06

@rauh: thanks, fixed!

rauh21:06:10

@danielcompton: I don't have any experience with reader cond. but I though you can pre-processes them with http://clojure.github.io/tools.reader/#clojure.tools.reader/read

danielcompton21:06:48

@rauh: sure, that sounds right

martinklepsch21:06:21

@ul: that seems like a promising lead. Does that also happen for you when you have (filter (apply every-pred []) [1 2 3])

martinklepsch21:06:14

makes sense now that I think about it but well...

ul21:06:26

we need cljs bot here definitely

ul21:06:39

to run some code 😃

martinklepsch21:06:30

that’d be sweet

martinklepsch21:06:48

haha, I was just going to post that exact same link :))

martinklepsch21:06:25

thanks again @ul

ul21:06:01

is it up to date? last time i've checked it was too outdated comparing with current cljs compiler

martinklepsch21:06:30

I thought @mfikes did a bunch of work updating it and the commits seem to confirm that: https://github.com/fogus/himera/commits/master

ul21:06:48

hurray! thanks, bookmarking

mfikes21:06:24

Yes, do *clojurescript-version* in Himera and you'll see it is relatively recent

ul21:06:28

one of really fun particular aspects of clojure community is name-choosing

ul21:06:43

take a list of top tools/libs written in clj/cljs and it full of fantasy

ul21:06:54

and humor

mfikes21:06:07

I suspect there's only been relatively minor bug fixes in the core language support between the released Himera and current ClojureScript release. Most changes these days are around REPLs, tooling support, etc. right?

ul21:06:53

cljs.user> *clojurescript-version*
"0.0-3211"
it is very fresh

cfleming21:06:03

@dnolen: Have you been using the spy-js stuff in WebStorm?

dnolen21:06:16

@cfleming: haven’t dug into that stuff

dnolen21:06:44

@mfikes: there’s a handful of stuff around transducers that probably needs to make its way into ClojureScript

cfleming21:06:06

@dnolen: It seems pretty nice - I’m not sure whether it would be more useful than a traditional debugger.

dnolen21:06:11

@mfikes: there’s @maria’s in progress GSoC stuff, and I’m also poking around at bootstrapping support

dnolen21:06:34

@cfleming: I should try it, just haven’t got around to it, the debugging stuff works great.

mfikes21:06:13

@dnolen: Yeah. It seems exceedingly rare that a low-level fix occurs in ClojureScript these days (related to proper evaluation semantics, for example). simple_smile

dnolen21:06:05

@mfikes: right we haven’t messed with essence of the compiler or analyzer in some time.

danielcompton21:06:52

@dnolen: how are you doing debugging with ClojureScript and Cursive?

dnolen21:06:02

@danielcompton: nearly everything from Clojure is supported

dnolen21:06:14

in Node.js or Browser *e will print the last exception

dnolen21:06:19

source mapping just works

dnolen21:06:27

for simple stuff println

dnolen21:06:35

for harder stuff I use Chrome DevTools

dnolen21:06:39

again source mapping just works

danielcompton21:06:40

@dnolen: sorry, I was meaning integrated debugging with Cursive, using IntelliJ’s features

dnolen21:06:54

@danielcompton: there isn’t any integrated debugging yet

dnolen21:06:11

but Chrome DevTools suffices in the mean time

danielcompton21:06:19

That’s what I thought, I misread your earlier message

dnolen21:06:18

if you’ve never tested a patch before

mfikes21:06:07

@dnolen thanks for promoting that one. Also, good if more in our community become comfortable rolling up sleeves to delve in at times. :) :)

dnolen21:06:45

@mfikes: it’s a nice enhancement but definitely the kind that needs some banging on to make sure it doesn’t come with unforeseen regressions

mfikes21:06:48

Applying and testing patches is gateway drug to the compiler :) Also, yes; testing warranted for that one.