Fork me on GitHub
#shadow-cljs
<
2018-11-29
>
flyboarder00:11:16

@souenzzo this is a java 11 thing, not specific to shadow-cljs

richiardiandrea05:11:16

Hi Thomas (sorry for the previous mention) - would you be interested in a "community maintained" branch 2.6.x but against Cljs 1.10.339? It seems like there are problems with source maps and expound and I was wondering if I can backport a couple of patches from 2.7.x except the cljs one

thheller08:11:51

@richiardiandrea no. I'd much rather look at the problems and fix them. so far I haven't heard of any problems though.

romdoq09:11:43

When running a :browser-test build of my project, it looks like specs don't get cleared when hot reloading, so some tests appear to still work until the page is reloaded and the registered specs cleared. I've just been re-namespacing a bunch of my specs, and was confused why tests weren't failing when I knew they should. Is this a (known?) issue, or might I have just misconfigured something?

thheller09:11:35

just reload the page to get rid of old tests. they do are not currently removed properly that is true

thheller10:11:04

@richiardiandrea I assume this is the source map problem you mentioned? https://dev.clojure.org/jira/browse/CLJS-2993 added a patch for that. whats up with expound?

romdoq10:11:03

that's what I thought, thanks. Should I file an issue for the old specs not being removed?

thheller10:11:30

yes please otherwise I forget again

aisamu10:11:59

Good morning! Is it possible to have a cljs REPL connected to an :npm-module target? ProtoREPL works with the base REPL, but as soon as I change to the build repl no further command works (even though the ns changes to cljs.user, and the message for :cljs/quit appears)

thheller11:11:00

@aisamu its a bit complicated for :npm-module given that we are not in control how the JS is loaded

thheller11:11:34

it is sort of possible if you require("shadow-cljs/shadow.cljs.devtools.client.browser") from the JS

aisamu11:11:27

I see, thanks! Will give it a try later today

romdoq11:11:46

@aisamu fwiw, I'm having good success using something like this in my main CLJS entry point:

(goog-define EMBEDDED_DEV false)
(when EMBEDDED_DEV
  (defonce _dirty_repl_hack
    (js/require "my-module/build/npm/shadow.cljs.devtools.client.browser")))
This doesn't require anything additional in the embedding javascript project, and will get optimized away in release builds

👌 4
vigilancetech16:11:43

when I launch my app like this: $ electron public/main.js it gives me this:

REPL client error { Error: connect ECONNREFUSED 192.168.43.81:9630
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1161:14)
  errno: 'ECONNREFUSED',
  code: 'ECONNREFUSED',
  syscall: 'connect',
  address: '192.168.43.81',
  port: 9630 }
REPL client disconnected
and now cider-connect-cljs gives me a failed error. 9630 isn't my repl port. It's the shadow console port. I've tried blowing off ~/.cache and .shadow-cljs in the project dir. Also rmmed .nrepl-port in the project dir. How do I fix?

vigilancetech16:11:44

when I visit localhost:9630 I get:

shadow-cljs
Project: /home/kevin/0work/guardian-dashboard
Release Snapshots

vigilancetech16:11:00

rather than the normal shadow console

thheller17:11:04

@vigilancetech 9630 is the default port used by the shadow-cljs webserver which serves the websockets used for the REPL

thheller17:11:31

but it only typically connects to localhost? not sure why it tries to connect to an IP?

thheller17:11:45

did you set some related config in the :devtools?

thheller17:11:37

also you may want to upgrade if 9630 still shows "Release Snapshots"

thheller17:11:44

sounds like a rather old version

aisamu18:11:46

Good afternoon! Is it possible to locate the (simple) externs file somewhere else? A quick glance at the source seems to indicate that no, but I'd rather be sure! (a symlink is working) And is there a reason for keeping inference warning on properties that are defined in the externs file? I've hinted things covered by the externs just to clear the warnings - they're very useful and I didn't want to add noise there.

vigilancetech20:11:53

:devtools {:http-root "public"
                                :http-port 8080}}

vigilancetech20:11:41

@thheller I just updated to [email protected] and I get the same error

thheller20:11:01

@aisamu no idea what you are talking about. if you add hints you don't need to define them anywhere else?

aisamu20:11:14

When I add hints I don't have to define externs because that's taken care of. But when I add externs without hints, even though the final code is correct (doesn't munge the calls I've asked) I still get the "Cannot infer type" warning.

thheller20:11:28

ah now I get it

aisamu20:11:49

On this specific instance I'd prefer hints because this will probably be used in a lot of places... (immutableJS's toJS(), get and so on). Adding hints clears the errors and the warnings. Adding externs clears the errors only.

thheller20:11:50

ah yeah thats a bug

thheller20:11:05

please open an issue. the simplified externs are just not token into account for the externs inference thats all

aisamu20:11:25

Got it, thanks! And, regarding their location, is there a way (even if hacky) to specify a place other than externs/build.txt?

thheller20:11:21

not currently no but I can add a config option for that if you need

aisamu20:11:58

That'd be very nice! It's mainly for consistency with the existing project's structure. (JS, with shadow-cljs painlessly bolted on. Thanks for this lovely tool!)

currentoor20:11:43

i just realized server mode picks up changes to shadow-cljs.edn without needing a restart!

currentoor20:11:48

that’s really cool!

thheller20:11:56

you can do pretty much everything without a restart. only changing CLJ(S) deps currently requires restart

currentoor20:11:30

you’re putting other build tools to shame lol

macrobartfast22:11:02

@thheller you are getting compliments at the Clojure Conj for being very helpful to folks.

❤️ 8
lilactown23:11:45

thheller is a saint

❤️ 12