Commit graph

974 commits

Author SHA1 Message Date
Luis Fernando Alvarez D
7b25e2995e Export types for link props (#7905)
* export LinkProps

* Add test
2019-07-11 14:52:21 -04:00
Luis Fernando Alvarez D
b94123ccc9 Improve exported router types (#7853)
* Added the RouteUrl type and improved router types

* Added more tests for router types

* Add build test for typescript types

* Add next-env.d.ts to the typescript test

* Removed next-env.d.ts

* Added next-env.d.ts to gitignore

* Remove route url re-exports

* renamed PublicRouterInstance to be NextRouter

* export the Url type

* Replaced BaseRouter with NextRouter in server/utils

* Don't export the Url type

* Update tsconfig.json
2019-07-11 13:35:39 -04:00
Joe Haddad
13cf664898
Add support for legacy server npm modules (#7898)
Notably, this PR fixes `faunadb` which relies on `formidable`.

n.b. `formidable` is an unmaintained legacy npm package that uses practices not compatible with the modern ecosystem.
2019-07-11 13:02:43 -04:00
Lukáš Huvar
2450c85e81 exportPathMap dynamic routes params fix (#7846)
* Fix dynamic page export fixes #7829

* Adding handling of unmatched path

* Remove logs

* Fix newline

* Tests

* Fix promise

* Fix amp tests

* Revert test

* Adjust error document

* Remove old argument

* Simplify export test

* Ensure page !== path for this check
2019-07-10 17:13:44 -04:00
JJ Kasper
41cb3b3bc0 Stop PageConfig plugin from running on non-pages (#7884)
* Add test for PageConfig

* Make sure PageConfig plugin is only run for pages
2019-07-10 15:27:11 -04:00
JJ Kasper
268ac93685 Fix placeholder values being added when exporting from serverless (#7883)
* Add testing serverless in dynamic routes suite

* Fix placeholder dynamic values being added
when exporting from serverless
2019-07-10 15:23:28 -04:00
Tim Neutkens
8122d82130 Handle empty directory (#7876)
* Add test for empty directory

* Fix test re-runs

* Handle empty `pages/` directory
2019-07-10 11:45:53 -04:00
JJ Kasper
bf7af1d16b Add default values for runtime config (#7847)
* Add default values for runtime config

* Add test to ensure default values are set
for runtime config

* Only add runtimeConfig if it's not empty

* Only add runtimeConfig if it's not empty

* Simplify default value adding

* Reduce bundle size

* remove comment changes

* Fix typos

* Add test for runtimeConfig in __NEXT_DATA__
2019-07-10 10:43:04 -04:00
Joe Haddad
24fa6b352f
Title may be omitted (#7865)
Fixes https://github.com/zeit/next.js/issues/7854
2019-07-10 01:53:20 -04:00
Joe Haddad
e5fa2beac1
v9.0.1-canary.1 2019-07-10 01:39:48 -04:00
Joe Haddad
b430a4919e
Allow React.Fragment for Document styles (#7863)
* Allow React.Fragment for Document styles

Fixes https://github.com/zeit/next.js/issues/7784
Closes https://github.com/zeit/next.js/pull/7860

* Fix types

* Remove `Without`
2019-07-10 01:39:07 -04:00
Joe Haddad
437140a048
Add UrlObject to router methods (#7859) 2019-07-10 00:10:44 -04:00
Barry
1d8fa3a943 fix terminal links (cmd-click) on VSCode (#7849) 2019-07-09 19:34:20 -05:00
Joe Haddad
ab0b2cf3da
Add a test for module.exports from a page (#7842)
Closes https://github.com/zeit/next.js/issues/7835
2019-07-09 13:23:38 -04:00
Vincent Cordobes
a137447151 Improve NextApiResponse typing (#7841)
* Fix NextApiResponse.status type signature

* Improve NextApiResponse typing
2019-07-09 13:02:46 -04:00
Joe Haddad
ce8956aeda
Miscellaneous doc updates (#7831)
* Runtime config is not compatible w/ prerendering

Closes https://github.com/zeit/next.js/issues/7827

* Add req and res types

* Document using CORS
Closes https://github.com/zeit/next.js/issues/7805

* Add docs about GIP and Prerendering

Closes https://github.com/zeit/next.js/issues/7786

* set => provided

* Note by default

* Ref CORS doc

* Specify empty object
2019-07-09 09:24:29 -04:00
sharils
aac4e21d46 Reduce confusion about passing an object to push (#7818) 2019-07-09 13:34:11 +02:00
JJ Kasper
30da9e075e Update to always require next/config when setting config (#7822) 2019-07-09 13:23:51 +02:00
Praveen Senadheera
432eec2aec Fix small typo in TypeScript documentation (#7820) 2019-07-09 01:18:28 -04:00
Joe Haddad
3f56bc5092
Update docs about Automatic Prerendering (#7816)
* Update docs about Automatic Prerendering
Closes https://github.com/zeit/next.js/issues/7791

* Tweak layout

* Fix review from @ijjk

* Revise wording

* Simplify note since we note this below

* Update packages/next/README.md

Co-Authored-By: JJ Kasper <jj@jjsweb.site>
2019-07-08 23:41:26 -04:00
Admon Sasson
634b138b40 Make recursiveReadDir return sorted array (#7658)
This function is used to return the /pages folder content.
The way it is today is that every run might result in a different order of files, which makes the whole webpack chunks be different.
An ordered list of files will result in a deterministic build, which will improve caching.
2019-07-08 21:06:04 -04:00
JJ Kasper
e56573008b Fix package count being zero in some cases (#7812)
contains ignored package name
2019-07-08 20:49:51 -04:00
Joe Haddad
3208024735
Undocument the public/ folder (#7810)
Closes https://github.com/zeit/next.js/issues/7800
2019-07-08 20:12:40 -04:00
Joe Haddad
7da546a3a5
v9.0.1-canary.0 2019-07-08 19:23:58 -04:00
JJ Kasper
78bba56580 Add API tests to serverless (#7774)
* Add failing API tests to serverless

* Add newline

* Fix failing serverless tests
2019-07-09 00:50:01 +02:00
Joe Haddad
b013e11be3
Upgrade to webpack with latest acorns (#7795)
Closes https://github.com/zeit/next.js/issues/6240
2019-07-08 15:36:55 -04:00
Joe Haddad
6a35b1d302
Set cancelled property on routeChangeError error (#7790)
* Set `cancelled` property on routeChangeError error

* Add route cancellation tests
2019-07-08 15:25:46 -04:00
JJ Kasper
a7171db2ca Remove previous cache logic (#7794)
* Remove previous cache logic

* Remove old test
2019-07-08 14:59:45 -04:00
Delba de Oliveira
4172c894d3 Further clarification that api routes should be inside the page… (#7780) 2019-07-08 16:28:58 +02:00
Tim Neutkens
66bf56ff7e v9.0.0 2019-07-08 08:43:07 +02:00
Joe Haddad
9f65e50b66
v8.1.1-canary.70 2019-07-08 02:23:36 -04:00
Lukáš Huvar
264fc01969 API routes documentation (#7562)
* API routes examples and documentation

* Update examples/api-routes-micro/README.md

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

* Update examples/api-routes/README.md

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

* Apply suggestions from code review

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

* Update API routes docs

* Improve example to reflect dynamic routes

* Update readme to reflect API routes changes

* Apply suggestions from review
2019-07-07 23:04:04 -07:00
Joe Haddad
b0b1c320a8 Experimentalize public/ (#7771)
* Experimentalize `public/`

* Update tests for publicDirectory config
2019-07-08 07:45:41 +02:00
Lukáš Huvar
f204935251 Fix serverless loader for API routes (#7767)
* Fix serverless loader for API routes

* Only use params with dynamic routes
2019-07-07 17:45:40 -04:00
Alexander Kachkaev
e995c73b2c [typings] Allow getInitialProps to be sync (#7763) 2019-07-07 14:52:59 -04:00
JJ Kasper
cc497568b4
v8.1.1-canary.69 2019-07-05 16:45:09 -07:00
Joe Haddad
270d548d33
Remove old docs (#7760)
* Remove old docs

* Run doctoc
2019-07-05 12:01:21 -04:00
Joe Haddad
6fa17b3f15
Improve automatic prerendering warning (#7759) 2019-07-05 11:57:16 -04:00
JJ Kasper
80b46c1d28 Update to have default pageProps of {} instead of null (#7734)
* Update to have default pageProps of {} instead of null

* Update test

* Test for empty object
2019-07-05 11:00:23 -04:00
Joe Haddad
7f3bdb1bf0
v8.1.1-canary.68 2019-07-05 01:08:29 -04:00
JJ Kasper
7ac8dcbec0 Add deprecation message for next/dynamic modules (#7750) 2019-07-04 23:36:53 -04:00
Joe Haddad
b60985b2be
Revert "fix(Link): Set focus back to the body element (#7693)" (#7753)
This reverts commit defde85e81.
2019-07-04 23:24:14 -04:00
Connor Bär
defde85e81 fix(Link): Set focus back to the body element (#7693)
* fix(Link): Set focus back to the body element

* refactor(Link): Fix typings

* Update blurring logic and add tests
2019-07-04 11:30:22 -04:00
Lukáš Huvar
87acbdb594
Http methods update for static files and pages (#7721)
* Change static method handling and pages revert

* Allow and reflect old behaviour

* Post should return 501

* Add back old test

* Invert logic

* Handle 501 for pages in separate location

* Remove usage of 501 HTTP status code

* Prevent information leak

* Add test

* Only 405 if the page exists -- 404 if it doesn't

* Handle sent responses

* Revert "Handle sent responses"

This reverts commit 5e9012ae29b611c25ed1e090756a25dbe3437182.

* Fix bad test

* Switch back to quiet

* Update test/integration/production/test/index.test.js

Co-Authored-By: JJ Kasper <jj@jjsweb.site>
2019-07-04 10:22:25 +02:00
Junyoung Choi
12f1a63442 Expose next function type (#7726)
* Expose next function type

* Add type testing for typescript custom server

* Move types test to integration folder
2019-07-03 19:38:58 -07:00
JJ Kasper
e00a2c5d64
v8.1.1-canary.67 2019-07-03 15:57:16 -07:00
Lukáš Huvar
a60da57453 Clarify params and query merging (#7744)
* Clarify params and query merging

* Tweak README per @ijjk
2019-07-03 16:08:50 -04:00
Joe Haddad
b2a9670ca4
Make exportTrailingSlash stable (#7746) 2019-07-03 13:25:44 -04:00
Joe Haddad
e36d7b3226
Add example route event code (#7745) 2019-07-03 11:34:41 -04:00
JJ Kasper
f8097e5111 Add next-server/types to package.json files (#7740) 2019-07-03 10:33:34 -04:00