5 ms·
> I wonder if my AngularJS/D3.js/jqGrid/etc. single-page app will even load in a browser 20 years from now, let alone perform as originally intended... Random
by mistermann 11y ago
> I wonder if my AngularJS/D3.js/jqGrid/etc. single-page app will even load in a browser 20 years from now, let alone perform as originally intended...
Random question for you: In your single-page app, do you support bookmarking "locations" that take multiple clicks to get to, so rather than redo those clicks at a later date, the user can get there via the bookmark? (Assuming your site has locations that require multiple clicks to get to of course.)
- delluminatus 11y agoNot the parent, but Angular apps often involve rendering different views based on the URL fragment. This is intended to give you "bookmarkability". So for example instead of bookmarking something like this: http://example.com/users/1234 http://example.com/users/1234 it would be something like this: http://example.com/#!/users/1234 http://example.com/#!/users/1234 Personally, I have found that for SPAs with centralized state, you can serialize the entire application state into the URL fragment. This means that no matter where the user is in the application, they can bookmark that URL and it would return them to exactly the same place that they were (authentication aside). The disadvantage is that the fragment doesn't necessarily "make sense" to the user, and the URL is too long to be conveniently remembered or retyped manually.
- SEMW 11y agoIIRC, in recent versions of the angular router, the second, #!-type urls are a fallback for legacy browsers (more precisely, ones that don't support the HTML5 history API). On modern browsers the url will look like your first one.
- temo4ka 11y agoYou are of course right. Users of software don’t care for the terms developers use to label their creations, “web app” or “web page” — it’s all the same to them. More importantly, they expect an identical behaviour from both. So when a web app can’t recreate its state from URL it’s breaking a fundamental web UI convention. Another core UI convention that is often disregarded by web app developers is link click behaviour, i.e. you expect anything that performs a function of a link to behave as it normally would when you click on it with mouse’s middle button, or right click → context menu, or left click with modifier keys (cmd/ctrl, shift). Everyone got used to this and when the pattern is broken it is most annoying.
- mistermann 11y agoI work with a developer who thinks extremely highly of himself, and he seems to have never heard of this approach for SPA's.
- temo4ka 11y agoDoesn’t necessarily mean he’s a bad developer; there are many frontend devs who see their job as pure programming. Which it is not. For frontend developer, an important part of the job is to know what a good design is and what concepts underlie it. Yet it’s hard to gain such knowledge without either designing or working closely with designers.
- platz 11y agoIn the App-centric view, you don't bookmark anything. There are no bookmarks in desktop apps, for example. It's just weird that this 'app view' made it onto the web.
- csirac2 11y agoURLs are a big deal, and I absolutely loathe systems which actively sabotage likability on the web. That said, it really was an offline app. We could've done it as a native Qt or .NET app. Even so, the standard AngularJS document fragment paths supported bookmarking and so on.