Fork me on GitHub
#clojurescript
<
2019-06-12
>
miikka06:06:40

Setting cljs.pprint/*print-base* is not supposed to work, right?

miikka10:06:23

I couldn't find anything on this on the ClojureScript JIRA, so opened a ticket. https://clojure.atlassian.net/browse/CLJS-3101

Risetto10:06:07

I'm looking for resources on how to structure a larger ClojureScript application

Risetto10:06:44

Maybe structure is the wrong word. I'm working on an application that has scaled a bit out of control, mostly because we don't have any clear pattern within the project. Is it common to use a MVC model or would you advice me to look into something else? @roman01la

Roman Liutikov10:06:04

@olle142 I’d suggest to use re-frame and follow its patterns. It works pretty good for large scale apps.

Risetto10:06:36

I will look deeper into it, thanks

idiomancy14:06:44

hey sorry, I know this question gets asked all the time and I, personally, have definitely asked before... but..

idiomancy14:06:15

does anyone know offhand how to intern/ re-export vars from different namespaces in cljs?

idiomancy14:06:30

I want everything to be useable from components.<component name> where as now they are split into various components.<component module>.<component name> locations

Roman Liutikov14:06:19

Put them into a single namespace. There’s little benefit to have ns per component.

💯 4
✔️ 4
gfredericks16:06:08

what's a good thing for running cljs tests? last I heard people were using lein-doo

gfredericks16:06:13

but that was like two years ago

dnolen16:06:47

there some test runners out there

dnolen16:06:27

but also it's possible you could probably make lein-doo work with clj just fine

Alex Miller (Clojure team)16:06:34

also see the comments for more options

lilactown17:06:35

shadow-cljs has a :browser-test target (for running in the browser with a GUI) and a :karma target for running browser tests in CI

lilactown17:06:46

if you’re using shadow-cljs

Alan Thompson17:06:31

@gfredericks The doo test framework relies on phantomjs, which is no longer supported. I've just switched everything over to using figwheel-main for tests with chrome --headless. Works very well.

dpsutton17:06:33

i really liked using https://github.com/bhauman/cljs-test-display in a tab adjacent to the app. The favicon and expandable results made constant rerunning of tests fantastic while devleoping

👍 8
lilactown17:06:55

☝️ that’s what shadow-cljs uses by default 😄

dpsutton17:06:06

ah nice. and extra mains is where its at. I really liked that at my last job having three tabs open: app | devcards | tests. Make any tests pass that I wanted. Make the devcard work, then wire up the real data fetches rather than injected the fake data and you're done. It felt really good

valtteri17:06:59

That sounds like a really nice setup @dpsutton! Do you happen to have any opensource examples?

dpsutton17:06:59

that one was proprietary (also they are hiring, info in #jobs) but it was the inspiration for figwheel-main's extra mains features. so you have three entrypoints. So the open source example is to just take advantage of that feature of figwheel main

valtteri17:06:07

Ahh cool, I’ll need to dive deeper into figwheel main. Currently working still with the good old’ lein figwheel.

dpsutton17:06:19

yeah we hooked it in there but @bhauman made it first class and quite convenient in figwheel main

dpsutton17:06:30

we were emitting our own main files anyways so it was easier for us than most

Chris Swanson19:06:51

seems like shadow-cljs is binding to the 172. address from docker instead of the desired wifi interface - does anyone know if that's configurable? it worked when i took all the interfaces down except local and wifi

Chris Swanson19:06:24

or maybe not binding , but building code that tries to connect to that address

Chris Swanson19:06:29

with the docker if's up, my expo app crashes with

"failed to connect to /172.18.0.1 (port 9630)

thheller19:06:33

@chrisjswanson its a bit ugly but currently you can configure if via the :local-ip "123.123.123.123" in your build config

Chris Swanson19:06:07

right on let me give that a try, it would be great if that's all it takes

Chris Swanson19:06:24

@thheller in shadow-cljs.edn ?

Chris Swanson19:06:38

i added the line, but as soon as i rebuild the error still comes back

thheller19:06:48

in your build config

thheller19:06:09

:builds {:foo {:local-ip ...}}

Chris Swanson19:06:50

yes you're 100% correct this solves the problem. thank you so much :thumbsup:

thheller20:06:33

you can also set it via the command line if needed shadow-cljs watch foo --config-merge '{:local-ip ...}'

✔️ 4
🙂 4
pcj22:06:29

If you're using a cljsjs library in project1, and want to use use project1 in project2, do you have to add the cljsjs library to the dependencies in project2 even if project1 has it in its dependencies?

lilactown22:06:13

cljsjs libs work just like other maven libs and are transitive

👍 4