Commit graph

377 commits

Author SHA1 Message Date
Joe Haddad
e27203f89b Dynamic routing mark 2 (#7432)
* Update escape string regexp operators

* temp

* Extract getRouteRegex func

* First iteration of dynamic routing for production only

* Correctly order prod

* Add serverless support

* Single line it

* noop routes

* Format doc

* Fix dynamic routing for dev

* Add flag for dynamic routing

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

Co-Authored-By: JJ Kasper <jj@jjsweb.site>

* remove example

* Add router tests

* Format code

* Sort routes

* Update to not use posix path methods
2019-05-27 11:20:33 -07:00
Joe Haddad
51b9eabe40
Refactor server router (#7431)
* Format next server

* Extract findPageComponents logic from renderToHTMLWithComponents

* Apply a little formatting

* Lift up component loading
2019-05-26 14:22:43 -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
JJ Kasper
9a50e926e3 Add document middleware (#7209)
* Add document middleware

* Update tests

* Apply suggestions from code review

Co-Authored-By: Luis Fernando Alvarez D. <luis@zeit.co>
2019-05-23 19:05:08 -07:00
JJ Kasper
bb46c0673b
v8.1.1-canary.37 2019-05-23 14:59:12 -05:00
JJ Kasper
4ba6447e40
Don't load from serverless in dev mode (#7416) 2019-05-23 14:47:57 -05: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
Joe Haddad
98bed84688
v8.1.1-canary.36 2019-05-23 00:57:48 -07:00
Joe Haddad
f9f80dffe5
Upgrade dependencies (#7412)
* ⬆️ Upgrade workspace dependencies

* Run new prettier against examples

* Upgrade some next-server packages

* Upgrade Next.js dependencies

* Upgrade webpack deps

* Upgrade async sema

* Fix compilation

* Revert broken plugin
2019-05-23 00:52:36 -07:00
JJ Kasper
3adaafe783
Make sure rendering behavior is only changed when autoExport is enabled (#7408) 2019-05-22 16:16:03 -05:00
Joe Haddad
b6d3c1fd81
v8.1.1-canary.35 2019-05-22 09:47:34 -07:00
JJ Kasper
cdd54afb0d Add auto static/dynamic (#7293)
* Add automatic exporting of pages with no getInitialProps

* Add support for exporting serverless to static
and serving the html files during next start

* Fix missing runtimeEnv when requiring page, re-add warning
when trying to export with serverless, and update tests

* Update flying-shuttle test

* revert un-used pagesManifest change

* remove query.amp RegExp test

* Fix windows backslashes not being replaced

* Re-enable serverless support for next start

* bump

* Fix getInitialProps check

* Fix incorrect error check

* Re-add check for reserved pages

* Fix static check

* Update to ignore /api pages and clean up some tests

* Re-add needed next.config for test and correct behavior

* Update RegExp for ignored pages for auto-static

* Add checking for custom getInitialProps in pages/_app

* Update isPageStatic logic to only use default export

* Re-add retrying to CircleCi

* Update query during dev to only have values
available during export for static pages

* Fix test

* Add warning when page without default export is
found and make sure to update pages-manifest
correctly in flying-shuttle mode

* Fix backslashes not being replaced

* Integrate auto-static with flying-shuttle
and make sure AMP is handled in flying-shuttle

* Add autoExport for opting in
2019-05-22 09:36:53 -07:00
JJ Kasper
e6fb48cee8
Fix string type on router.query (#7387) 2019-05-20 10:21:15 -05:00
Joe Haddad
dc1f907cec
v8.1.1-canary.34 2019-05-19 19:09:42 -04:00
Yuki Takemoto
17f6fa96bd Fix broken link (#7378) 2019-05-18 15:06:51 +02:00
JJ Kasper
3c3abcb6d1
v8.1.1-canary.33 2019-05-17 14:49:41 -05:00
Tim Neutkens
c77988944e v8.1.1-canary.32 2019-05-17 13:26:42 +02:00
Tim Neutkens
3dea1a5b15 v8.1.1-canary.31 2019-05-17 12:22:46 +02:00
JJ Kasper
f3b98994c4
v8.1.1-canary.30 2019-05-16 12:01:23 -05:00
JJ Kasper
7612e03a75
v8.1.1-canary.29 2019-05-15 13:48:51 -05:00
Lukáš Huvar
b5e3aac1ec Fix POST and PUT on api routes (#7319)
* Fix POST and PUT

* Fix condition for request and test
2019-05-13 15:40:23 +02:00
Tim Neutkens
1cb6c4088b v8.1.1-canary.28 2019-05-11 15:34:42 +02:00
Tim Neutkens
c73a76b3e9 v8.1.1-canary.27 2019-05-11 13:22:36 +02:00
Lukáš Huvar
fedfbd9d5c Experimental API support (#7296)
* First basic API support

* Change require functionality

* Change 501 to 404

* Change wording

* Fix test
2019-05-11 13:18:56 +02:00
Joe Haddad
c21116ae12
v8.1.1-canary.26 2019-05-10 15:52:23 -04:00
JJ Kasper
549b6379d2
v8.1.1-canary.25 2019-05-08 08:33:32 -05:00
Luis Fernando Alvarez D
a7ca031313
Renamed IContext to be NextPageContext (#7272) 2019-05-06 16:42:04 -05:00
Lukáš Huvar
5ac54d7afb Remove reload and use only location.reload (#7257) 2019-05-05 15:22:02 -05:00
JJ Kasper
a243bc435c Make sure to update asPath on hashOnlyChange to (#7255)
prevent getInitialProps from firing when it shouldn't
2019-05-05 14:34:33 -05:00
JJ Kasper
59039cfc22
Fix default meta tag being added in AMP mode (#7248) 2019-05-04 11:46:50 -05:00
JJ Kasper
0c639d94e7
v8.1.1-canary.24 2019-05-03 13:55:33 -05:00
Luis Fernando Alvarez D
74771bc5e4
Add support for /public (#7213) 2019-05-03 11:57:47 -05:00
JJ Kasper
9d936f3ab8
v8.1.1-canary.23 2019-05-03 09:51:40 -05:00
JJ Kasper
a3ec7ca914
v8.1.1-canary.22 2019-05-02 17:21:49 -05:00
Joe Haddad
13c55a19cb
v8.1.1-canary.21 2019-05-02 16:38:51 -04:00
JJ Kasper
064be18039
v8.1.1-canary.20 2019-05-01 15:34:24 -05:00
JJ Kasper
445d3f0a33 Make sure next-head class isn't added to title (#7214)
* Prevent next-head class from being added to title

* Add test for title updating when navigating with next/link
2019-05-01 21:36:24 +02:00
JJ Kasper
808f18cd75
Fix firefox bug with detecting instanceof Promise in dynamic (#7203) 2019-04-30 17:03:57 -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
6a5c39deaa
v8.1.1-canary.19 2019-04-28 15:47:26 -05:00
JJ Kasper
ab8620d6d6
v8.1.1-canary.18 2019-04-28 14:23:42 -05:00
JJ Kasper
353a08de16
v8.1.1-canary.17 2019-04-28 13:30:37 -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
Connor Davis
f66546f950
Use ncc to bundle webpack (#6347) 2019-04-26 17:24:30 -05:00
Joe Haddad
9e8505f0ca
v8.1.1-canary.16 2019-04-26 09:22:15 -04:00
Tim Neutkens
6f0e795f9b v8.1.1-canary.15 2019-04-26 09:41:20 +02:00
Luis Fernando Alvarez D
b963863106 Prefer type over interface (#7164) 2019-04-26 09:37:57 +02:00
Luis Fernando Alvarez D
92a58c1a6b
Add missing .d.ts for next/dynamic (#7158) 2019-04-25 15:36:04 -05:00