Fork me on GitHub
#clojurescript
<
2018-07-02
>
Drew Verlee01:07:57

Apologies for the lazy question 🙂. I have seen a hand full of ways to deploy apps and can think of some myself, but in your opinion, if your doing a clojurescript only (re-pose in my case) app then whats the easiest way to get on the web?

Drew Verlee01:07:37

im fiddling with heroku right now. i’m having to learn a couple bits about the ecosystem that i have been ignoring.

Drew Verlee01:07:11

No need to fill in all the details, i’m just curious what current wisdom is for a quick server-less app would be.

spiralganglion02:07:14

@drewverlee For serverless, I use Surge.sh and Netlify, and am quite happy with both.

Drew Verlee11:07:09

Thanks! I saw another recommendation for netify, I'll give it a go

Drew Verlee13:07:58

coolness surge is super easy for pure js and html stuff which is what i want to play with for a bit 🙂

spiralganglion02:07:29

I used to use Heroku for that, but it's way slower to work with than Surge (which seems great for quick/small things), and more costly than Netlify (which seems great for slightly more serious/medium-sized things)

Ayoung07:07:07

Hi have anyone ever use the reload on the route? I need help thank you!

xlfe09:07:52

I'm wondering if anyone can point out what I'm doing wrong with #om-next :- according to the docs for the parser's mutate function (https://github.com/omcljs/om/wiki/Documentation-(om.next)#parser), if the return map from my mutate function includes a :value {:keys [:todos/list]} then any components with :todos/list in their IQuery should be re-rendered. I cannot get it to work though. As soon as I add :todos/list to the end of my transact! transaction though, everything works. Am I misunderstanding what adding :value {:keys [:todo/list]} to my mutate function is meant to do? Is it not meant to be the same as adding it to the end of a transact! call?

dnolen12:07:38

@felixb there’s an #om channel

Roman Liutikov12:07:46

If there are both clj and cljs files for same ns, where clj contains a macro and cljs contains a function of the same name as the macro, which one will be chosen when compiling ClojureScript and requiring with [my.ns :as my]?

Roman Liutikov12:07:47

(it looks like I’m getting a macro, but wanted a function defined in cljs ns)

thheller12:07:12

@roman01la if the clj ns is loaded the macro is used. typically that should only be the case if the CLJS self-required but that doesn't work reliably in CLJS. see https://dev.clojure.org/jira/browse/CLJS-2454

Roman Liutikov12:07:24

So this shouldn’t happen normally, right? (I don’t have self-requires btw)

Roman Liutikov12:07:33

Not sure how to debug why clj is getting loaded. In works fine in REPL though (clj and cljs repls)

Roman Liutikov12:07:44

ok, I know why is it loaded 🙂 but now this means that to make it work with both macro and a function of the same name I have to move everything into cljc, but since there’s a lot of interop code it’ll make the code less readbale

thheller12:07:46

might be tools.namespace or something like that in case you are using that

Roman Liutikov12:07:57

no, just using other macros from clj

Roman Liutikov12:07:00

macros in cljs never gets easier 😄

thheller12:07:06

yeah as soon as its loaded it uses the macro. the self :require-macros was meant to protect against that but it doesn't work in CLJS.

thheller12:07:42

it works fine in shadow-cljs 😉

Roman Liutikov12:07:47

nice! how did you do this?

thheller13:07:20

shadow-cljs has a custom parser for the ns form so it doesn't use the default code for that part

thheller13:07:03

haha wait .. nevermind. I changed that recently because too many people were relying on the "broken" behaviour 😛

thheller13:07:29

as David said in the comments its probably too late to change this

Roman Liutikov13:07:32

ok, that’s understandable

mfikes13:07:10

@roman01la Generally you get the macro if it is in operator position, but the function if you need to take its value. You can force the issue if you need to. For example (#'+ 2 3) should use the function, not the macro.

mfikes13:07:10

Or, perhaps to avoid the bloat of employing var:

(let [plus +] (plus 2 3))

mfikes13:07:59

This is documented in the second note under https://clojurescript.org/about/differences#_macros

Roman Liutikov13:07:31

@U04VDQDDY Can’t do this bc this macro/fn is a part of public API. Voted for that issue, but don’t want to force it since I don’t know how it can potentially impact existing users

pesterhazy13:07:14

New project: cljs-corpus, a greppable local archive of ClojureScript source code: https://github.com/pesterhazy/cljs-corpus Feedback welcome!

Ellie14:07:44

I’m struggling to create test profiles to run clj and cljs tests. I’m using doo for cljs but I need to include test dependencies and I can’t seem to get them recognised. can anyone show me an example of a project.clj (sensitive bits removed) showing how I might configure it?

nenadalm17:07:51

Hi. If I understand correctly, you can include new dependencies in your profile like so: https://github.com/imatic/re-frame-form/blob/e4f2ca430dc83e3e9d78402c4dddee3a8ddb9480/examples/re-frame-form/project.clj#L19 and then use lein with-profile <profile> ... to run lein command with specified profile like so: https://github.com/imatic/re-frame-form/blob/e4f2ca430dc83e3e9d78402c4dddee3a8ddb9480/.travis.yml#L10 linked example uses prod profile that adds new dependency day8.re-frame/tracing-stubs.