Commit graph

226 commits

Author SHA1 Message Date
Joe Haddad
2efad5a2d8
v8.0.4-canary.25 2019-03-27 12:02:26 -04:00
JJ Kasper
96c628409a
v8.0.4-canary.24 2019-03-26 11:31:48 -05:00
Joe Haddad
0249b331c2
Use a shared module cache (#6791)
* [WIP] Use a shared module cache

* ID modules in development

* Revert "ID modules in development"

This reverts commit 0613d92fa2c8c7fa11a5ff5b7770d784af1cec63.

* Remove context replacement

* Only enable shared runtime in prod

* Sort settings

* Add shared runtime experimental setting

* only enable shared runtime in serverless
2019-03-26 12:30:31 -04:00
Luis Fernando Alvarez D
dbd41725ce Removed the X-Powered-By header (#6789)
Related to #6776
2019-03-26 12:32:01 +01:00
Joe Haddad
1604862895
v8.0.4-canary.23 2019-03-25 12:18:42 -04:00
Tim Neutkens
7788849ad5 v8.0.4-canary.22 2019-03-25 15:09:01 +01:00
Tim Neutkens
24d8ec560f v8.0.4-canary.21 2019-03-25 13:01:14 +01:00
Tim Neutkens
fa5125488b v8.0.4-canary.20 2019-03-24 14:34:44 +01:00
Tim Neutkens
f639becf88
Don't use array for main chunk (#6767)
* Simplify getDisplayName

* Don’t use array for single file

* Add aliases, drop htmlescape as it’s not longer in the codebase

* Add correct path

* Use the correct router

* Remove dynamic for now

* Mark as external as the modules are directly called

* Add comment explaining what this does
2019-03-24 14:33:10 +01:00
Tim Neutkens
355078c350
Separate toRoute function (#6766)
Because Typescript output is turned to commonjs for these modules currently it’s better to do this. Also convert withRouter to typescript, making it smaller.
2019-03-23 23:00:46 +01:00
Tim Neutkens
cf7f707ff9
Remove PropTypes from _error and next/dynamic (#6763)
* Remove proptypes

* Remove loadable capture in favor of React.createContext

* Add loadable context file

* Make sure we use the context value instead
2019-03-23 21:00:31 +01:00
Joe Haddad
efdbd87625
v8.0.4-canary.19 2019-03-21 22:47:57 -04:00
JJ Kasper
397674c40e Fix export not checking amp right for /index.amp (#6748)
* Fix export not checking amp right for /index.amp

* Add test checking hybrid amp index behavior
2019-03-21 21:40:42 -04:00
Joe Haddad
34be001749
v8.0.4-canary.18 2019-03-20 16:06:57 -04:00
JJ Kasper
19f39511f4
v8.0.4-canary.17 2019-03-20 13:24:02 -05:00
Joe Haddad
773a3a21c5 v8.0.4-canary.16 2019-03-20 11:43:07 -04:00
Joe Haddad
b5880717e6
v8.0.4-canary.15 2019-03-20 09:21:21 -04:00
JJ Kasper
18af71c011 Add support for amp to export (#6725)
* Add support for amp to export

* Anchor canonical replace

* Disable profiling test for now

* Centralize amp utils to next-server/server/utils

* re-enable profiling test
2019-03-19 23:53:47 -04:00
Joe Haddad
2cd0e99af4
v8.0.4-canary.14 2019-03-19 15:49:37 -04:00
JJ Kasper
bce75ae9c3
Add checking for corresponding pages for link tags (#6719) 2019-03-19 14:01:42 -05:00
JJ Kasper
2cc8365d82
v8.0.4-canary.13 2019-03-19 10:16:06 -05:00
JJ Kasper
12cbb934b3 Add support for creating AMP pages (#6706)
* Add support for .amp.js pages and
resolving /page?amp=1 to page.amp.js

* Update amp tests

* Update example and clean up amp page resolving

* Add nested amp test

* page => normalizedPage

* Add type to page options

* Add handling of amp with all pageExtensions
and normalize page

* Make sure findPageFile only falls back to
amp if enabled
2019-03-18 23:24:21 -04:00
Tim Neutkens
ad856eb299 v8.0.4-canary.12 2019-03-18 13:30:22 +01:00
JJ Kasper
87bd1c3b09
Add error handling for error being thrown in _app getinitialProps (#6680)
* Fix handling of undefined being thrown
in getInitialProps and update integration test

* Update test

* Move test to app-document
2019-03-17 11:43:03 -05:00
JJ Kasper
a6ddaefe22 Add experimental exportTrailingSlash config (#6664)
By default when `next export`ing a Next.js application we will automatically append a `/` to all urls to be fully compatible with the directory structure being output.

However since most platforms support directory indexes it makes sense to change this default in the future.

This PR adds `exportTrailingSlash` as experimental flag. We'll try this out for a bit on nextjs.org / zeit.co/docs before introducing it as new option.

The default value is `true` as this is the current behavior in stable Next.js.

```
{
  experimental: {
    exportTrailingSlash: false
  }
}
```

⚠️ as with all experimental flags being added this is subject to breaking between canary/stable versions.
2019-03-17 00:54:58 +01:00
Joe Haddad
d5f736d623
v8.0.4-canary.11 2019-03-15 10:54:23 -04:00
Tim Neutkens
83334f1110
Convert change/getRouteInfo to not use async (#6648)
More updates to the router coming.
2019-03-14 19:43:29 +01:00
JJ Kasper
1e4372c627
Show a better error when someone throws undefined (#6646)
* Show a better error when someone throws undefined

* Update error wording

Co-Authored-By: ijjk <22380829+ijjk@users.noreply.github.com>

* Update error wording in test

Co-Authored-By: ijjk <22380829+ijjk@users.noreply.github.com>

* Update test and add check for statusCode
before updating error
2019-03-13 13:39:05 -05:00
Tim Neutkens
b7bd1f775a
Convert router/router.js to typescript (#6644)
- Removed `fetchRoute` as it was only used once (internal method, non-breaking)
- Convert files to TypeScript
- Don't extend `ServerRouter` from `Router` as it introduces unneeded overhead, we only have to provide `pathname` `asPath` and `query` for `withRouter`. Also added `events` even though it shouldn't be called on SSR, just making sure we don't break things.
2019-03-13 15:56:20 +01:00
JJ Kasper
c685b9b0d0
Apply workaround for Firefox bug (#6630)
* Apply workaround for Firefox bug
and shallow routing

* Update to only apply workaround when needed

* Add TODO for future removal

Co-Authored-By: ijjk <22380829+ijjk@users.noreply.github.com>
2019-03-12 16:36:25 -05:00
JJ Kasper
e2944c0aca
Fix loading showing before pastDelay (#6628) 2019-03-12 14:12:49 -05:00
JJ Kasper
58cbd0aa4e Fix HMR failing when rendering with /index (#6541)
Fixes: #6497
2019-03-12 12:40:49 +01:00
JJ Kasper
b6dfb44a8f
v8.0.4-canary.10 2019-03-12 01:27:01 -05:00
Tim Neutkens
b32e65a830 Add experimental profiling flag (#6594)
* Add experimental profiling flag

* Update config.js
2019-03-11 13:53:24 -04:00
Joe Haddad
eee0d6ce8d Default to the previous CPU calculation (#6605) 2019-03-11 17:42:54 +01:00
JJ Kasper
852a62bf56 Add experimental cpus config and use CircleCI env var (#6604)
* Add using CircleCI env var for max workers
and expose webpack to config

* Expose experimental cpu config

* Fix typo

* Remove log
2019-03-11 17:33:30 +01:00
Tim Neutkens
3c04b0f4e1
Don’t prefetch outside of production (#6578)
Fixes #1827 

This doesn't affect integration tests as they'd use `next build` which forces production mode. Development forces `development`.
2019-03-08 20:08:57 +01:00
JJ Kasper
41278a62f2
Remove _error page from blocked pages (#6579) 2019-03-08 13:00:09 -06:00
Tim Neutkens
654860e7b5 v8.0.4-canary.9 2019-03-07 19:57:48 +01:00
JJ Kasper
e112df4319 Throw error when router methods are used in SSR (#6550)
* Update to use the correct router instance in withRouter so error is
thrown when router method is used during SSR

* Revert changes to with-router and add error to methods on
direct router instance

* Extend Router and override methods with error instead

* Update ServerRouter, add err.sh, and add test
2019-03-07 17:13:38 +01:00
Tim Neutkens
f177ce4291 v8.0.4-canary.8 2019-03-06 13:10:21 +01:00
Tim Neutkens
8f25bc6871 v8.0.4-canary.7 2019-03-03 20:47:05 +01:00
Joe Haddad
e52508fbf6
Consolidate traditional and AMP rendering methods (#6506)
* Format a few documents

* Drop `renderToAMP` and `renderToAMPHTML`
2019-03-01 15:35:43 -05:00
Joe Haddad
494889acd8
Format a few documents (#6505) 2019-03-01 14:51:13 -05:00
JJ Kasper
912e45b506 Show error when router or Component are returned in _app.js (#6487)
* Show error when `router` or `Component` are returned in _app.js
getInitialProps

* Update to only show error in dev mode

* Update packages/next-server/server/render.tsx

Co-Authored-By: ijjk <22380829+ijjk@users.noreply.github.com>
2019-03-01 18:08:27 +01:00
Joe Haddad
a8d7a6ce42 v8.0.4-canary.6 2019-02-28 15:38:12 -05:00
Joe Haddad
68123d8b8d v8.0.4-canary.5 2019-02-28 14:35:21 -05:00
tangye
704edcc1ba Make router UrlIsNew comparing method work as expected (#6383)
* make router UrlIsNew comparing method work as expected

* Remove shallow-equals from router and update urlIsNew check

* Remove shallow-equals test since it is no longer used

* Add integration test for asPath query
2019-02-28 12:53:29 -06:00
JJ Kasper
1c1d5d01f8 Throw error when Promise is returned in next.config (#6476)
After discussion, it was decided we should throw an error when a promise is returned in `next.config.js` as this isn't supported

Fixes: #6416
2019-02-28 14:39:51 +01:00
Tim Neutkens
88388f79b4 v8.0.4-canary.4 2019-02-27 13:20:30 +01:00