Fork me on GitHub
#reitit
<
2020-05-04
>
athomasoriginal01:05:12

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.

anshbansal15:05:58

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

anshbansal15:05:17

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

anshbansal15:05:46

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

anshbansal15:05:17

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

anshbansal15:05:01

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

mkvlr17:05:38

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.

ikitommi18:05:49

@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.

❤️ 16
ikitommi18:05:59

would be great to have deps for monorepos.

mkvlr18:05:20

+1 on deps for monorepos

mkvlr18:05:29

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

okwori19:05:04

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