Commit graph

3793 commits

Author SHA1 Message Date
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
Tim Neutkens
6a507fad1d v8.1.1-canary.66 2019-07-03 14:41:25 +02:00
Tim Neutkens
a785ff7376
Bring down bundle size (#7743) 2019-07-03 14:38:21 +02:00
Tim Neutkens
a88d6b7482 v8.1.1-canary.65 2019-07-03 13:44:09 +02:00
JJ Kasper
7cf132f864
[Refactor] Move context providers to AppContainer (#7737) 2019-07-02 19:16:12 -07:00
Joe Haddad
e798b664a1
Add router event note (#7736)
* Add router event note

* Add line break

* Tweak wording
2019-07-02 21:35:38 -04:00
JJ Kasper
6ce7c06d9c Add initial static indicator (#7682)
* Add initial static indicator

* Update indicator text to pre-rendered

* Update naming from static to prerender

* Update to not re-use nextExport var

* Update positioning of indicator to prevent overlap
2019-07-02 20:42:41 -04:00
Joe Haddad
7439a773b0 Nit: Change Pre-render to Prerender (#7733) 2019-07-02 22:51:12 +02:00
Luis Fernando Alvarez D
c8bd427193 Dynamic routing documentation (#7602)
* Added basic example for dynamic routing

* Added some basic docs for dynamic routing

* Added more docs for dynamic routing

* Used doctoc

* fixed lint issues

* Added useRouter to docs

* Removed getInitialProps examples that are only using router props

* Added useRouter to the navigation

* Small fix

* Updated to the latest dynamic routes implementation

* lint fix

* Update dynamic routing example

* Tweak dynamic routing documentation

* Make basic example basic again

* Adjust dynamic routes section

* Remove query param for dynamic routes example

* Remove old note

* Fix linting
2019-07-02 16:00:58 -04:00
JJ Kasper
def94e6173
v8.1.1-canary.64 2019-07-01 15:23:15 -07:00
Luis Fernando Alvarez D
87610ccff5 Update with-zones example and Multi Zones documentation (#7513)
* Updated with-zones example to Now V2

* Updated Zones docs

* Update packages/next/README.md

Co-Authored-By: Tim Neutkens <tim@timneutkens.nl>
2019-07-01 15:21:00 -07:00
JJ Kasper
0ca8087565
Add prerender PageConfig option (#7699)
* Add prerender PageConfig option

* Update PageConfig type

* Add inlining of data when pre-render is set and add tests

* Update types import

* Add check for props

* Rename prerender to experimentalPrerender for now
2019-07-01 14:13:52 -07:00
Joe Haddad
0faf693ed2
Do not default TypeScript to strict: true (#7717) 2019-07-01 13:13:58 -04:00
Joe Haddad
5493f2e8b3
Remove Next.js debug mode (#7719) 2019-07-01 13:13:06 -04:00
Lukáš Huvar
4ad934c148 Serverless build for API routes (#7649)
* Fixes serverless target in development

* Fix serverless build

* Fix serverless build

* Add manifest test

* Better output

* Fix manifest test

* Update snapshot

* Remove snapshots
2019-07-01 12:47:11 -04:00
Joe Haddad
af94c27a9d
Upgrade watchpack to remove eslint-config-prettier (#7716) 2019-07-01 11:09:20 -04:00
Joe Haddad
c92e8c2a09
Remove "small" wording from runtime config overhead (#7715)
Using runtime configuration can cause you to de-optimize entire classes of optimizations.
These optimizations could make your application an order of magnitude faster (i.e. prerendering).
2019-07-01 11:09:09 -04:00
Johnboy
ed997b1131 Add back in second line of comment (#7718)
The second line of this comment was removed in the previous commit due to the usage of process.browser.
This meant the comment was incomplete and confusing
c03e94bebd (diff-a15b49cbb3a523d81a74e0fab7f08eb5)
2019-07-01 11:08:55 -04:00
JJ Kasper
564eac4746
Fix styled-jsx not rendering when used in node_modules (#7697)
* Don't transpile styled-jsx in server mode

* Add test fo styled-jsx-module

* Add styled-jsx as dependency of next-server
2019-06-29 15:42:07 -07:00
Josh Chorlton
15bcdab55c Add path to exportPathMap query missing message (#7708)
* Add path to exportPathMap query missing message

* Path to Url
2019-06-29 15:13:23 -07:00
JJ Kasper
aeeba6b2e8
v8.1.1-canary.63 2019-06-28 18:02:20 -07:00
JJ Kasper
356636c80f Add updated de-duping logic for next/dynamic (#7705) 2019-06-28 20:48:28 -04:00
Luis Fernando Alvarez D
7049c3b349 Updated with-now-env example (#7694) 2019-06-28 15:14:56 -07:00
Joe Haddad
39761e5ce7 Remove withAmp and do not expose isInAmpMode (#7690)
* Remove `withAmp` and do not expose `isInAmpMode`
This pull request removes the `withAmp` higher-order component in favor of the exported configuration object.
Retaining this backwards compatibility isn't worth the extra maintenance burden, given it hasn't been released for very long and the migration is ultra-simple.

I'm 👎 on retaining backwards compatibility just for the sake of it.

Migration example follows. I'm willing to write a codemod if reviewers feel it's necessary.

*Before*
```js
import { withAmp } from 'next/amp'

function Home() {
  return <h1>My AMP Page</h1>
}

export default withAmp(Home)
// or
export default withAmp(Home, { hybrid: true })
```

*After*
```js
export default function Home() {
  return <h1>My AMP Page</h1>
}

export const config = {
  amp: true,
  // or
  amp: 'hybrid',
}
```

* Fix { amp: 'hybrid' }

Co-Authored-By: JJ Kasper <jj@jjsweb.site>
2019-06-28 15:04:24 -07:00
Joe Haddad
808a3bcc66
v8.1.1-canary.62 2019-06-28 17:12:01 -04:00
Luis Fernando Alvarez D
e35053e8c3 Improve prefetch docs (#7692)
* added docs for disabling prefetch

* Update packages/next/README.md

Co-Authored-By: JJ Kasper <jj@jjsweb.site>
2019-06-28 13:57:22 -07:00
JJ Kasper
cf9762e089
Expand automatic pre-rendering docs (#7702)
* Expand automatic pre-rendering docs

* Apply suggestions from code review

Co-Authored-By: Luis Fernando Alvarez D. <luis@zeit.co>
2019-06-28 13:47:55 -07:00
Joe Haddad
3aed76fad8
Unflag Automatic Prerendering (#7666)
* Unflag Dynamic Routing

* Unflag Automatic Prerendering

* Ensure pages are lambdas for test

* Fix file check

* Fix tests

* oof

* Use lambda for document middleware test
2019-06-28 16:01:11 -04:00
JJ Kasper
291eb83923 Revert "Remove modules option from dynamic (#7688)" (#7701)
This reverts commit 0fd7e68556.
2019-06-28 13:39:23 -04:00
JJ Kasper
5f40306575 Remove coveralls (#7689) 2019-06-28 09:09:27 -04:00
JJ Kasper
0fd7e68556 Remove modules option from dynamic (#7688)
* Remove modules option from dynamic

* Remove old test
2019-06-28 09:02:33 -04:00
Lukáš Huvar
c156e0c889
Helpers update (#7686)
* Update helper function to invoke only on get

* Tests for body parsing

* Update api-utils.ts

* Update next-server.ts

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

Co-Authored-By: JJ Kasper <jj@jjsweb.site>
2019-06-28 11:31:32 +02:00
Taro Shono
ec958a3bd0 refactor: default dynamic loading component to null (#7543) 2019-06-27 18:07:07 -07:00
JJ Kasper
5e70a2f74c Make DefaultLoading return null (#7695) 2019-06-27 19:05:10 -04:00
Lukáš Huvar
bd31c5d1b7 Dynamic routes for API (#7629)
* Dynamic routes for API

* New structure

* Change next config

* Refactoring tests

* Fix newline

* Fix tests

* Remove dynamic from config

* Apply suggestions from code review

Co-Authored-By: Joe Haddad <timer150@gmail.com>

* Update index.test.js
2019-06-27 12:01:36 -04:00
JJ Kasper
b4e4bcda9b Clean up AMP logic and naming (#7669)
* Clean up AMP logic

* Tweak AMP logic some more

* Rename hasAmpVersion to hybridAmp
2019-06-27 10:22:24 -04:00
Lukáš Huvar
830281fecd Update typescript example (#7684) 2019-06-27 13:50:38 +02:00
JJ Kasper
44d8c624f4
v8.1.1-canary.61 2019-06-26 14:59:13 -07:00
JJ Kasper
7c30bf97f6
Re-add require cache clearing (#7674) 2019-06-26 12:16:54 -07:00