This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-10-12
Channels
- # announcements (13)
- # aws (18)
- # babashka (60)
- # babashka-sci-dev (83)
- # beginners (32)
- # biff (18)
- # calva (22)
- # cider (8)
- # clj-on-windows (101)
- # clojure (59)
- # clojure-bay-area (2)
- # clojure-europe (36)
- # clojure-india (4)
- # clojure-nl (3)
- # clojure-norway (5)
- # clojure-spec (4)
- # clojure-uk (1)
- # clojurescript (5)
- # conjure (1)
- # core-async (10)
- # cursive (7)
- # data-science (5)
- # datahike (10)
- # datalog (11)
- # datomic (3)
- # docker (3)
- # figwheel-main (2)
- # gratitude (3)
- # improve-getting-started (1)
- # introduce-yourself (5)
- # jobs (3)
- # joyride (12)
- # leiningen (1)
- # lsp (67)
- # malli (27)
- # off-topic (36)
- # random (1)
- # rdf (1)
- # re-frame (17)
- # reagent (21)
- # reitit (4)
- # releases (4)
- # remote-jobs (2)
- # ring (2)
- # sci (35)
- # shadow-cljs (28)
- # sql (3)
- # squint (9)
- # tools-deps (11)
Is there a way to get shadow-cljs to never give up on reconnecting the websocket? It's annoying to have to refresh the page every time I'm disconnected from the backend for more than a few minutes.
well, anywhere between a few minutes to hours
it happens when: • I'm running locally and my laptop goes to sleep. • I'm running against a remote host and my SSH session dies.
I see the point in theory (i.e. in production scenarios) of giving up on the websocket, but in practice it only happens during development, and I don't think people would mind if shadow-cljs kept retrying to connect forever when they're developing
yeah it doesn't always happen when sleeping
When requiring a js namespace with a string require (eg. ["complex.js" as Complex]
), using the alias as a type hint (eg (defn angle [^Complex a] (.arg a))
) doesn’t have the same effect as eg. ^js
and breaks in advanced. Would it make sense to handle it like ^js
, since (I believe) Complex
would otherwise be treated as something from javascript-land?
there is very little logic in the type stuff and even less for :as
since that usually means namespace alias
I mean technically I guess it could be changed but I think that change would need to be in cljs.analyzer
I was hoping that ^Complex
would work since it would have saved me the cljc fork inside the code
@U05224H0W is there some way to have a warning emit for spots where inference fails? it does seem that SOME of the non-`^js` tagged spots are fine under advanced compilation
I'm not aware of any "spots where inference fails", besides a couple places in core.async
things that are already part of known externs won't warn. many "common" things are already covered, eg. all DOM things like clientX
and whatever
I guess I mean spots where not including the js hint causes a breakage
(defmethod g/magnitude [::complex] [a]
#?(:clj (.abs ^Complex a)
:cljs (.abs ^js a)))
so it sounds like this is what’s required, @U05224H0W, for a cljc file?it’s “coincidence” that both js and jvm share the .abs
name so I guess it was cheating to try and share them before 🙂
I checked why the code didn't already handle this. turns out it was just because of a too specific assumption
so (:require ["some-npm" :as x])
and ^x/Complex
worked but not ^x
. should be fine as of 2.20.5. should be fine with clojure style annotations assuming they can all be resolved the same
okay, I took a pass and just made it totally clear by adding ^js
all over
Should lazy/loadable
be called at namespaces' top level, or is it fine to call it when it's used, e.g. in a Reagent component?
alright, thanks