This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-10-22
Channels
- # 100-days-of-code (3)
- # announcements (7)
- # beginners (147)
- # cider (22)
- # cljdoc (24)
- # cljs-dev (71)
- # cljsrn (8)
- # clojars (3)
- # clojure (45)
- # clojure-conj (11)
- # clojure-dev (1)
- # clojure-italy (21)
- # clojure-nl (2)
- # clojure-spec (76)
- # clojure-sweden (2)
- # clojure-uk (100)
- # clojurebridge (3)
- # clojurescript (15)
- # cursive (7)
- # data-science (2)
- # datomic (7)
- # emacs (9)
- # events (2)
- # figwheel-main (4)
- # fulcro (117)
- # jobs (2)
- # jobs-discuss (21)
- # leiningen (184)
- # nyc (4)
- # off-topic (50)
- # planck (6)
- # re-frame (14)
- # reagent (25)
- # ring-swagger (5)
- # shadow-cljs (96)
- # spacemacs (5)
- # sql (26)
- # tools-deps (12)
- # uncomplicate (1)
- # yada (3)
Now I'm trying to take the shadow-cljs electron example code (https://github.com/shadow-cljs/examples/tree/master/electron) and connect to the main and renderer processes with emacs cider-connect-cljs (renderer first) then with cider-connect-sibling-cljs (main). When I do the renderer everything looks okay (other than a middleware mismatch error cuz I'm using the latest snapshot) but when I do the sibling it appears to give me the same repl and it has a bunch of errors:
...
;;
;; You can remove this message with the <M-x cider-repl-clear-help-banner> command.
;; You can disable it from appearing on start by setting
;; ‘cider-repl-display-help-banner’ to nil.
;; ======================================================================
shadow.user>
WARNING: clj-refactor and refactor-nrepl are out of sync.
Their versions are 2.4.0 (package: 20180826.2149) and n/a, respectively.
You can mute this warning by changing cljr-suppress-middleware-warnings. To quit, type: :cljs/quit
[:selected :renderer]
WARNING: No such namespace: shadow, could not locate shadow.cljs, shadow.cljc, or JavaScript source providing "shadow" (<stdin> at 1:55)
WARNING: Use of undeclared Var shadow/watch (<stdin> at 1:55)
WARNING: No such namespace: shadow, could not locate shadow.cljs, shadow.cljc, or JavaScript source providing "shadow" (<stdin> at 1:76)
WARNING: Use of undeclared Var shadow/nrepl-select (<stdin> at 1:76)
cljs.user>
there's a 2nd repl buffer that is created with similar, but not quite exactly the same, results:
...
;;
;; You can remove this message with the <M-x cider-repl-clear-help-banner> command.
;; You can disable it from appearing on start by setting
;; ‘cider-repl-display-help-banner’ to nil.
;; ======================================================================
WARNING: clj-refactor and refactor-nrepl are out of sync.
Their versions are 2.4.0 (package: 20180826.2149) and n/a, respectively.
You can mute this warning by changing cljr-suppress-middleware-warnings.
shadow.user> TypeError: shadow.watch is not a function
at eval (eval at <anonymous> (file:///home/kevin/0work/examples/electron/app/js/cljs-runtime/shadow.cljs.devtools.client.browser.js:829:8), <anonymous>:4:8)
at eval (eval at <anonymous> (file:///home/kevin/0work/examples/electron/app/js/cljs-runtime/shadow.cljs.devtools.client.browser.js:829:8), <anonymous>:7:3)
at file:///home/kevin/0work/examples/electron/app/js/cljs-runtime/shadow.cljs.devtools.client.browser.js:829:8
at Object.shadow$cljs$devtools$client$env$repl_call [as repl_call] (file:///home/kevin/0work/examples/electron/app/js/cljs-runtime/shadow.cljs.devtools.client.env.js:139:108)
at Object.shadow$cljs$devtools$client$browser$repl_invoke [as repl_invoke] (file:///home/kevin/0work/examples/electron/app/js/cljs-runtime/shadow.cljs.devtools.client.browser.js:827:46)
at shadow$cljs$devtools$client$browser$handle_message (file:///home/kevin/0work/examples/electron/app/js/cljs-runtime/shadow.cljs.devtools.client.browser.js:907:44)
at Object.shadow$cljs$devtools$client$env$process_ws_msg [as process_ws_msg] (file:///home/kevin/0work/examples/electron/app/js/cljs-runtime/shadow.cljs.devtools.client.env.js:258:102)
at WebSocket.<anonymous> (file:///home/kevin/0work/examples/electron/app/js/cljs-runtime/shadow.cljs.devtools.client.browser.js:1002:40)
shadow.user>
The 2nd repl's buffer status says it's only pending. The renderer repl doesn't initially have those (non-middleware) errors until after the sibling is created.
From the terminal(s) the repls work perfectly. The renderer can do things like (js/alert "foo") and it works. The main issues an error when trying to do that (as it should because its only the launcher).
Help!?!?@vigilancetech sounds like emacs is not capable of managing two connections?
“disclose source” - do you know what does it mean in practice? It force to public sorce when modify “program” / use “program”? Public source of EPL licensed “program” or whole app using this “program” as a dependency.
but the question is: for example if somebody will write wrapper on shadadow-cljs will be forced to public source or not? It is dependency, not modification of the code itself.
hehe yeah ... to be honest I just looked at the summary on github and that looked ok
basically anyone can do anything they want as long as they publish the source. and I can't be sued for bugs 😛
just thinking if there is any risk for developers if they use source code with EPL license they will have to public app / part of they app
And for myself if I have to add some extra informations to my app about ALL deps license…
because the question is if using “program” as dependencies force me to license conditions. Or as long as it is deps only it doesn’t matter.
Sorry, I know it is not the topic for this channel. Just blowing my mind and nobody really understand and can answer 🙂
from my perspective you can do whatever you like with shadow-cljs BUT if you make a commercial profit I expect you to contribute back any actual changes you make
yeah, but I am talking about license not shadow-cljs directly. It seems everybody don’t care about licenses, but I have some experience about law. I really expect the worst always. Bad things happening however you try be legal 🙂
shadow-cljs - starting ... [:app] Compiling ... The required namespace “infinitor.collector.core” is not available.
@thheller have you ever looked into what it would take to have a system-wide shadow-cljs compile server rather than having to spin up a JVM for each project?
@vigilancetech yes I have but it would be too much work and probably not worth the effort
Why does shadow-cljs as default split the source paths up as src/dev, src/main and src/test?
the reasoning is that you'll often have sources that are only for tests or development
between main and test sure. Bit different from how lein sets it up, but I’m not fussed about it. Trying to fit src/dev into the mental model
@vigilancetech the problem really is classpath isolation. each project has its own set of dependencies and those do not always match. can only load one version of a lib at a time
@thheller could Stewart Sierra's components help with that?
just trust me when I say that I tried various different approaches and all of them had too many drawbacks to be worth the trouble
not meaning to pester you about it, but it sounds like boot has something in it that may provide that sort of isolation if you ever want to check it out sometime. Having a bunch of people developing on one server isn't that common nowadays, however maybe there might be a use for it in CI
please ... I thought about this for a very long time ... there is nothing to be gained
IF I want full classloader isolation then each "pod" (when using boot terminology) will load its own clojure version and dependencies
sure if you don't care about classloader isolation then you can optimize a few things
but I care very much about that since dealing with dependency conflicts is already complicated enough
the upcoming launcher UI will make it easier to manage multiple shadow-cljs instances so you don't have to have a terminal open for each
but running multiple projects in the same JVM is a not something I'm going to pursue further
@thheller just following up on previous discussion I have filled the issue for the 206 http codes here:https://github.com/thheller/shadow-cljs/issues/396.
yeah I took a look this morning. unfortunately I can't easily use the undertow handler directly
@thheller well, I wasn't so much concerned about the start up time as the memory footprint of multiple servers. I happen to be running on a pretty small machine (which is why I'm looking at moving to bootstrap). Although my situation is unusual, I'd think that in a build farm it would also be a concern.
add :jvm-opts ["-Xmx1G"]
to you shadow-cljs.edn
to limit the amount of memory to 1gb
depending on your project really. closure needs the most memory when optimizing so I wouldn't go lower than 512M
yeah, well, soon enough I'll probably have a bigger machine, but I've got this little ARM TV box I'd just love to see being able to be turned into a professional development system for up and coming, but otherwise impoverished programming apprentices
IIRC, when I started multiple servers, each was taking about 700MB of resident memory
Well, thanks for your help/info @thheller, and I really love what you've done with this tool. Back when I was on boot it was hell to try and get a reliable REPL going, much less connect to it with cider. Plus I think it was a bit of overkill for what I needed (that may change in the future, IDK). Can you think of a situation where shadow would be vulnerable to the problems boot's pod isolation solves? Like a resident dependency in the development machine that gets overlooked in the config file that doesn't exist in the target machine throwing an error?
well dependency issues are always possible depending on how complicated you make your setup
I never had this problem though so I'm not sure how you'd even get into that situation
fortunately I haven't either, but the boot documentation seems to make it sound like a serious concern. Not sure if its enough of a threat to have to deal with the extra complexity of getting it all configured though. Certainly not for me, right now.