1
0
Fork 0
mirror of https://github.com/terribleplan/next.js.git synced 2024-01-19 02:48:18 +00:00
Commit graph

18 commits

Author SHA1 Message Date
Naoyuki Kanezawa 540a86f007 fix prefetch url (#1154) 2017-02-15 15:01:03 +01:00
Naoyuki Kanezawa 38d236e2b3 fix prefetching relative path (#1151) 2017-02-15 13:34:13 +01:00
Arunoda Susiripala 14c86bef1d Introduce a simple prefetching solution (#957)
* Implement a very simple prefetching solution.

* Remove next-prefetcher.

* Require 'whatwg-fetch' only in the client.

* Use xhr in the code.

* Use a simple fetching solution.

* Fix 404 and xhr status issue.

* Move the prefetching implementation to next/router.

* Add deprecated warnning for next/prefetch

* Run only 2 parellel prefetching request at a time.

* Change xhr to jsonPageRes.

* Improve the prefetching logic.

* Add unit tests covering the Router.prefetch()

* Update examples to use the new syntax.

* Update docs.

* Use execOnce() to manage warn printing.

* Remove prefetcher building from the flyfile.js
Because, we no longer use it.
2017-02-15 14:22:22 +05:30
Eric Zingeler d382e4db9a replace location.origin usage with new utils/getLocationOrigin (#1142) 2017-02-15 14:01:19 +05:30
Tim Neutkens 6431f5fce2 Allow any element to be rendered under Link (#921)
* Allow any element to be rendered under Link

* Use Children.only instead of Children.map

* Remove check for multiple children since we already throw at 2+

* Clean up variables
2017-02-03 12:27:12 -08:00
Dan Zajdband 70b92e6b65 Added deprecation message when adding an extra anchor in behalf of the user. (#797) 2017-01-16 22:02:11 +01:00
Naoyuki Kanezawa c1a620a7c4 Support relative urls on Link component (#614)
* link: support relative urls

* link: support protocol-relative urls

* router: fix error for clicking anchor tag
2017-01-01 22:22:07 -08:00
Tim Neutkens e8985b3588 Add warning for multiple children in Link (#558)
* Add warning for multiple children in Link

* Add space after if

* Use proptype validation
2016-12-29 21:53:20 +09:00
Naoyuki Kanezawa 242758e3ee fix navigation failure (#546) 2016-12-27 21:27:52 -08:00
nkzawa 6b18e34f66 link: tweak scroll condition 2016-12-22 17:17:50 +09:00
James O'Dwyer 31feced24a Avoid autoscrolling anchored URLs (#474)
* force scroll to false if # is found in url

* only overwrite scroll if scroll=true is not passed in

* clean up logic around setting scroll var
2016-12-22 17:15:49 +09:00
Arunoda Susiripala 22776c2eee Implement the Singleton Router API (#429)
* Immplement the initial singleton Router.

* Use the new SingletonRouter for HMR error handling.

* Use SingletonRouter inside the Link.

* Create an example app using the Router.

* Make the url parameter optional in Router.push and Router.replace

* Add a section about next/router in the README.
2016-12-19 06:40:26 -08:00
Naoyuki Kanezawa 1708222381 Programmatic API (#310)
* add 'next' api

* add render APIs

* add 'as' prop to Link

* check Accept header to serve json response

* check if response was finished on getInitialProps call

* move server/app to server/index

* load webpack-hot-middleware-client by absolute path

* server: options for testing

* add tests

* example: improve

* server: make dir optional

* fix client routing

* add parameterized routing example

* link: fix display url

* Add custom-server-express example (#352)

* Add custom-server-express example

* Remove extraneous nexts in express routes defs

* Update next config in server.js

* Handle accept headers totally inside Next.js (#385)

* Handle accept headers totally inside Next.js
Now user doesn't need to handle it anymore.

* Move json pages serving to /_next/pages base path.

* Join paths correctly.

* remove next/render
2016-12-16 12:33:08 -08:00
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
Matthew Mueller a8f58be450 fix link for environments without synthetic events (like preact/the browser) (#393) 2016-12-15 10:03:02 +05:30
Dan Zajdband 1477734211 Added linting using standard (#27)
* Added linting using standard

* Linting on test
2016-10-16 17:00:17 -07:00
nkzawa e2ab55ad23 fix client/router 2016-10-08 14:12:51 +09:00
nkzawa cb11c7cbc6 add Link component 2016-10-06 16:07:41 +09:00