Fork me on GitHub
#shadow-cljs
<
2019-06-13
>
sogaiu13:06:38

i was just helped by: https://code.thheller.com/blog/shadow-cljs/2017/10/15/externs-the-bane-of-every-release-build.html#covering-the-last-few-percent -- for some reason, vscode.Position is not handled by inference (though vscode.Range is), i guess. would reporting this somewhere possibly help to improve the current inferencing?

thheller14:06:18

how did you use it in code?

lgessler19:06:57

hi all, when i navigate to my dev server in chrome, I get a bunch of ERR_INSUFFICIENT_RESOURCES--it seems like too many requests for individual .js files are going out and chrome is choking. it works fine in firefox though. has anyone run into this issue before? i haven't even written much code in this project yet, so i'm not sure what to try

lgessler19:06:27

(fwiw it looks like the .js file count is so high because i have material-ui as a dep, though of course i'd like to avoid the solution "stop using material-ui" 😬)

sogaiu21:06:10

@thheller i used it like this:

(defn position
  [r c]
  (vscode.Position. r c))

(defn range
  ([p1 p2]
   (vscode.Range. p1 p2))
  ([r1 c1 r2 c2]
   (vscode.Range.
    (position r1 c1)
    (position r2 c2))))
where above there was (def vscode (js/require "vscode"))

thheller21:06:09

yeah thats not a supported construct for externs inference

thheller21:06:34

you should use the proper (:require ["vscode" :as vscode]) and then vscore/Range

sogaiu22:06:14

that seems to work 🙂