This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-11-03
Channels
- # announcements (1)
- # babashka (2)
- # beginners (17)
- # calva (11)
- # cider (4)
- # clara (3)
- # clj-kondo (19)
- # cljs-dev (60)
- # clojure (27)
- # clojure-europe (1)
- # clojure-nl (2)
- # clojure-spec (1)
- # clojure-uk (11)
- # clojurescript (128)
- # core-logic (7)
- # cursive (7)
- # data-science (3)
- # datomic (76)
- # defnpodcast (4)
- # fulcro (5)
- # malli (5)
- # off-topic (7)
- # re-frame (1)
- # reitit (3)
- # shadow-cljs (86)
- # spacemacs (5)
- # test-check (48)
- # tools-deps (9)
- # vim (12)
- # xtdb (6)
Is there anyway to set a port in shadow-cljs.edn using an environment variable?
I'm using #shadow/env "NREPL_PORT"
however it's failing because it's gettting a string and expecting a number
I'm trying to set the nrepl, http-server and devtools ports with env vars
@caleb.macdonaldblack that isn't supported no. why are you trying to do that? the default is to use random ports and you looking at .shadow-cljs/nrepl.port
to get the actual port
I'm trying to run two docker-compose stacks. One for testing and one for develop where they have different DBs.
I ended up running two instances of the web app as two shadow builds
So I have a local test db and a local dev db. My test db can be polluted with various test data. I want my local development db not to be effected by the tests. So I need my backend running in two environment, one for dev and one for test. My front-end is compiled with the backend url baked in. So I just run two instances of my front-end with different backend urls.
I'm running everything in docker so it's executed similar to how it is in CI
A shadow build communicates with a test backend which communicates with a tests db
and I want to run the test and develop build simultaneously
My tests are UI tests so they navigate to web app and point & click
I specify the backend url (test or dev) as a environment variable. Which is picked up in shadow-cljs as a closure-define
or <script>var MY_CONFIG = {url: "some-url"};</script>
and :init-fn
and it accessing js/MY_CONFIG
that way you have ONE build that doesn't need to be recompiled when changing backends
Okay so I was aware of everything up until the index-test.html/index-dev.html. I hadn't considered that. I always thought I would have to server side render the vars in and my front-end is not served up from my back-end. This is a good solution.
I'm not sure what I'm doing wrong here. It seems that :push-state/index
is ignored completely
Or maybe I'm using it wrong idk.
It's trying to server index.html
Actually no it was an issue with something else. I thought it wasn't looking for the file because the error said "Not found. Missing index.html."
But I can see that is just hard coded in
I didn't map the file correctly in docker-compose.
i have this case where Shadow can infer type on target:browser
but not on target:node-library
i'm curious to understand why :thinking_face:
(browser code)
node code
giving inference warning
oh i see - but could we gather externs also for node?
(maybe using {:infer-externs :auto}
as default would be good enough to warn the developper)
because node libraries are too big?
no because the externs gathering is flawed. I only added it to make externs less of hassle
ok got it :thumbsup:
datomic doesn't support CLJS? so if you mean to use it in a CLJS build then it won't work no
is there a different build I can use to get it working with shadow? or I have to integrate another build tool
it will not run in CLJS. no matter what you use to build it. it doesn't support node or any other JS
you can build a CLJ server that talks to datomic and talk to that from CLJS but thats about it
@alidcastano check out something like Pathom (and it’s datomic plugin) if you’d like a datomic’ish API for your client
hey @thheller, running into an issue with the auth0-spa-js lib, they have a weird layout which i suspect is the problem but, not sure how to get around it
sorry stepped away, I thought there was normally an index.js or something that you’re looking for
But (require '["@auth0/auth0-spa-js" :default createAuth0Client])
results in createAuth0Client
being nil
read the section about :default
here https://shadow-cljs.github.io/docs/UsersGuide.html#_about_default_exports
hi, just wondering where is shadow-cljs sever version coming from, I’m on a mac, running shadow-cljs directly from project dir with packages.json, latest shadow-cljs is installed in node_modules and other in global yarn, but running shadow-cljs server
still gives me shadow-cljs - server version: 2.8.67 running at
instead of expected 2.8.69
I don’t think so, looking at /usr/local/bin/shadow-cljs
it tries to require code from node_modules first