Commit graph

444 commits

Author SHA1 Message Date
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
Joe Haddad
ff5c8465de
First pass of runtime amp validator (#6708) 2019-03-18 19:21:18 -04:00
Tim Neutkens
0e39b24592
Clean up ErrorBoundary component (#6703) 2019-03-18 18:08:51 +01:00
Tim Neutkens
b41c85e32a
Remove headManager property as it’s unused (#6700)
This was leftover from before we moved to `HeadManagerContext`

Also removes `emitterProp` as it's unused in the Next.js codebase too.
2019-03-18 16:22:36 +01:00
Tim Neutkens
ad856eb299 v8.0.4-canary.12 2019-03-18 13:30:22 +01:00
JJ Kasper
2d6a73cb66 Remove conflicting <head> tags in amp mode (#6693) 2019-03-18 12:29:31 +01:00
Tim Neutkens
6104a71afb Make react-loadable-manifest only have modules that are part of dynamic chunks (#6622)
* Make react-loadable-manifest only have modules that are part of dynamic chunks

* Add manifest sorting
2019-03-17 14:19:26 -04: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
11a161f296 Add possible explanation for webpack resolve error (#6682)
When overriding `config.resolve.alias` incorrectly webpack will throw an error because private-next-pages is not defined. This adds a more descriptive error explaining the error better.

Fixes: #6681
2019-03-17 13:13:29 +01: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
Kristian Heruc
70a2c78342 Remove empty paragraphs and missing examples (#6677)
Fixes #6639 and incorrect heading IDs.
2019-03-16 14:32:08 +01:00
JJ Kasper
69b53bfc81 Remove sourceMaps from amp styles to not go over limit (#6674)
* Remove sourceMaps from amp styles to not go over limit

* Add test to make sure style sourceMaps
are removed in amp
2019-03-15 14:53:02 -04:00
Joe Haddad
d5f736d623
v8.0.4-canary.11 2019-03-15 10:54:23 -04:00
JJ Kasper
c81bd27587 Fix relative next path not working in webpack config (#6667)
* Fix relative next path not working in
webpack config

* Also add relative fix to amp path
2019-03-15 00:09:00 -04:00
Joe Haddad
d7ab018f31
Hash module IDs to save on bundle size (#6660) 2019-03-15 00:08:22 -04:00
Joe Haddad
0ae34c9a9d
Use relative instead of absolute for entry paths (#6659) 2019-03-14 21:45:50 -04:00
Joe Haddad
6902afbd3f
Stabilize Chunk ID generation (#6663)
* Add a new field to webpack types

* Revert "Add a new field to webpack types"

This reverts commit d35fa02207fbfd0085da0fc56aac42c4ff7c34c9.

* Add HashedChunkIdsPlugin to make consistent chunk ids

* Revert "Revert "Add a new field to webpack types""

This reverts commit 338219049e1432038f90c91928b010bbb1267999.

* Make it optional

* Remove record ids

* Revert "Remove record ids"

This reverts commit 15c22dbcda72466c382397c91d02295620f62326.
2019-03-14 21:38:57 -04:00
Connor Davis
b73abc0a4b Delete using realpath in HMR cache (#6635)
This will allow symlinked assets to be removed from the cache as well

Fixes: #5620
2019-03-15 00:22:57 +01: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
Ravinder Mahajan
1c31d79c38 Creating one more example which only uses redux and no thunk as middl… (#6636)
Adding one more example which only uses redux and not thunk. This helps a lot for a beginner to understand basic redux first.
2019-03-14 17:40:00 +01:00
Joe Haddad
1fb1b75216
Ensure all modules are identified (#6656)
* Ensure all modules are identified

* Extend a webpack Plugin

Co-Authored-By: Timer <timer150@gmail.com>
2019-03-14 11:04:08 -04:00
JJ Kasper
a38c6cb3d9
Add err.sh link for threw undefined (#6649)
* Add err.sh link for threw undefined

* Update wording

Co-Authored-By: ijjk <22380829+ijjk@users.noreply.github.com>
2019-03-13 15:08:06 -05: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
38ad8d870c
Fix export with folders that contain dot (#6538) 2019-03-12 18:30:03 -05: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
Joe Haddad
e5636dcdb0
Inject the build ID after webpack runs (#6618)
* Inject the build ID after webpack runs

* add webpack sources types

* use webpack plugin instead

* reset file

* Skip source maps if none were provided

Co-Authored-By: Timer <timer150@gmail.com>
2019-03-12 16:39:44 -04:00
JJ Kasper
e2944c0aca
Fix loading showing before pastDelay (#6628) 2019-03-12 14:12:49 -05:00
Tim Neutkens
8cf6ef58f0
Remove unused dev option from babel-loader (#6624) 2019-03-12 15:19:08 +01: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
Joe Haddad
2e32aa8630
Ensure correct key order (#6616)
* Ensure correct key order

* Fix bug

* Format this document while we're at it
2019-03-12 00:01:50 -04:00
JJ Kasper
179d09e8e0
Remove cacheKeys in favor of simply a cacheKey (#6613) 2019-03-11 22:32:26 -05:00
Joe Haddad
f6b7503e55
Sort pages between bundles (#6612) 2019-03-11 17:34:41 -04:00
JJ Kasper
995460d7dd
Replace md4 hashing with murmurhash (#6611) 2019-03-11 16:23:04 -05:00
JJ Kasper
eb0e83cea3 Remove cacache (#6610) 2019-03-11 16:24:07 -04:00
JJ Kasper
988047f0cd
Update/webpack docs example (#6609)
* Show example of using webpack in config
2019-03-11 15:10:45 -05:00
JJ Kasper
553fbf75e0 Add note about passing webpack to config (#6606) 2019-03-11 19:32:26 +01: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
Joe Haddad
041be6f4aa Disable webpack minifier (#6603)
When the webpack `mode` is set to `production`, `minimizer: undefined` means "use the default webpack minifier."

We need to explicitly disable the webpack minifier via `minimize: false`. This should speed up non-serverless builds. 😄 

This doesn't affect dev, but I added the toggle there for consistency.
2019-03-11 15:51:23 +01:00
Tim Neutkens
557fc95910
Don't use webpack multiCompiler for single configuration (#6598)
When compiling the serverless target there is no need for having an array of configs.
2019-03-10 15:46:50 +01:00
Tim Neutkens
8ffcb3f3e7 Don’t load dev plugins for production bootup (#6589)
* Don’t load autodll-webpack-plugin for production bootup

* Only require autodll when client-side compilation is ran

* Try to fix build
2019-03-09 23:27:33 -05:00
Tim Neutkens
e8095c0e2e Remove cjs file (#6590) 2019-03-09 22:34:27 -05:00
Tim Neutkens
dd60199cec
Remove case-sensitive-paths-plugin (#6587)
While this is a nice feature it does filesystem operations to check if the resolved file matches the filesystem.
2019-03-10 01:44:51 +01:00
Connor Davis
f8be040c79 Next minifier cache (#6582)
Changes the name of the cache folder so we can predictably cache on Now
2019-03-09 09:09:44 +01:00