1
0
Fork 0
mirror of https://github.com/terribleplan/next.js.git synced 2024-01-19 02:48:18 +00:00
next.js/server
Arunoda Susiripala 36abdc77c5 Prefetch pages with Service Workers (#375)
* 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.
2016-12-15 11:13:40 -08:00
..
build Prefetch pages with Service Workers (#375) 2016-12-15 11:13:40 -08:00
config.js add cdn config (#111) 2016-10-28 23:38:24 +09:00
hot-reloader.js Merge branch 'master' into pr/264 2016-12-02 10:21:21 +09:00
index.js Prefetch pages with Service Workers (#375) 2016-12-15 11:13:40 -08:00
read.js server/read: remove unused argument 2016-10-17 11:19:42 +09:00
render.js Handle runtime errors (#268) 2016-11-24 23:03:16 +09:00
require.js write assets to disk 2016-10-16 04:49:42 +09:00
resolve.js add error page for debug 2016-10-19 21:41:45 +09:00
router.js initial source 2016-10-06 08:52:50 +09:00