Fork me on GitHub

I'm just trying to have an explore of fulcro-rad-demo, I've cloned the repo. I'm on the develop branch at HEAD. Struck what looked like, fixed that by updating the project deps.edn (vs ~/deps.edn). I've run

$ clj -A:dev:sql
user=> (clojure.core/require 'development)
user=> (development/go)
$ yarn
$ shadow-cljs watch main
I had a couple of warnings about incompatible versions for clojure, cljs and closure, so set them to what the error suggested
org.clojure/clojurescript              {:mvn/version "1.10.773"}
           org.clojure/clojure                    {:mvn/version "1.10.1"}
  {:mvn/version "v20200830"}}
After that when I run shadow-cljs i get the shadow-cljs ui at 9630, and visit localhost:8081, I get "Not found. Missing index.html.". If I explicitly run the compile for test (browser-test) in the shadow-cljs ui then it produces an index.html at resources/public/js/test/index.html and then a GET of localhost:8081 returns that index.html. Am I missing something that gives the demo index.html? Is it perhaps because I'm not heeding the warning bout Running from source? Despite message on (development/restart) about starting a listener on localhost:3000 , I don't have anything there.

👍 1

Ah, to somewhat answer my own question. Looks like some WSL2 fun. Using chrome from windows at localhost:3000 gives me nothing. But in wsl2 terminal curl localhost:3000 gave

➜  curl localhost:3000

<html><html lang="en"><head lang="en"><title>Application</title><meta charset="utf-8"><meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport"><link href="" rel="stylesheet"><link href="data:image/x-icon;," rel="shortcut icon" type="image/x-icon"><script>var fulcro_network_csrf_token = '';</script></head><body><div id="app"></div><script src="/js/main/main.js"></script></body></html></html>%
A firefox running in the wsl2 instance can get it too. So looks like a not listening to the request from the windows host for the dev server.


Yup, changing defaults.edn:2 from

:ip   "localhost"}
:ip   ""}
and I can get to it! Thanks in advance for listening to my confusion! 🙂 I look forward to exploring 🙂

Jakub Holý (HolyJak)13:08:58

Weird, why would localhost:3000 not work for you before the change?


the wsl2 (windows subsystem for linux) instance in windows 10 is an almost-but-not-quite-vm run on hypervisor. there's some interesting shenanigans I forget the details of where it uses bridged networking to let the host windows see it, but not always. so the requests from the windows host aren't coming from localhost, from the perspective of the ws2l instance, but a separate adapter. It's curious that the shadow-cljs ui is happily exposed, by default.


which re-raises the question, why do i subject myself to this mixed windows/linux world, instead of just linux. For which I have no good answer, any more. 🙂 It's not too bad, until it is 😄

👍 1
Jakub Holý (HolyJak)15:08:05

Ah, I see. I faintly remember someone running into this as well. Would you consider submitting a PR with tips for WSL users?


Absolutely, just on the readme.adoc, or a link to wsl tips?


yeah, on the readme would be fine, with perhaps links?


What's your PR process, you want it to a branch, or from a cloned repo? Would you like those deps.edn changes I needed to make it work in a separate PR? Looks like actually just removing the map entry for :ip is enough. And matches what's going on in the shadow-cljs.edn for nrepl and shadow-cljs ui.

Jakub Holý (HolyJak)11:08:14

I believe GitHub only allows you to fork the repo then push the code to that fork (which branch does not matter) then open a PR for that.

👍 3
Jakub Holý (HolyJak)11:08:05

I would think that defaulting :ip to localhost is more secure and thus preferable so personally I would like to see just a section in the Readme. YMMV.


It's a demo, so something that works universally without ppl having to mess with it is better IMO

👍 6

(so if dropping :ip fixes it everywhere, I'd say do that)

👍 3

PRs raised

👍 3