News for hackers. Stuff that matters.
Re:Chrome will Soon Let You Share Links to a Specific Word o... by sascha_sl on Friday February 15, 2019 @03:55AM (#19169467)
Hmm, who provided the first popular JS framework that used fragments for navigation again?

I think it was called "Angular".

Re:Chrome will Soon Let You Share Links to a Specific Word o... by chrismorgan on Friday February 15, 2019 @04:55AM (#19169690)
Gmail was probably the first very-widely-used app that used the fragment for navigation, and Google drove the whole #! thing.

That technique is now considered obsolete, with the History API (history.pushState and all that lot) having supplanted it. IE9 is the most popular browser currently in use that doesn’t support it; there are still definitely some systems out there that will use the History API if it’s available, or fall back to using the hash if it’s not, but I find that using the hash for navigation in deployed apps is surprisingly dead, given that it’s shy of six and a half years since IE10 came out, and Firefox and Chrome only had a year and two’s lead (and Chrome’s implementation especially was unreliable for quite some time).

Using the hash for navigation is still very common in development workflows. But that can be ignored for a feature like this.

Re:Chrome will Soon Let You Share Links to a Specific Word o... by blattimwind on Friday February 15, 2019 @09:51AM (#19171313)
pushState is bad for many use cases because it completely breaks linking.
Re:Chrome will Soon Let You Share Links to a Specific Word o... by roywiggins on Friday February 15, 2019 @11:10AM (#19172008)
It doesn't have to, if you also provide routes on the backend so that pushState URLs actually resolve to a real URL that serves the same content. Or just provide a wildcard route and use JS to detect the URL like you would with hash-based navigation.

It does require more coordination between the front and back-end though.

Re:Chrome will Soon Let You Share Links to a Specific Word o... by blattimwind on Friday February 15, 2019 @01:21PM (#19173322)
I meant using pushState using the state object for something other than caching. If I click on "About us" and this results in pushState({page:"about-us"}, "", "#") then linking just doesn't work any more. It's a regression back to the days of Flash.
Re:Chrome will Soon Let You Share Links to a Specific Word o... by roywiggins on Friday February 15, 2019 @02:04PM (#19173705)
Ah, gotcha. Yes, that's a truly awful way to use it.
Re:Chrome will Soon Let You Share Links to a Specific Word o... by Bjartr on Friday February 15, 2019 @09:20AM (#19171079)
You can go back even further. GWT (formerly Google Web Toolkit) uses the fragment to store navigation tokens. I actively maintain a GWT SPA in my day job.