-
-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Progressive Web Apps Checklist #77
Comments
We actually pass this one with flying colors. 1.8s (simulated) for FULL CONTENT load (all pages no images) And still not utilizing HTTP/2 server push nor See Comments: https://github.com/devpunks/snuggsi/blob/master/index.html#L6-L44 3G Network (Throttled)Normal (Throttling Disabled) |
NICE! |
yeah i do see snuggsi being sold as a tool for achieving these goals more easily for regular apps. the script load/parse time for the big frameworks are fairly substantial and well, the whole point is folks want to add their code on top of that, so it's valuable to give them as much headroom as possible. speaking of caching, preloading resources, etc. i want to see some attempt made (and maybe i'll work on it myself) to replicate [the snuggsi way] the kinds of "for free" enhancements that a tool like Turbolinks provides without having to really invest significant dev time/effort/learning. the point about navigation being instantly UI-responsive even if it means displaying a transition or loading animation while it actually happens, is one of those substantial UX things that a general-use component(s) could make easy to drop in without having to re-engineer anything else. intercept click/activate events on hrefs and decorate the behavior by using the modern APIS including history, page replacement (in multiple stages), and fetch. turbolinks does this but the delivery falls a little short of the marketing promise, and the time may have come for a better, faster, closer-to-the-specs way of doing those types of things. |
It's always the time for that sort of thing. (AKA progress!) |
@brandondees should check out Source codehttps://github.com/devpunks/snuggsi/blob/master/examples/nav-view Performance of
|
TL;DR; @brandondees speaking of which there is a funky section of the code in Whatever solution we come up with we may want to upstream into the core library. I feel this will come up again and again. Especially with custom elements that need to interact with the entire document body. (Not typical but expected as in your case @brandondees) Any thoughts would be appreciated because this effects EVERY custom element due to the fact any one of them can potentially "imported" from a remote source into the master document. initialize () {
/comp|inter|loaded/.test (document.readyState)
// Classic browsers: custom element is upgraded via polyfill
// AFTER load (which by this time has already occurred).
// explicitly trigger event handler
? this.onload (/* where is the event? this is smelly */)
// Evergreen browsers: custom element is "upgraded"
// from platform before DOMContentLoaded
// register `onload` handler to fire later in time
: document.addEventListener
('DOMContentLoaded', this.onload)
}
onload (event) {
/* do some stuff when the Document is ready (but not loaded. bad name?) */
this.render () // Force repaint.
} Taken from https://github.com/devpunks/snuggsi/blob/master/examples/nav-view/index.es#L5-L13 |
suppose we want a version that does content replacement rather than toggling visibility... can this same component support that or would it require a different one? my thinking is that for sites that have a lot of content per page, navigating between lots of them by visibility toggling could become problematic in terms of memory consumption (the bane of browser users on affordable systems everywhere), or even CPU consumption in cases where there might be for example some background animation burning up GPU/CPU outside of requestAnimationFrame(). this effectively just replicates the "css tabs via radio buttons" technique but more cleanly, if i understand it correctly. i'm not sure i'm even up for getting that deep with the browser document lifecycle events. maybe look for a possible workaround in the way that other tools like turbolinks handle the equivalent problem. |
also, to be clear, it's totally fine to potentially just not fully support the laggard browsers, especially if they're the less popular ones, as long as there's some kind of progressive enhancement / graceful degradation strategy in place for those. i think in the case of imports, we gotta have some kind of working polyfill for FF, but if it's a question of handling a no-js environment or some legacy browser with wonky document lifecycle events, maybe just design components to have some kind of fallback behavior for those situations. |
@brandondees perhaps the following for partial importing. @tmornini and i had a lengthy convo on the topic a little while ago. If you agree please help out and round up an issue and i'll bang it out. We can curb this convo there and get back to the issue at hand (Pun intended) These ☑️ Web ☑️ performance ☑️ checklists ☑️ ain't ☑️ gonna ☑️ check ☑️ themselves! /cc <link rel=import href=nav-view>
<link rel=import href=main-view>
<nav-view />
<main-view href=home.html>
<!-- all your kewl HTMLz will show up here -->
</main-view> DO REMEMBER HTML is declarative not imperative. That url can be used to Wait a minute...I think the whole "hypermedia" part of the web just clicked. |
@cristhiandick @albertoponti please review this. |
I feel like I should have never looked at this @brandondees @tmornini.
Seems to be the "Gold Standard" these days.
References
Checklist
The text was updated successfully, but these errors were encountered: