Clojurians
#cljs-dev
<
2018-03-16
>

This page is not created by, affiliated with, or supported by Slack Technologies, Inc.

mfikes03:03:53

Huh. TIL, if you put an alias like this in your ~/.clojure/deps.edn:

:cljs-built {:extra-deps {org.clojure/clojurescript {:mvn/version "RELEASE"}}
                  :main-opts ["-m" "cljs.main"]}
then clj -Acljs-built will run whatever was the last version you deployed locally via script/build (Up until now, I've been manually editing that file each time with the explicit version number.)

mfikes03:03:10

Or perhaps it is the high-versioned number. Hrm.

john05:03:19

so I got the java-websocket/weasel thing semi working

john05:03:58

I'll try to push out a dep tomorrow

john05:03:58

It's pretty buggy as is though

dnolen08:03:19

@juhoteperi it’s not really possible to use the npm deps with the Node REPL w/o setting -d

dnolen08:03:53

maybe there’s a way to mess w/ NODEPATH to get this to work, but I couldn’t figure it out - it’s definitely not a blocker

juhoteperi09:03:11

Yeah. Maybe something to document somewhere, or if possible, give warning about when trying to do that.

dnolen10:03:00

fix coming soon to make :npm-deps usage from REPLs considerably more robust

dnolen10:03:09

also REPLs will use the same compilation pipeline as build instead of the weird old stuff

dnolen14:03:44

there are some fairly dramatic changes to how REPLs work, it would be a good time to test master

dnolen14:03:56

I should clarify - dramatic changes with respect to how REPLs handle requires

dnolen14:03:43

the upside is that loading JS modules via the REPL should be much improved

dnolen14:03:10

loading JS modules via node_modules directly or through a namespace should work much better now (especially in non-Node.js context)

dnolen14:03:32

@richiardiandrea ^ your issues didn’t really have anything to do with Socket REPL in the end - just a dupe of the other reports about JS module deps not working at the REPL

richiardiandrea15:03:27

@dnolen thanks I just finished looking at both commits for the reports, thanks for working on this, I will test today

dnolen16:03:50

@mfikes 2668, which test is that?

dnolen16:03:16

lein test takes forever, would like to zero in on the problem if you have that info

mfikes16:03:25

I couldn't find it... will dig some more

mfikes16:03:53

Ahh, perhaps this is actually it, I get this locally @dnolen

ERROR in (test-emit-global-requires-cljs-2214) (analyzer.cljc:2098)
Uncaught exception, not in assertion.
expected: nil
events.js:112
      throw er; // Unhandled 'error' event

dnolen16:03:40

great thanks

dnolen17:03:31

if you have time to kick the tires on master that would be great

dnolen17:03:05

down to two issues, neither are really critical

dnolen17:03:55

I’d like hear feedback from compiler contributors before kicking off another pre-release - something could have slipped into REPLs

dnolen17:03:25

mostly wrapping up for the day but will check in later

john19:03:38

The cljws chat server thing ran fine. The only very minor thing I've noticed is that when launching just a local cljs repl with clj -m cljs.main the repl no longer prints the *clojurescript-version* before the prompt. (lol, nm, cljws would in no way test cljs.main :joy:)

richiardiandrea19:03:31

tried socket REPL on my kind of big app and still getting a bunch of clojure.lang.ExceptionInfo: pg does not exist {:cljs.repl/error :invalid-ns}

richiardiandrea19:03:48

will try to make a minimal repro, weirdly enough CLJS-2613 seems solved

richiardiandrea19:03:54

this might be something else

mfikes19:03:05

@richiardiandrea I wonder if this is similar to your pg error https://dev.clojure.org/jira/browse/CLJS-2669

richiardiandrea19:03:16

No no I am detecting this with other :npm-deps as well so that one was solved, you need to get the right combination of -m cljs.main -c ... -r, trying things out...

richiardiandrea19:03:51

will try more later

richiardiandrea19:03:35

so it looks like you cannot have socket REPL AND cljs.main at the same time, probably this is expect, I remember David telling me about this

dnolen19:03:54

Not doing that now

richiardiandrea19:03:57

better phrased as:

$ clojure -J-Dclojure.server.repl="{:port 5555 :accept cljs.servenode/repl :args [{:opts $(cat cljsc_opts.edn)}]}" -Srepro -m cljs.main -re node -r
cljs.user=> (require 'cli-repro.core)
module.js:540
    throw err;
    ^

Error: Cannot find module 'left-pad'
    at Function.Module._resolveFilename (module.js:538:15)
    at Function.Module._load (module.js:468:25)
    at Module.require (module.js:587:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/tmp/out37982595520967933633430947311539/cli_repro/core.js:4:39)
    at Module._compile (module.js:643:30)
    at Object.Module._extensions..js (module.js:654:10)
    at Module.load (module.js:556:32)
    at tryModuleLoad (module.js:499:12)
    at Function.Module._load (module.js:491:3)
cljs.user=>
but:
$ nc localhost 5555
cljs.user=> (require 'cli-repro.core)
Reading analysis cache for file:/home/arichiardi/tmp/cli-repros/src/cli_repro/core.cljs
Padded: 00042
nil
cljs.user=>

dnolen19:03:48

Like I said on hold

dnolen19:03:55

Just bugs off master

john19:03:04

mfike's repl stress test gist is running fine on master against chrome atm

john19:03:22

10,000 messages sent so far

mfikes20:03:02

I wonder if this might confuse a new user going through QuickStart

cljs.user=> (require '[hello-world.core :as hello] :reload)

cljs.user=> Hello world!
(The print happening at the prompt.) I have no good thought as to a good solution.

john20:03:36

Actually might be a good point of education

john20:03:08

as with having the apostrophe in the namespace, requiring the user learn about underscored directory names

mfikes20:03:51

It appears to be a peculiarity of the async nature of the browser REPL. Here is Node, for example:

cljs.user=> (require '[hello-world.core :as hello] :reload)
hello world
nil
cljs.user=>

mfikes20:03:05

I successfully ran through Quick Start with master, with the only thing of note being https://dev.clojure.org/jira/browse/CLJS-2661

darwin20:03:19

I have also seen a lot of CLJS-2661 when trying to test some of my code with clojurescript master…

john20:03:19

ah, I see what you're saying

john20:03:27

yeah, perhaps the prompt is returned before the results are received

dnolen20:03:54

We can just suppress 2661

mfikes20:03:56

Yeah, I'm just overly worried abut any small blemish in the new user experience

mfikes20:03:22

I was looking how to suppress 2661. Will more.

mfikes20:03:31

As a separate effort, I'll check that our :closure-warnings keyword list mapping is up to date.

darwin21:03:10

I’m happy to say that Dirac works fine with clojurescript master. And best part is that I didn’t have to change a single line of code. Good job! Thanks :slightly_smiling_face:

mfikes23:03:57

A JSC_UNSAFE_THIS suppression is now in CLJS-2661 (Closure evidently doesn't currently expose a public way to do this)