Library recommendation for SPA in CLJS without breaking browser features

I am building a cljs frontend (ecommerce store) for an already existing python backend.
We all know that the ‘naive’ SPA breaks browserfeatures and I would like to know, which libraries I will have to use to prevent that.
Currently the only libraries that I am using are rum.core and ajax.core.
The Browserfeatures I want to maintain are:

  • Rightclick → open in a new tab for navigation elements
  • back-button of the browser
  • directly link to “pages” (shop/item-category/X, shop/profile, shop/item-detail/X, shop/cart)

I am thinking about using Bidi` for the backbutton and pushy for the routing. (or should I use reitit for routing?!)
I would like to get some comments on this, before I commit and wakeup dissillusioned after finding out, that I should have picked another library…

Thank you :slight_smile: <3

2 Likes

I have been using Bidi with great pleasure, but today I think reitit would be my choice. Both for routing.

I am not sure what you mean by backbutton, but I see an opportunity to market one of my libraries, which I then can’t resist doing. :smile: It is about the back and forward buttons and how a SPA can break the expectations the user might have on those when it comes to maintaining scrolling position. Check it out: GitHub - PEZ/clerk: In-page navigation (scrolling) for ClojureScript SPAs. (Not to be confused with that other Clerk Clojure thing.) There’s demo here: https://clerk-demo.netlify.app

2 Likes

Thank you @PEZ. I am just trying to figure out reitit. It seems to be able to do all I want without even using pushy.
BTW: does someone know how to teach reitit, that it should not use #-symbol for the app paths, but just append the paths via /?

I will check out you library when it comes to maintaining scroll position :wink: Thanks!