Fork me on GitHub
#clojurescript
<
2019-01-29
>
abdullahibra09:01:25

suppose i would like to make select input which have available countries and the user will choose from, is it better to make this list available via restful API call from the server, or should be read from static file via the client directly, or embed it as big hash in the client code and will be available from there, what is the best approach for this ?

borkdude09:01:56

there is no best approach, it depends on your app

abdullahibra09:01:39

it's just list of all countries to make the user choose from

borkdude09:01:52

storing it as a map on the client would make sense to me

stathissideris13:01:31

what do people do to run cljs tests on a CI server when the project needs a dom?

Roman Liutikov14:01:45

headless chrome

borkdude14:01:12

I’m using etaoin with headless chrome / chrome in a docker container

👍 5
aisamu14:01:46

Just for curiosity, what's your collection of "make-chrome-run-inside-docker" flags? We have a bunch, but I'm not sure if they're still needed with the latest chrome versions

borkdude14:01:23

if you know a better solution, let me know 🙂

👌 5
borkdude14:01:46

it has to support the webdriver protocol, so I can use it with etaoin

domparry14:01:28

Does anyone know why running lein deps doesn’t pull cljs deps?

domparry14:01:49

we always end up pulling them as part of a lein build

thheller14:01:13

@domparry do you have the deps defined as part of a profile? eg. lein with-profiles +cljs deps

domparry14:01:06

no… All just listed in :dependencies

domparry14:01:51

I’ll dig a bit more.

restenb15:01:08

correct me if i'm wrong, by setting :optimizations :none, the compiler should not rename any functions in the javascript?

oconn16:01:22

How are you loading Plotly into your application? The compiler will not rename local variables with optimizations set to :none. Also you could probably set your optimization level to :whitespace and still not have to worry about vars getting munged in your deployed build.

restenb15:01:02

i'm trying to use Plotly for charts, but it doesn't work in the deployed environment, getting errors like Plotly.xr is not a function

restenb15:01:23

which makes me believe the problem is that the compiler has been renaming stuff I don't want it to rename.

restenb15:01:47

perhaps there's a better way of dealing with these kinds of issues so I don't have to turn optimizations off?

exit215:01:54

is it possible to get environment variables loaded into a project.clj, then have access to them in cljs?

oconn16:01:04

I’d take a look at this https://www.martinklepsch.org/posts/parameterizing-clojurescript-builds.html. I’m sure leiningen supports this with a plugin. I use clojure.deps and figwheel-main and generate a [build-id].cljs.edn config file that loads my environment variables prior to building the app.

💯 5
exit215:01:56

I have some environment variables that are accessible via Node’s process.env, I have access to them on the server side of my application but not on the client

darwin19:01:19

hey, :install-deps does not seem to be true by default, just searched clojurescript repo and didn’t find any explicit default for it, can anyone confirm?

thheller19:01:18

:install-deps is not enabled by default

thheller19:01:21

pretty sure that :npm-deps defaults to false nowadays as well

darwin20:01:41

I’m not alone, even enabling :install-deps fails on me with compiler stack trace: https://github.com/funcool/cuerdas/issues/71#issuecomment-458679019

restenb20:01:05

@john Yes, I'm using cljsjs.plotly

restenb20:01:44

everything works locally on my dev build

john21:01:52

ah, that's pretty wild. Might be something edge-casey about your env. I've been planning to integrate plotly into our stack soon.

restenb21:01:08

with error messages like Uncaught TypeError: Plotly.Zj is not a function at Object.<anonymous> (app.js:984) at Object.componentDidMountall I could think was that compiler optimizations messed it up somehow

john21:01:40

Yeah, that looks like an externs issue

restenb21:01:48

i might try downloading the ext.js file and including it as an extern instead

john21:01:55

But cljsjs should come wrapped with all the externs

restenb21:01:05

nah it's not, I already looked

john21:01:42

... that's weird. You could edit the externs file and add the missing fns.

john21:01:05

Do you know which function name is getting munged at that error?

restenb21:01:38

i have no idea. it isn't always the same function either

restenb21:01:36

or i suppose it might get altered to different names as well, i'm not familiar with how that actually works

john21:01:56

If you want to make a minimal repro, I'll look at it