Fork me on GitHub

hey guys Anyone ever run into this problem. I am trying to create a new project with chestnut and lein and I keep getting this error: could not find artifact com.github.plexus:clj-jgit:jar:v0.8.9-preview in central ( Could not find artifact com.github.plexus:clj-jgit:jar:v0.8.9-preview in clojars ( I am not having network connectivity issues/.


I have a general question about server-side rendered SPAs and URLs. I'm using Rum to render my application on the server, and I only have one route "/", and one "page", the root. Requesting the "/" route will render the root component on the server, and on the front the root will be mounted, and everything works nicely. Now, if I want to add URLs, how should I go about doing it? Since this is a SPA, resolving the URLs will need to be inside the components themselves (I think), meaning that the root component will always be mounted, but its children (and the children of those children) will depend on the requested URL. Is it silly to just give the current URL (or the relevant part of it) to the components that care about navigation? Is there a better way?


hello I would like to know why in some code there're bindings through :as if it's not used by the body of the function like:

(defn send-to-api [{:keys [api] :as remotes} cb]
  (send-query api (fn [{:keys [body status]}]
                    (when (= status 200)
                      (cb body)))))


You're asking about the remotes?


My guess is just so that the developer sees what the parameter is 🙂




@kauko that makes sense


the code would work the same without the :as remotes part


about the rendering you need a lib to resolve the routing on the server before rendering


if you want server side rendering


if you dont just use secretary or any other lib and link the route to a var in the front end db


for some reason the variables remain unresolved, every thing except for the alert which works fine (for output testing purposes).


@severed-infinity: I’m not sure if it helps, but I do something like (set! (.-onload js/window) main) at the end of my main file.


And maybe try :optimizations :none? Oy. Kinda tough. I have “what I do” worked out, and just copy/paste from project to project. Not a good way to have broad knowledge of how these things load.


figured it out, needed to create an externs file and declare vars in it. though this seems make make the meta tag “^:export” useless.


Ah, so it was the :optimizations thing.


no, tried different optimization levels all with the same result. I’ve no idea the source of it the issue, if it is one at all; maybe I am missing something but cannot find any results online


is there a list anywhere of clojure things that don't work in clojurescript?


the repo has a document with the differences

Oliver George20:07:37

@severed-infinity: I think you need to use two script tags. One to load the JS. One to call the login() fn. Check the clojurescript QuickStart for a working example.


@severed-infinity: you can't have js source inside a script tag that has a src


move it into the empty script tag you have there


Adding [cljs.pprint :as pp] to my refer block, without actually using any of its functions, added over 100k to my app with advanced compilation. Is there something in that library defeating dead-code elimination, or should I look into some other setting?


(oops I meant the :require form in my ns)


@nathansmutz: No real priority has been given to reducing the code size associated with cljs.pprint, the expectation being that it isn’t frequently shipped in production apps. Oftentimes you want this in a REPL during dev and ClojureScript supports :repl-requires. I’ve written a non-normative post about that option:


I had thought that it would be cut out entirely if nothing was referenced. I'd thought to use cl-format; but maybe I should take it a different direction.


Yeah, there are a few constructs that thwart DCE. Perhaps cljs.pprint has one or two in it.


I wondered if that was the case.


By simply requiring a namespace, any side effects that are in that namespace have to run, even if you don’t refer to any vars in that namespace. (One example might be that the namespace installs a defmethod.)