reitit

https://cljdoc.org/d/metosin/reitit/ https://github.com/metosin/reitit/
athomasoriginal 2020-05-04T01:27:12.300700Z

It’s my understanding that reitit in Html5History is adding a click EventListener to the document . I believe this was done so reitit is agnostic of front end apps e.g. React, Vue etc. I was curious if anyone has replaced the push behaviour stuffs inside the init with a custom link component to prevent the need to add a global event listener on the document? Any benefits? Example:

(defn link []
  [:a {:on-click 
       (fn []
         ; prevent default
         ; check URL
         ; push state ...)}
     ...other stuffs])
So the above is doing something more akin to what ReactRouter does in their Link component.

2020-05-04T15:09:58.301600Z

I am trying to replace the clicking of anchor tag with on-click of a span

2020-05-04T15:10:17.302100Z

[:a {:href (rfee/href :page {:id bid})} title]
to
[:span {:on-click (fn [e]
       (rfee/href :page {:id bid}))}
        title]

2020-05-04T15:10:46.302700Z

The reason I am trying to do this is because I want to handle nested links in the text for which I wanted to make changes

2020-05-04T15:11:17.303300Z

The anchor tag works but the on-click is not working

2020-05-04T15:12:01.303800Z

I am checking the event handlers which are registered in the browser on the span and I don't see any handler being registered

2020-05-04T15:13:47.304900Z

I was looking at https://purelyfunctional.tv/guide/re-frame-building-blocks/#introduction so the syntax seems correct

mkvlr 2020-05-04T17:07:38.307300Z

any plans to release a new version of reitit soon? Or any tips for an easy way to depend on a version from git with tools.deps? The latter isn’t so easy because of the lacking support for monorepos and java compilation in tools.deps afaik.

ikitommi 2020-05-04T18:30:49.310300Z

@mkvlr plan was to do small releases often. but there has been looming a breaking change with interceptors. It shipped today, so will push out release from all th relevant libs.

❤️ 4
ikitommi 2020-05-04T18:30:59.310600Z

would be great to have deps for monorepos.

mkvlr 2020-05-04T18:52:20.311200Z

+1 on deps for monorepos

mkvlr 2020-05-04T18:55:29.311800Z

when depending on something without java sources https://github.com/nextjournal/reitit/commit/ad3773eac633f24cf68301b0e615630a808a2252 can be a workaround

okwori 2020-05-04T19:49:04.315300Z

Anyone using reitit with #luminus? How to I make a page say "/admin" to render a template say "admin.html", not "/#/admin(or about)" since I have two different templates and designs for home.html and admin.html each of which is using their own individual hiccup fns within core.cljs and should render those functions respectively within their templates