Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> and so do SPA devs

??? - those usually use the URL bar in my experience.



In most SPAs, however, URLs aren't used like conventional URLs; they're treated as routes. I think that's more the point here.

They aren't conventionally "shareable", first off, which violates more or less the spirit of what a URL is supposed to represent on the Web.


This is pretty much untrue. Gmail is an SPA for example, and I can share "https://mail.google.com/mail/u/0/#spam" with you, or "https://mail.google.com/mail/u/0/#inbox/FMfcgxwGDWqXKSSfXBDQ... (of course you can't access the latter because you don't have the appropriate permissions for it … but point still stands: I can open that URL in a new tab and it'll open the same email).

I've written plenty of SPAs myself that use the URL and you couldn't actually tell it's an SPA unless you have the technical experience to know what to look for.

If what you're saying is "this infinite-scrolling page sucks at respecting URLs", that's something else, and it's not specific to SPAs. Infinite scrolling predates SPAs (Here is one for jQuery! https://infinite-scroll.com/#initialize-with-jquery), and doesn't have to break URLs if you don't write your code like an uncivilized brute.


Breaking the back button and not using propers URLs are two cardinal sins in SPA development.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: