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

49 commits

Author SHA1 Message Date
Arunoda Susiripala b62a0e8f55 Bundle all the modules inside the app (#414)
* Remove the use of CDN and bundle everything inside the app.
We still pre-build the prefetcher because it needs
different webpack config which only targets browsers
supports Service Workers.

* Remove cdn config item.
We no longer using it.

* Stop adding script tags when staticMarkup=true

* Remove babel-plugin-transform-remove-strict-mode NPM module.
2016-12-17 17:49:10 +09: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
Naoyuki Kanezawa 8ddafaea5c custom document support (#405) 2016-12-16 10:42:40 -08:00
Arunoda Susiripala 43b0e6f514 Remove console.logs (#402) 2016-12-16 11:43:46 +09: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
Luke Edwards 249a0c4007 append bundle script to body (#353) 2016-12-07 08:53:50 +09:00
nkzawa 0b20273c77 remove workaround for react-hot-loader 2016-12-04 07:06:47 +09:00
Naoyuki Kanezawa f049a0bfa0 fix reading incorrect package.json (#323) 2016-12-02 15:56:02 +09:00
nkzawa 6ad1e23167 Merge branch 'master' into pr/259 2016-12-02 10:35:07 +09:00
Arunoda Susiripala fcd59adea1 Add support for webpack's CommonsChunkPlugin and remove next bundle (#301)
* Add example app which demonstrate the problem.

* Add the first working version.

* Fix lint issues.

* Add README.md

* Use /_next/main.js as the main file URI

* Add the support for loading the core next bundle.

* Optimize the output by removing Next modules from pages.

* Use the same package.json as master use.

* Change the example repo's README for simpler instructions.

* Change example projects package.json to support next build and start.

* Change main.js into commons.js.

* Add support for hot core reload and errors.

* Introduce require based on eval-script.

* Add error reporting support with hot reloading.

* Update README.md
2016-11-28 09:15:56 +09:00
Naoyuki Kanezawa c7ba914f52 Handle runtime errors (#268)
* display runtime errors by error-debug

* server: fix status

* render Error component on client error

* server: render runtime errors of error template

* server: handle errors of error template on render404

* server: add a comment

* server: refactor renderJSON

* recover from runtime errors

* _error: check if xhr exists

* _error: improve client error

* _error: improve error message
2016-11-24 23:03:16 +09:00
Benjamin Coe c56fde89c3
chore: add test coverage 2016-11-22 10:11:23 -08:00
zpnk e0455823a0 Add default utf-8 charset. (#270) 2016-11-17 15:06:54 -08:00
nkzawa 5383ad7ed9 fix getInitialProps doesn't get called when only url query was changed 2016-11-06 17:34:51 +09:00
nkzawa efbf0efc98 fix query for getInitialProps is not parsed as an object 2016-11-06 15:09:37 +09:00
Naoyuki Kanezawa d1a0309af9 Add pathname and query to the argument of getInitialProps (#194)
* pass pathname and query to getInitialProps on both server and client

* README: describe about the contet object of getInitialProps
2016-11-04 01:05:03 -07:00
David Street 7186fe8b7e Only update history state if url differs. (#172) 2016-11-03 19:15:03 +09:00
Naoyuki Kanezawa 037e2d9c26 batch update head contents (#129)
* head-manager: batch update

* side-effect: remove redundant rendering cycle checks
2016-10-28 23:39:20 +09:00
Naoyuki Kanezawa 93d856706b add cdn config (#111) 2016-10-28 23:38:24 +09:00
Naoyuki Kanezawa 1952a47a90 Merge pull request #39 from zeit/add/css-default-export
Exposing glamor style as default
2016-10-25 15:57:44 +09:00
Naoyuki Kanezawa ebecbcf89e Load client js from cdn with fallback (#34)
* load client js from cdn with fallback

* fix cdn url
2016-10-25 01:50:33 -04:00
nkzawa 7569ef6ca9 hot reload compilation errors 2016-10-25 00:20:50 +09:00
nkzawa 7ec46d512b hot reload added/removed pages 2016-10-24 16:22:15 +09:00
Dan Zajdband 6743e2b014 Exposing glamor style as default allowing different ways to import the css helpers 2016-10-22 09:45:41 +02:00
Dan Zajdband e164074f8e Added glamor css (#38)
* Added glamor css

* Using pseudoclasses instead of calling functions

* Updated readme using style instead of default import for css
2016-10-21 09:39:20 -07:00
nkzawa 2e2db37ccb add error page for debug 2016-10-19 21:41:45 +09:00
nkzawa 3c44137b9b improve hot-reloading 2016-10-17 23:35:31 +09:00
nkzawa 60aa5869e4 document: refactoring 2016-10-17 17:08:53 +09:00
nkzawa 1be8447a26 Merge branch 'master' into add/hot-reload 2016-10-17 11:10:16 +09:00
Dan Zajdband 1477734211 Added linting using standard (#27)
* Added linting using standard

* Linting on test
2016-10-16 17:00:17 -07:00
Dan Zajdband 7a331084dc Reverting default props for errors. (#12) 2016-10-16 15:44:26 -07:00
Dan Zajdband ea61fe412a Add current props to state when data available (#13) 2016-10-16 00:25:13 -05:00
Dan Zajdband e527098bb9 Implemented missing pieces for overriding 404 and 500 pages. (#10) 2016-10-15 17:36:54 -05:00
nkzawa 26e6193a97 hot-reload: initial 2016-10-15 00:05:08 +09:00
nkzawa facd19b5a7 add a css test 2016-10-10 13:35:37 +09:00
nkzawa 4f21383e0f improve render 2016-10-10 13:24:30 +09:00
nkzawa a8c6b9e57a lib/router: improve aborting xhr 2016-10-09 20:01:06 +09:00
nkzawa 3e721b6878 apply css on server rendering 2016-10-09 18:50:41 +09:00
nkzawa 0a0bb2e673 pages/_error: fix css 2016-10-09 18:36:58 +09:00
nkzawa 6718b05347 add _error.js, fix error handlings 2016-10-09 18:25:38 +09:00
nkzawa 22bf51bbe0 support getInitialProps 2016-10-08 19:16:22 +09:00
nkzawa e2ab55ad23 fix client/router 2016-10-08 14:12:51 +09:00
nkzawa 89f96cc160 support next/head 2016-10-07 10:57:31 +09:00
nkzawa 88b01e0a72 next-dev 2016-10-06 20:05:52 +09:00
nkzawa e51c7eabf1 fix client/router 2016-10-06 16:08:23 +09:00
nkzawa cb11c7cbc6 add Link component 2016-10-06 16:07:41 +09:00
Dan Zajdband 7a39dac8c7 Added css using aphrodite 2016-10-05 22:42:55 -04:00
nkzawa 9b06a22f31 initial source 2016-10-06 08:52:50 +09:00