shadow-cljs

https://github.com/thheller/shadow-cljs | https://github.com/sponsors/thheller | https://www.patreon.com/thheller
AJ Jaro 2020-12-22T01:16:54.090500Z

yep, that makes sense it’ll recompile, but from my experience that high CPU usage can sometimes continue for quite a while even after the build is completed.

2020-12-22T02:52:57.091600Z

Hey @thheller I have been playing around with https://github.com/jpmonettas/flow-storm and when I tried to wire it up from node.js output I ran up against an issue with how to include the ws npm package.

2020-12-22T02:53:30.092600Z

Because flow-storm leverages sente I figured I would look there

2020-12-22T02:53:56.093200Z

and https://github.com/ptaoussanis/sente/blob/master/src/taoensso/sente.cljc#L1062-L1064 seems to be the root of the issue, if I :require "ws" it isn't in a spot where sente expects

2020-12-22T02:54:06.093600Z

what is the recommended way to solve this?

2020-12-22T02:55:04.094800Z

Should I monkey patch the goog/global obj (this what I am planning right now), should I issue some kind of PR to sente, or does Shadow have some cool workaround in the config I can setup?

2020-12-22T02:55:12.095100Z

Maybe something else?

thheller 2020-12-22T10:17:42.096Z

@royalaid from what I can tell it expects the node websocket package, not ws? it certainly tries to hide that require as much as possible πŸ˜›

2020-12-22T16:57:32.097900Z

@thheller I think it is so that it works around some react native stuff, and ws is the npm websocket package complicating this all the more πŸ˜‚

thheller 2020-12-22T16:58:28.098800Z

I do understand why they do this hack. I do not understand why you are talking about the ws package. there is an actual websocket package they expect. at no point do I see any reference to ws?

2020-12-22T21:54:57.099700Z

Ya know, upon reflection I think you might be on to something. I may have been conflating the two this whole time.

thheller 2020-12-22T23:06:54.100300Z

shadow-cljs actually uses the ws package for node so you'll need both but as far as sente is concerned that expects websocket