Fork me on GitHub
#cursive
<
2015-11-11
>
grav21:11:24

Is there a way to get syntax support for js interop in clojurescript?

grav21:11:07

eg removing warnings and even getting completion on stuff like

(let [ctx (js/AudioContext.)]
  (prn (.-currentTime ctx)))

cfleming22:11:17

@grav: No, I’ve been meaning to turn those warnings off, because it’s very difficult to correctly resolve js interop.

cfleming22:11:34

I’m also planning to improve it, but it’s quite difficult to do well.

grav22:11:31

@cfleming: removing warnings is probably good enough. They’re quite attention-seeking 😉

cfleming22:11:01

I’m planning to try to implement inference like Tern, but that’ll take a while to get to.

cfleming22:11:08

Cursive does it now for Java interop though.

grav22:11:12

that’d be cool!

grav22:11:11

Would interop with externs be any help?

cfleming22:11:42

Yeah, that’ll be required, I think.

cfleming22:11:50

Currently my JS parsing is pretty ghetto.

cfleming22:11:07

Rather, I use Rhino to parse, but the analysis is pretty ghetto.

grav22:11:42

ie pragmatic? 😉

grav22:11:44

it’s not a killer through. I try creating a namespace for each js api that I’m interop’ing with. So it’s only those certain namespaces that are ‘lighting up’ 😉

cfleming22:11:50

Pragmatic is a much more polite way to put it.

cfleming22:11:10

I’ll take a look when I can, but I’m busy getting ready for conj right now.