|
|
|
|
|
by tecleandor
889 days ago
|
|
The thing is... not everything needs the window url to be updated. Either because the URL is the same, or because you're pulling content that shouldn't/can't/won't be accessible with a direct URL. For example: - Blog: You add a comment to a blog post. The comment appears without reloading, and you don't need a new URL (because it's the same blog post)
- Menu navigation: You load menu items and/or children via htmx. That probably doesn't need a new URL.
- Ecommerce: You add/remove/modify products to/from your cart. The URL for the cart is still the same.
|
|
New blog comment can be part of the url target with the comment id. Makes it easy to share and puts the scroll bar at the right position.
Menu navigation can be quite complex with nested modals, you might want to be able to deeplink for documentation/training purposes and highlight a selection.
With a cart you might want to add a ‘cart state/session’ id so you can share it with your spouse to quickly get to an agreement about stuff to order.