Fork me on GitHub
#clojurescript
<
2016-08-19
>
xcthulhu01:08:34

Is it possible for me to use typed ES 6 code in my clojurescript project?

jm01:08:29

It’ll have to be compiled down to runnable js. http://lukevanderhart.com/2011/09/30/using-javascript-and-clojurescript.html goes over it pretty well (although not specific to es6 code)

xcthulhu01:08:45

@jm: I am currently using google-closure library style JS, pretty similar to this project - https://github.com/gfredericks/goog-integer

xcthulhu01:08:36

It looks like the closure compiler has native support for typed ES6, so I was hoping I could slap a comment at the top of the file or something and it would do its thing.

xcthulhu01:08:34

I mean I'm adding types in my JSDoc strings anyway, might as well do it for real

jm01:08:01

@xcthulhu I didn’t realise closure compiled typed ES6, where are you reading that?

jm01:08:46

@xcthulhu thanks, I’m not aware of any support for it, sorry I can’t be much help. Discussion in https://groups.google.com/forum/#!topic/closure-compiler-discuss/5YJJu5BEndQ might be relevant, sounds like they may have moved focus.

octahedrion13:08:47

@mfikes does Planck repl have interop with OSX libs like through Obj-C ?

mfikes13:08:28

@octo221 No. All of the Obj-C code that interoperates with low-level stuff is essentially hard-coded.

mfikes13:08:11

In addition, Planck is moving away from Obj-C, to C, for portability.

lvh13:08:22

Cool! Is that portability in the not-just-OS-X sense, or something else?

lvh13:08:41

I love Planck, but I also appreciate that it only works because I have a Mac anyway.

mfikes13:08:24

@lvh Yeah, it exists for Linux now.

lvh13:08:46

Awesome. Thank you!

lvh13:08:25

I didn’t know JSC ran on other platforms; that’s pretty cool.

dnolen14:08:56

@lvh it should run on Windows too I thought (not sure how much work is involved)?

mfikes16:08:07

@lvh In addition, JSC ships with Ubuntu 16.04 Desktop, and the Planck 2.0 alpha makes use of it.

timgilbert16:08:21

Hey all, with the new macro stuff, I was hoping to be able to use (:require [clojure.core.async :refer [go]]) but that still seems not to work in cljs 1.9.216

anmonteiro16:08:10

@timgilbert: macro inference only works when the macros/non-macros namespaces are the same

timgilbert16:08:33

Ah. Any plans to unify this interface between clojure/clojurescript?

anmonteiro16:08:37

In your case you still need to require-macros cljs.core.async.macros

dnolen17:08:18

@timgilbert needs to be fixed in core.async, but a pretty huge breaking change

dnolen17:08:32

so questionable whether it’s worth it

dnolen17:08:48

but probably worth opening an issue about

timgilbert17:08:05

I see, thanks @dnolen. I'll file a ticket just to have a place for discussion

dnolen17:08:46

@timgilbert I would check first it doesn’t already exist of course

timgilbert17:08:35

I didn't see it in an initial scan of JIRA but I'll look a bit more closely

timgilbert18:08:27

Ah, there is an existing issue about combining cljs.core.async.macros and cljs.core.async: http://dev.clojure.org/jira/browse/ASYNC-119

timgilbert18:08:51

I'll add a note to that ticket about the latest developments

dnolen18:08:54

@timgilbert I suspected as much

juhoteperi18:08:25

I believe the macros could be moved without breaking the API: macros can be moved to the main namespace and then the macros namespace could have wrappers (not sure what to call these) for compatiblity

timgilbert18:08:31

Yeah, I just added a note to that effect on the ticket

dnolen18:08:22

@juhoteperi not a bad idea, somebody should submit a patch for that

juhoteperi18:08:30

@dnolen: Just working on it

juhoteperi18:08:58

Aaand I think I got it working

juhoteperi19:08:42

The change will be breaking if the user is using same alias with both macros and normal ns, but that was already deemed unsupported, so I don't think that is a problem

juhoteperi19:08:58

I guess most are using :refer with core.async macros

juhoteperi19:08:26

And patch attached 🙂

curlyfry21:08:53

I'm using secretary for routing, and I want to link to a certain element, like https://github.com/clojure/clojurescript#getting-started I've had no luck so far, any tips?

timgilbert22:08:49

@curlyfry: The keyword you're probably looking for is "fragment" (the bit after the hash in a url). It looks like there's an open PR in secretary about fragment handling: https://github.com/gf3/secretary/pull/84

timgilbert22:08:45

Hmm, I guess that's more about parsing them though...

curlyfry23:08:22

@timgilbert: Thanks, but yeah, still not making much progress