10 points · by thinkloop · 10y ago · 12 comments
I appreciate a look into this world, but routing on the web isn't supposed to be very complex. One of the big simplicity wins of the web network architecture was that it was stateless almost everywhere, with hypertext as the engine of application state[1].
Anybody can write some HTML with some anchor tags and tie it to some routes declared in a server-side routing file. The back button will work. History will work. Refresh will work. Copy-and-pasting the URL into an email will work. It's so easy that even I can do it.
The solution I use[1], and disclaimer also wrote, was targeted directly at server rendered SPA's to follow closely with these ideals. Layers over native anchor tags, just barebones handles the link clicking and uses Express routing which is obviously back end compatible.
* ctrl-clicking to open a new tab
* shift-clicking to open a new window
* alt-clicking
* non-left-clicking
* target attribute in <a>
* mailto: in href
I do like that there is no special integration. A href links just work.
[1] https://www.quora.com/How-do-page-load-times-affect-e-commer...
There were and are other options that don't toss the advantages of the the web architecture and return us to the client-server programing paradigm of the 80s & 90s.
E.g., the URL to the demo's about page: http://www.thinkloop.com/article/state-driven-routing-react-...