[ClojureScript] Re: SSL Websocket REPL connection closes spontaneously

2019-02-04 Thread Rob Nikander
Thanks. I couldn't get `websocket_*` settings to work (I guess I need to 
recompile nginx), but `proxy_*` settings, also mentioned on that page, 
appear to be working.

On Monday, February 4, 2019 at 3:00:56 AM UTC-6, Phill Wolf wrote:
>
> Don't know.  What about websocket_connect_timeout ##; etc? 
>
> https://stackoverflow.com/questions/10550558/nginx-tcp-websockets-timeout-keepalive-config
>
>

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at https://groups.google.com/group/clojurescript.


[ClojureScript] SSL Websocket REPL connection closes spontaneously

2019-02-03 Thread Rob Nikander
Hi,

Does anyone use a websocket REPL over SSL, or do you all develop over plain 
HTTP and then use HTTPS only in production where you don't have the 
clojurescript REPL?

In my development environment, my web page is served over HTTPS. So if I 
tried the following line, the browser blocks the "insecure content":

(weasel.repl/connect "ws://www.myserver.com:9001")

But if I set up nginx to do the SSL and proxy from 9011 → 9001, then I can 
run this in my CLJS code:

(weasel.repl/connect "wss://www.myserver.com:9011")

At first it works. I see this in the browser's JS console:

(i) Opened websocket REPL connection

And I can evaluate code in Emacs/CIDER REPL. But about a minute later...

(i) Closed websocket REPL connection

And the REPL in Emacs stops working. Maybe the problem is with the nginx 
config. 

