Fork me on GitHub
#clojurescript
<
2018-12-04
>
dpsutton00:12:06

i'm checking a patch for data.avl. I have no spidermonkey or v8 installed but is it possible to run the unit tests in node?

helios09:12:13

@nbtheduke last weekend 😛 so in roughly one year. But there's plenty of other Clojure conferences (ClojureD in Germany, Dutch Clojure days here in Amsterdam, etc. )

NoahTheDuke11:12:19

Haha aw bummer! I’ll have to watch for that next year then. Looks like it was North Carolina? I could do that trip, damn. Thanks for the heads up.

1
borkdude15:12:00

how should I get my cljs dev running on port 8090 with a repl?

clj --main cljs.main -w src -p 8080 -s localhost:8090 --compile my-app.core -r
?

borkdude15:12:16

Port 9000 is already occupied on my machine

borkdude15:12:53

somehow the browser still tries to connect to port 9000

borkdude15:12:45

maybe someone has a minimal tools.deps cljs.main project laying around I can look at?

dnolen15:12:02

@borkdude -h should show you how to do it

borkdude15:12:24

I know, but can’t figure it out

borkdude15:12:37

I want essentially the same as the quickstart, but my own index.html and a different port

dnolen15:12:16

@borkdude clj -m cljs.main -p 9001 -r worked for me

borkdude16:12:53

clj --main cljs.main -w src -p 8090 --compile my-app.core -r serves the right index.html page on localhost:8090, but I see a call in the console to localhost:9000/repl

dnolen16:12:15

@borkdude I don't know, the above command is just working for me

dnolen16:12:23

try removing out I guess

dnolen16:12:14

since port has to be written out to generated source, maybe there is a caching issue here

borkdude16:12:11

tried. also disabled the browser cache.

dnolen16:12:50

well I would try what I'm doing above first, outside of whatever you're doing

dnolen16:12:54

it only takes a few seconds

borkdude16:12:32

yes, I tried it (but with port 8090). what works is: I see a page loading my index.html. the only thing not working is the repl

dnolen16:12:55

right and I'm saying I just tried and the REPL works 🙂

dnolen16:12:14

so maybe environmental - but just start a fresh project and try the above

dnolen16:12:40

if that doesn't work then we know to start looking for problems

borkdude16:12:33

yeah that works

dnolen16:12:06

note that with cljs.main we don't write to out anymore

dnolen16:12:24

by default - instead to OS temp dir

dnolen16:12:53

so that you can launch a REPL anywhere a la Clojure w/o seeing stuff

dnolen16:12:06

so perhaps you didn't actually remove the caches like you believe you did

dnolen16:12:11

so specify -d out

dnolen16:12:26

and check that 9000 isn't getting dumped somehow into the generated sources

borkdude16:12:51

oh, I did rm -rf out indeed…

dnolen16:12:08

clj -m cljs.main -p 8090 -d out -r

dnolen16:12:34

note you always needs to specify -d out or supply a build config EDN etc. etc.

borkdude16:12:43

well, I cleared the out dir and specified it with -d. In out/clojure/browser/repl.js I see:

/** @define {number} */
goog.define("clojure.browser.repl.PORT",(9000));

borkdude16:12:27

$ find .
.
./index.html
./deps.edn
./src
./src/app
./src/app/web.cljs

$ rm -rf out && clj --main cljs.main -d out -p 8090 -c app.web -r

borkdude16:12:02

I used the html page recommended by the quickstart

borkdude16:12:04

$ cat src/app/web.cljs
(ns app.web)

(println "Hello world...")

$ cat deps.edn
{:deps {org.clojure/clojurescript {:mvn/version "1.10.439"}}}

dnolen16:12:46

@borkdude maybe this is a problem with -c?

dnolen16:12:24

that is the goog.define but it gets overriden

borkdude16:12:06

just to sanity check, what should the script tag look like if use -d out, /out/main.js or /main.js?

borkdude16:12:44

I have set it to <script src="/out/main.js" type="text/javascript"></script>. When I compile without -r and visit the index.html page via $ python -m SimpleHTTPServer 8090 it works, I see Hello world in the console

dnolen16:12:05

shouldn't matter, but the goog.define overrides should be in main.js

borkdude17:12:47

I would file an issue if someone could confirm this is not only my environment

dustingetz18:12:33

Has anyone tried to integrate a reactjs datagrid with ClojureScript data structures?

ichernetsky18:12:19

Hi all. When setting :optimizations to :advanced, it seems that dependency JS files do not get optimized using Closure compiler, they just get copied instead. Is it possible to enable all Closure compiler advanced optimizations for dependencies too?

mfikes18:12:14

@igrishaev If you use :npm-deps, then those go through GCC

mfikes18:12:41

But, regular JS :foreign-libs don’t

ichernetsky18:12:53

@mfikes Got it. Do you know what the reason behind this distinction in this regard is?

mfikes18:12:12

Unfortunately, I don’t know the history

mfikes18:12:52

It is likely that :npm-deps goes through GCC because GCC is inherently used to process NPM deps

ichernetsky18:12:38

@mfikes thanks a lot for the quick responses. I appreciate it.

dnolen22:12:31

@ichernetsky :foreign-libs is an old feature intended to allow people to use libraries which just aren't going to make it through advanced compilation (already minified, not going to work, etc.)

dnolen22:12:40

it's still the most reliable option

dnolen22:12:10

:npm-deps is an experimental thing for processing libraries through Closure - in many cases it can work, but in many cases it can't

dnolen22:12:26

it requires a bit of trouble shooting, and should be considered only if you are a pretty advanced user willing to wade through some confusing issues on your own