Show HN: Joconut - Smart PJAX jQuery plugin in 1kb
github.com
github.com
(Is it simply that it saves you the effort of setting your caching headers for inline resources properly?)
It also seems to blow away any previous listeners places on elements. Any plans to have callbacks for events so that listeners can be re-bound?
Aside from that, looks totally sweet. I'm going to use this in a bunch of places.
Thanks, glad you like it!
One thought came to mind for a potential leaky abstraction: unlike HTML and CSS that can be "undone" and are idempotent, JS has side effects that can't be undone, and isn't always idempotent. Are there JS patterns we need to embrace or avoid to ensure Joconut always "just works"?
- How is this different form the existing PJAX-plugin?
- Is there a demo page for this plugin?
1. 1kb minified and gzipped
2. Auto-loading of JS and CSS from new pages, if needed
3. No need to set up and configure
Um, no. The pages won't "instantly" load - the browser still has to make a round trip to load the page content.
A loading or progress indicator should still be shown letting the user know that this round trip is taking place - especially important if you're on a slow US cell network. If a user is on a slow connection and no visual feedback is given they may end up mashing a link, making the load time worse - or, worse yet, assume the site is broken.
Use either if you have an irrational aversion to page reloads.
Snark aside - jQuery Mobile uses a similar technique to cache entire pages in the DOM and for page transitions.
One question though: Is there any setup i need to do, or does it just fit right in with my existing pjax set-up?
2. 1kb minified and gzipped
3. Auto-load of additional JS and CSS from new pages, if needed