listen   9011;
[... ssl config ...]
location / {
proxy_pass http://localhost:9001;
proxy_redirect   off;
proxy_http_version 1.1;
proxy_set_header   Upgrade $http_upgrade;
proxy_set_header   Connection "Upgrade"; 
proxy_set_header   Host $http_host;
proxy_buffering   off;

Anyone know how to do this?

Maybe this never works, and I have to use a non-SSL dev environment.  

thanks,
Rob




-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at https://groups.google.com/group/clojurescript.


[ClojureScript] Old "critical" bug in core.async?

2019-01-26 Thread Rob Nikander
I was trying (again) to learn and use core.async. I noticed this and it 
worried me:

https://dev.clojure.org/jira/browse/ASYNC-73

A bug marked "critical" that's unfixed for 4.5 years? Does it mean that 
certain things in core.async cannot be fixed?

Rob

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at https://groups.google.com/group/clojurescript.


Re: [ClojureScript] Re: problem with cljs, local dependencies, and src path

2019-01-04 Thread Rob Nikander


On Tuesday, January 1, 2019 at 1:00:07 PM UTC-6, Victor Gil wrote:
>
> Rob: Have you tried shadow-cljs? It has greatly simplified project setup 
> and compilation for me.
>

No I haven't. I may try it later, if I can get the basics working first. 

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at https://groups.google.com/group/clojurescript.


[ClojureScript] Re: problem with cljs, local dependencies, and src path

2018-12-30 Thread Rob Nikander


On Sunday, December 30, 2018 at 3:27:21 PM UTC-6, Phill Wolf wrote:
>
> By the way, is there a deps.edn in the hello2 directory?
>

Yes, there is. I was just working on this again I think I figured it out. 
Two things confused me. Maybe it's working as intended, but it seems these 
could be bugs.

1. If I update a deps.edn file in the dependency (hello2) to change the 
:paths there, the classpath is not updated in my project (hello1). I need 
to run `rm -rf .cpcache` in my project's directory so that it picks up the 
change. 

2. If I don't specify :paths in the dependency's (hello2) deps.edn file, 
then it will use the :paths is in the main project (hello1). That seems odd 
to me that the inheritance flows that way.  I imagined that by leaving 
deps.edn black in hello2, hello2 was specifying it's src path to be the 
default ("src").

Rob

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at https://groups.google.com/group/clojurescript.


[ClojureScript] problem with cljs, local dependencies, and src path

2018-12-29 Thread Rob Nikander
Hi,

I'm seeing some strange behavior trying to start a cljs project. I'm using 
a deps.edn file, and if set the path to something like `:paths 
["src/clj"]`, then the cljs compiler can't find local dependencies. For 
example, a project with this in deps.edn this will fail to compile:

   {:paths ["src/clj"]
 :deps {
  org.clojure/clojurescript {:mvn/version "1.10.439"}
  hello2 {:local/root "/Workspace/hello2"}  
 }}
 
But if I change the path to "src", and of course move the source code of 
course, it works.

The error in the first case is:

  $ clj --main cljs.main --compile hello1.core
  [...]
  Caused by: clojure.lang.ExceptionInfo: No such namespace: 
hello2-lib.core, could not locate hello2_lib/core.cljs, 
hello2_lib/core.cljc, or JavaScript source providing "hello2-lib.core" 
(Please check that namespaces with dashes use underscores in the 
ClojureScript file name) in file /Workspace/hello1/src/clj/hello1/core.cljs 
{:tag :cljs/analysis-error}

It can't find the namespace define in the hello2 library.

Rob

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at https://groups.google.com/group/clojurescript.


[ClojureScript] make cljsbuild/figwheel skip .clj files

2017-12-30 Thread Rob Nikander
I have a single source tree under src/main/clj that contains files ending 
in .clj, .cljs, and .cljc (clojure, clojurescript, and mixed). This was 
working fine, but something changed and now figwheel is popping up pink 
error panels with "Couldn't load Clojure file...", referring to .clj files 
that I'd like it to ignore. Is there a way to tell one of these tools to 
skip the .clj files?

Rob

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at https://groups.google.com/group/clojurescript.


Re: [ClojureScript] lein, clojurescript, and Java 9?

2017-12-05 Thread Rob Nikander


On Tuesday, December 5, 2017 at 7:03:32 PM UTC-5, Andy Fingerhut wrote:
>
> Try lein 2.8.1, if you are using any other version of Leiningen.  There 
> are known issues with Leiningen versions less than that, combined with Java 
> 9.
>

Looks like I'm running it already.

  $ lein version
  Leiningen 2.8.1 on Java 9.0.1 Java HotSpot(TM) 64-Bit Server VM 

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at https://groups.google.com/group/clojurescript.


[ClojureScript] lein, clojurescript, and Java 9?

2017-12-05 Thread Rob Nikander
Hi,

Is this supposed to work? It works with Java 8, but when I use Java 9 I get 
the error below.

Rob

$ java -version
java version "9.0.1"
...
$ lein cljsbuild auto
Watching for changes before compiling ClojureScript...
Compiling 17 source files to /Users/rob/[...]/target/default/classes
Exception in thread "main" java.lang.ClassNotFoundException: 
javax.xml.bind.DatatypeConverter, compiling:(cljs/util.cljc:1:1)
at clojure.lang.Compiler.load(Compiler.java:7526)
at clojure.lang.RT.loadResourceScript(RT.java:379)
at clojure.lang.RT.loadResourceScript(RT.java:370)
at clojure.lang.RT.load(RT.java:460)
at clojure.lang.RT.load(RT.java:426)
at clojure.core$load$fn__6548.invoke(core.clj:6046)

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at https://groups.google.com/group/clojurescript.


[ClojureScript] Stacktrace in REPL?

2017-10-12 Thread Rob Nikander
I have a REPL connected to the browser.  I wrote a function called `test1`, 
called it from the REPL, and got an error. Is there a way to see a stack 
trace?  Typing `*e` as I would in normal Clojure REPL did not work.

=> (test1)
#object[TypeError TypeError: null is not an object (evaluating 
'elt.innerHTML = html')]
   someapp$dom#html_BANG_ (file:/[...]/src/main/clj/someapp/dom.cljs:118:22)
nil

(If it matters, I'm using figwheel.)

thanks, 
Rob

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at https://groups.google.com/group/clojurescript.


Re: [ClojureScript] Re: REPL setup help

2017-08-03 Thread Rob Nikander
I got this working, but I'm seeing very strange behavior that makes it 
unusable. IntelliJ can hang and overuse CPU on certain expressions. It will 
happen, for example, if I type the following in the IntelliJ Cursive REPL 
connected to Figwheel/ClojureScript...

cljs.user=> (deftype Foo [a])   
cljs.user=> (def foo (-> Foo 123))  ; so far everything is normal
cljs.user=> (.-a foo)   ; oh it does not like this.

It's hard to finish tying that last line. It's as if it's trying to parse 
it before I'm done (maybe for auto completion?) and choking. Once I type 
"(.-a" the CPU starts to go and IntelliJ responds to keypresses only after 
huge delays.

Rob

On Monday, July 31, 2017 at 10:42:11 PM UTC-4, Colin Fleming wrote:
>
> Hi Rob,
>
> So using Maven, those instructions should work pretty much as-is, since 
> the clojure.main style REPL it uses just uses the classpath from IntelliJ, 
> it doesn't use lein for anything fancy. The only part which I don't know 
> about is compiling ClojureScript from Maven - I actually didn't even know 
> that was possible. But the rest of it should work as described in that doc, 
> you'll just have to translate things like :source-paths to the Maven 
> equivalent which should be straightforward.
>
> Cheers,
> Colin
>
> On 1 August 2017 at 11:23, Rob Nikander <rob.ni...@gmail.com 
> > wrote:
>
>> Okay, thanks, I will try figwheel. I'm using Maven not Leiningen so I'll 
>> need to find time later to translate those instructions. On my test project 
>> here I could use Leiningen, but on another, Maven is entrenched.
>>
>> On Monday, July 31, 2017 at 6:16:30 PM UTC-4, Colin Fleming wrote:
>>>
>>> In fact, Figwheel has a page dedicated to Cursive: 
>>> https://github.com/bhauman/lein-figwheel/wiki/Running-figwheel-in-a-Cursive-Clojure-REPL.
>>>  
>>> I agree that if you're doing browser development, you almost certainly want 
>>> to be using figwheel.
>>>
>>> On 1 August 2017 at 02:58, Ikuru Kanuma <kanu...@gmail.com> wrote:
>>>
>>>> Hi Rob,
>>>>
>>>> Perhaps following this README will help?
>>>> It should work as long as you have a working repl + can add this as a 
>>>> dependency.
>>>> Figwheel will give you hot code reloading + a cljs repl + lot of other 
>>>> goodies and is really popular.
>>>>
>>>> https://github.com/bhauman/lein-figwheel/tree/master/sidecar
>>>>
>>>> Ikuru
>>>>
>>>> -- 
>>>> Note that posts from new members are moderated - please be patient with 
>>>> your first post.
>>>> --- 
>>>> You received this message because you are subscribed to the Google 
>>>> Groups "ClojureScript" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send 
>>>> an email to clojurescrip...@googlegroups.com.
>>>> To post to this group, send email to clojur...@googlegroups.com.
>>>> Visit this group at https://groups.google.com/group/clojurescript.
>>>>
>>>
>>> -- 
>> Note that posts from new members are moderated - please be patient with 
>> your first post.
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "ClojureScript" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to clojurescrip...@googlegroups.com .
>> To post to this group, send email to clojur...@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/clojurescript.
>>
>
>

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at https://groups.google.com/group/clojurescript.


Re: [ClojureScript] Re: REPL setup help

2017-07-31 Thread Rob Nikander
Okay, thanks, I will try figwheel. I'm using Maven not Leiningen so I'll 
need to find time later to translate those instructions. On my test project 
here I could use Leiningen, but on another, Maven is entrenched.

On Monday, July 31, 2017 at 6:16:30 PM UTC-4, Colin Fleming wrote:
>
> In fact, Figwheel has a page dedicated to Cursive: 
> https://github.com/bhauman/lein-figwheel/wiki/Running-figwheel-in-a-Cursive-Clojure-REPL.
>  
> I agree that if you're doing browser development, you almost certainly want 
> to be using figwheel.
>
> On 1 August 2017 at 02:58, Ikuru Kanuma  
> wrote:
>
>> Hi Rob,
>>
>> Perhaps following this README will help?
>> It should work as long as you have a working repl + can add this as a 
>> dependency.
>> Figwheel will give you hot code reloading + a cljs repl + lot of other 
>> goodies and is really popular.
>>
>> https://github.com/bhauman/lein-figwheel/tree/master/sidecar
>>
>> Ikuru
>>
>> -- 
>> Note that posts from new members are moderated - please be patient with 
>> your first post.
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "ClojureScript" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to clojurescrip...@googlegroups.com .
>> To post to this group, send email to clojur...@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/clojurescript.
>>
>
>

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at https://groups.google.com/group/clojurescript.


[ClojureScript] REPL setup help

2017-07-30 Thread Rob Nikander
Hi,

I'm new to ClojureScript. I followed the quick start instructions [1] and 
set up a REPL. It works, but now I'd like to integrate a REPL with my web 
app and IDE. Any pointers?

I have a Java servlet container, also running Clojure code. I'm using 
IntelliJ with Cursive plugin, and have REPL windows in the IDE working for 
the JVM/server-side of things. I can reload Clojure code in the running 
server. 

Now, that servlet code responds with an HTML page which contains my 
ClojureScript code. That runs, but I don't know how to connect that browser 
environment to a REPL window in IntelliJ, or even a REPL in my terminal. 
 The quick start terminal REPL only connects to a magic server listening on 
localhost:9000. 

Anyway... any pointers? 

thanks,
Rob


[1]: https://clojurescript.org/guides/quick-start#browser-repl

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at https://groups.google.com/group/clojurescript.