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

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

potetm00:03:11

@mfikes wrt 2168 - my understanding is that David’s taken care of it

potetm00:03:20

happy to rebase the patch

potetm00:03:23

if that’s not the case

mfikes00:03:42

Cool. Just mechanically checking whether patches apply from a git perspective.

potetm00:03:49

:thumbsup:

mfikes00:03:56

(I have no insight into the meat of that patch.)

john04:03:25

Getting pretty close to replacing http-kit with Java_WebSocket in weasel. Can't get it to take input yet but the browser is connecting back to the server.

john04:03:37

might have something to play with tomorrow

mfikes14:03:23

I wrote up a short explanation regarding the new cljs.core/eval that might answer the inevitable question "Does ClojureScript support eval now?" https://gist.github.com/mfikes/66a120e18b75b6f4a3ecd0db8a976d84

john16:03:59

When I run the clj command listed in the gist, the browser launches and connects back but the repl hangs and it never drops to the prompt

mfikes14:03:25

I suspect people are going to rush to think the presence of cljs.core/eval means what they want it to mean, rather than what it really means.

dnolen14:03:14

well the exception will disabuse them :slightly_smiling_face:

mfikes14:03:07

Yeah, I wonder if people will think that simply requiring cljs.js will make it work. If you try it, you will quickly find out "no" because it also ends up throwing (in a different way) if you are in JVM ClojureScript.

dnolen15:03:57

I’m not too concerned about it, the docstring should probably be clarified it’s for bootstrap if it isn’t already

juhoteperi21:03:15

Wohoo, testing new main and REPL stuff for training, and this really cool. I can use this to demonstrate e.g. node modules:

❯ cljs -d out --repl
ClojureScript 1.10.145
cljs.user=> (require '[left-pad :as left-pad])
cljs.user=> (left-pad "foo" 5)
"  foo"

juhoteperi21:03:08

(`cljs` is two line script which calls clj, I didn't check if something like that already exists)

juhoteperi21:03:58

btw. Node modules don't work on repl without output-dir:

❯ cljs              
ClojureScript 1.10.145
cljs.user=> (require '[left-pad :as left-pad])
cljs.user=> (left-pad "foo" 5)
ReferenceError: module$home$juho$tmp$sdfsdf$node_modules$left_pad$index is not defined
Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: -6

juhoteperi21:03:18

Full stacktrace:

ReferenceError: module$home$juho$tmp$sdfsdf$node_modules$left_pad$index is not defined
Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: -6
	at java.lang.String.substring(String.java:1931)
	at clojure.core$subs.invokeStatic(core.clj:4926)
	at clojure.core$subs.invoke(core.clj:4921)
	at cljs.repl$file_display.invokeStatic(repl.cljc:384)
	at cljs.repl$file_display.invoke(repl.cljc:380)
	at cljs.repl$print_mapped_stacktrace$fn__6277.invoke(repl.cljc:397)
	at cljs.repl$print_mapped_stacktrace.invokeStatic(repl.cljc:394)
	at cljs.repl$print_mapped_stacktrace.invoke(repl.cljc:387)
	at cljs.repl$display_error.invokeStatic(repl.cljc:471)
	at cljs.repl$display_error.invoke(repl.cljc:451)
	at cljs.repl$repl_caught.invokeStatic(repl.cljc:797)
	at cljs.repl$repl_caught.invoke(repl.cljc:788)
	at cljs.repl$repl_STAR_$fn__6479$fn__6488.invoke(repl.cljc:996)
	at cljs.repl$repl_STAR_$fn__6479.invoke(repl.cljc:993)
	at cljs.compiler$with_core_cljs.invokeStatic(compiler.cljc:1285)
	at cljs.compiler$with_core_cljs.invoke(compiler.cljc:1274)
	at cljs.repl$repl_STAR_.invokeStatic(repl.cljc:953)
	at cljs.repl$repl_STAR_.invoke(repl.cljc:832)
	at cljs.cli$repl_opt.invokeStatic(cli.clj:258)
	at cljs.cli$repl_opt.invoke(cli.clj:247)
	at cljs.cli$main.invokeStatic(cli.clj:577)
	at cljs.cli$main.doInvoke(cli.clj:564)
	at clojure.lang.RestFn.invoke(RestFn.java:410)
	at clojure.lang.AFn.applyToHelper(AFn.java:154)
	at clojure.lang.RestFn.applyTo(RestFn.java:132)
	at clojure.core$apply.invokeStatic(core.clj:659)
	at clojure.core$apply.invoke(core.clj:652)
	at cljs.main$_main.invokeStatic(main.clj:61)
	at cljs.main$_main.doInvoke(main.clj:52)
	at clojure.lang.RestFn.invoke(RestFn.java:397)
	at clojure.lang.AFn.applyToHelper(AFn.java:152)
	at clojure.lang.RestFn.applyTo(RestFn.java:132)
	at clojure.lang.Var.applyTo(Var.java:702)
	at clojure.core$apply.invokeStatic(core.clj:657)
	at clojure.main$main_opt.invokeStatic(main.clj:317)
	at clojure.main$main_opt.invoke(main.clj:313)
	at clojure.main$main.invokeStatic(main.clj:424)
	at clojure.main$main.doInvoke(main.clj:387)
	at clojure.lang.RestFn.applyTo(RestFn.java:137)
	at clojure.lang.Var.applyTo(Var.java:702)
	at clojure.main.main(main.java:37)

richiardiandrea22:03:59

@juhoteperi there are a couple of issues open for :npm-deps not working in the new repl, I have been meaning to look at those but did not have much time

juhoteperi22:03:31

I glanced through "node repl" issues and didn't find anything that looked like this so I created new issue: https://dev.clojure.org/jira/browse/CLJS-2666 Could be something simple on how main works when output-dir is not set, but the stacktrace doesn't tell me anything.

kommen22:03:11

made a quick demo showing that web workers now work with :target :webworker https://github.com/kommen/clojurescript-webworker-demo and a PR to add it to the compiler options reference https://github.com/clojure/clojurescript-site/pull/193

mfikes23:03:59

^ :target :webworker added to the comprehensive doc list: https://gist.github.com/mfikes/bdbe214f03abac88ae384adb1ac26490