* Register the service worker.
* Update prefetcher code to do prefetching.
* Implement the core prefetching API.
support "import <Link>, { prefetch } from 'next/prefetch'"
* Implement a better communication system with the service worker.
* Add a separate example for prefetching
* Fix some typos.
* Initiate service worker support even prefetching is not used.
This is pretty important since initiating will reset the cache.
If we don't do this, it's possible to have old cached resources
after the user decided to remove all of the prefetching logic.
In this case, even the page didn't prefetch it'll use the
previously cached pages. That because of there might be a already running
service worker.
* Use url module to get pathname.
* Move prefetcher code to the client from pages
Now we also do a webpack build for the prefetcher code.
* Add prefetching docs to the README.md
* Fix some typo.
* Register service worker only if asked to prefetch
We also clean the cache always, even we initialize
the service worker or not.
Earlier we add a event to init next.js when dom has loaded.
But if at that time dom is already loaded, next.js won't get init ever.
Now we are using domready NPM module which handle these for us.
* Added travis file
* Dropping node 5
* Added os field as well
* Removed os, fails on both osx and linux
* Adding ava and sockjs-client as devDeps
* Shouldn't need ava 🤔
* Moved sockjs-client to dependency
* next init: Create supplied directory if it does not exist.
* next init: use mkdirp to init into nested dirs.
Picked mkdirp-then out of many alternatives. Same author & similar
dependencies to mz.
Now next init a/b/c works.
Related https://github.com/zeit/next.js/pull/136#discussion_r85543040