Commit graph

13 commits

Author SHA1 Message Date
Lukáš Huvar
c821e83048 API interface extensions (#7363)
* Cookies and Query parsing for API request

* Adding JSON and SEND

* First body parsing

* Body parsing

* Remove extra try catch

* Fix tests

* Only server bundling for API routes

* Update packages/next-server/server/api-utils.ts

Co-Authored-By: Tim Neutkens <tim@timneutkens.nl>

* Revert on demand server changes

* Use content-type for parsing

* Update packages/next-server/server/api-utils.ts

Co-Authored-By: Jan Potoms <potoms.jan@gmail.com>

* Add tests for server compilation

* Add body limit

* Change API to function chaining

* Limit test
2019-06-05 13:22:09 +02:00
Tim Neutkens
3e51ddb8af
Move syntax formatting to prettier (#7454)
* Run prettier over packages/**/*.js

* Run prettier over packages/**/*.ts

* Run prettier over examples

* Remove tslint

* Run prettier over examples

* Run prettier over all markdown files

* Run prettier over json files
2019-05-29 13:57:26 +02:00
JJ Kasper
24034ec957 Add amp.canonicalBase option to set absolute URL (#7262)
* Add canonicalBase config to allow setting
absolute path for canonical link

* Make sure canonicalBase is set for
export and serverless

* Move canonicalBase to amp.canonicalBase

* Update tests with canonicalBase config

* Update tests

* run lint-fix

* Fix canonicalBase config parsing

* Fix canonicalBase during export

* Update amphtml tests
2019-05-28 17:32:17 -07:00
JJ Kasper
77b23264bb Opt out of cache header if _app has custom getInitialProps (#7409)
* Opt out of cache header if _app has custom
getInitialProps to match autoExport behavior

* Fix wrong component

* Add test for cache header
2019-05-23 20:24:02 -07:00
Lukáš Huvar
bf294ee494
Types description (#7217)
* App, Document, Page, Error types description

* Router description

* Added head changed router

* Additions

* Fix examples

* Push and replace details

* Update packages/next-server/lib/head.tsx

Co-Authored-By: Luis Fernando Alvarez D. <luis@zeit.co>

* Update packages/next-server/lib/utils.ts

Co-Authored-By: Luis Fernando Alvarez D. <luis@zeit.co>

* Update packages/next/types/index.d.ts

Co-Authored-By: Luis Fernando Alvarez D. <luis@zeit.co>

* Update packages/next/pages/_document.tsx

Co-Authored-By: Luis Fernando Alvarez D. <luis@zeit.co>

* Update packages/next/pages/_document.tsx

Co-Authored-By: Luis Fernando Alvarez D. <luis@zeit.co>

* Update packages/next/pages/_app.tsx

Co-Authored-By: Luis Fernando Alvarez D. <luis@zeit.co>

* Update packages/next/pages/_document.tsx

Co-Authored-By: Luis Fernando Alvarez D. <luis@zeit.co>
2019-05-23 21:31:22 +02:00
Luis Fernando Alvarez D
a7ca031313
Renamed IContext to be NextPageContext (#7272) 2019-05-06 16:42:04 -05:00
JJ Kasper
e3f0236887 Make sure Cache-Control header is set when no getInitialProps (#7202)
* Remove loadGetInitialProps from _app and fix
cache-control header not being

* Update to still use loadGetInitialProps
in _app since it's simpler

* Add test for cache-control header with custom _app
2019-04-30 23:28:25 +02:00
Luis Fernando Alvarez D
ab22b58818
Allow _app and _document to be extended with other props (#7184) 2019-04-29 11:47:40 -05:00
JJ Kasper
84afda6bd1
Update cache-control header when no getInitialProps (#7185) 2019-04-28 13:28:59 -05:00
Luis Fernando Alvarez D
2eee876630
Add types for getInitialProps (#7162)
* Added types for pages
2019-04-27 19:00:31 -05:00
Luis Fernando Alvarez D
b963863106 Prefer type over interface (#7164) 2019-04-26 09:37:57 +02:00
JJ Kasper
4fefa2e4f2 Add stale-while-revalidate when no getInitialProps (#7149)
* Add stale-while-revalidate when no getInitialProps

* Make sure setHeader exists
2019-04-25 10:11:05 +02:00
Luis Fernando Alvarez D
29f71bfcba Add more TypeScript types (#7054)
* Moved server/lib/utils.js to Typescript

* moved _app.js to Typescript

* Moved _error.js to Typescript

* Added argument for custom props in _app and _error

* Moved _document.js to Typescript

* updated one test

* Updated types and added a validation for _document props

* Improved types

* Fixed some types

* Updated AppType

* Fixed some tests

* Added missing import

* Removed a not very useful type

* Fix missing type

* Move @types/styled-jsx

* Fix typescript errors
2019-04-22 19:55:03 +02:00