Commit graph

8361 commits

Author SHA1 Message Date
Marius Craciunoiu
64a709db6c
Update docs to reflect page props are optional (#25142)
This PR changes the `GetServerSidePropsResult` type to require that it returns a `props` object. The docs mention it's required even for a redirect/notFound, and it throws and error if it's not returned.

From the docs:

> props - A required object with the props that will be received by the page component. It should be a serializable object

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.

## Documentation / Examples

- [ ] Make sure the linting passes
2021-05-14 16:59:24 +00:00
Tim Neutkens
d9000d073b v10.2.1-canary.7 2021-05-14 16:41:54 +02:00
Tobias Koppers
0750092cf1
add experimental.gzipSize flag which allows to switch to uncompressed sizes (#25028)
Co-authored-by: Tim Neutkens <timneutkens@me.com>
2021-05-14 16:29:49 +02:00
Tim Neutkens
c1528e4f3d
Remove experimental-modern-preset option (#25100) 2021-05-14 15:55:24 +02:00
JJ Kasper
5bff9eac08
Ensure rewrites work with manual href/as correctly (#25112)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-05-14 12:50:41 +02:00
JJ Kasper
e6a05ee940
Fix export worker threads options (#25063)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-05-14 12:50:29 +02:00
Yamagishi Kazutoshi
7f73b65849
Escape href when detecting already existing preload tags (#20782)
When Image Optimization is enabled, if the URL of the image is not correct as a regular expression (e.g. `/image.png?lang=c++`), Next.js will give an error and fail to build.
2021-05-14 02:40:20 +00:00
JJ Kasper
22e3f8c2e7
docs(rewrites.md): update beforeFiles note (#25113)
This updates the beforeFiles rewrites note to mention the rewrites can affect `_next` files which are required for loading pages client-side. 

## Documentation / Examples

- [x] Make sure the linting passes
2021-05-13 18:32:46 +00:00
Tim Neutkens
7cb00b841f
Remove leftover babel include regex (#25101)
This regex is no longer needed since it no longer matches with the strip-ansi version that is bundled with Next.js



## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.

## Documentation / Examples

- [ ] Make sure the linting passes
2021-05-13 17:14:29 +00:00
Rishabh Poddar
8fe30fe49e
Updates SuperTokens dependency version (#25102)
It's a change to the package.json file to update the supertokens-auth-react version. The changes in this version are:
- How supertokens session works in the context of an iframe
- Dependencies of supertokens-auth-react now use a `^`

--------
One more change is to do with how the redirection works in the demo app in case of session expiry or if a user clicks on signout.
2021-05-13 14:50:40 +00:00
Tim Neutkens
7d75bc3ed1 v10.2.1-canary.6 2021-05-13 16:32:33 +02:00
Tim Neutkens
a1e16dc944
Update rewrites doc to mention they are applied to client-side routing (#25099)
Updates an old message in the docs that caused some confusion here: https://github.com/vercel/next.js/issues/24904#issuecomment-837086983

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.

## Documentation / Examples

- [ ] Make sure the linting passes
2021-05-13 14:14:42 +00:00
JJ Kasper
40e178e611
Ensure rewrite does not override params from page in minimal mode (#25074)
This makes sure a catch-all rewrite doesn't override the params from a dynamic route in minimal mode, it also makes sure we don't attempt applying headers and rewrites un-necessarily in minimal mode. 

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
2021-05-13 11:40:25 +00:00
Janicklas Ralph
eaf74c1cb8
Improving script loading strategy (#24939) 2021-05-13 12:39:36 +02:00
Marcos Taron
1cb83c1b35
update create-next-app documentation (#25079)
Update `create-next-app` documentation based in #25010 issue. 


## Documentation / Examples

- [X] Make sure the linting passes
2021-05-13 10:39:21 +00:00
Janicklas Ralph
7b0fe0d73b
Fix no-sync-scripts doc (#25062)
## Bug

Fix no-sync-scripts doc
2021-05-13 10:08:07 +00:00
Tobias Koppers
288984b1ea
enable contenthashing in webpack 5 (#25055)
This improves long term caching by avoiding hash changes

workaround fix #25013 
The real problem is fixed by #24573

## Bug

- [x] Related issues linked using `fixes #number`
- [ ] Integration tests added
2021-05-12 16:33:51 +00:00
Tobias Koppers
5f3351dbb8
use official mini-css-extract-plugin and experimentalUseImportModule (#24573)
## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.

## Documentation / Examples

- [ ] Make sure the linting passes
2021-05-12 16:04:01 +00:00
JJ Kasper
9a0fc42d56
Fix ie11 support with webpack 5 (#25014)
This fixes ie11 compatibility that broke in https://github.com/vercel/next.js/pull/24656 from the polyfills not being loaded first, our existing ie11 test caught this but was failing, this ensures the test is passing again. This also updates the `hrefValue` optional chaining in the eslint plugin as these files aren't transpiled and related tests were failing in azure 

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
2021-05-12 12:24:42 +00:00
Janicklas Ralph
6ad9172295
Font optimization bug fix (#24968) 2021-05-12 13:39:26 +02:00
Janicklas Ralph
b859c5bdf5
Refactor scriptloader option names (#25012) 2021-05-12 13:37:57 +02:00
JJ Kasper
b43e996e3f
Update windows tests to use node 12 (#25015)
Since node v10 is now officially EOL this updates our windows tests to use v12 instead
2021-05-12 10:22:05 +00:00
JJ Kasper
4443d6f3d3
Update has redirect examples (#25003)
This fixes an infinite redirect in the `has` redirect examples by ensuring not to match the redirect destination itself

## Documentation / Examples

- [x] Make sure the linting passes
2021-05-11 17:29:53 +00:00
Tobias Koppers
614f105b0f
allow incremental type checking to use caching (#24992)
emit must be called on build program to leverage caching

While the the current way of calling incremental typescript seem to work, it actually doesn't use caching correct. A difference is only notice-able on larger code bases...
2021-05-11 15:18:31 +00:00
Yamagishi Kazutoshi
f97b82a252
Skip processing when href is not a simple string (#24986) 2021-05-11 16:47:36 +02:00
Alessandro Ursino
2f142b622f
fix typo in path (#24978) 2021-05-11 13:05:03 +02:00
Tim Neutkens
30462ebf2c v10.2.1-canary.5 2021-05-11 09:24:55 +02:00
Evan Ye
030eae17bd
Update with-mdx-remote example (#24973)
Update the with-mdx-remote example based on [next-mdx-remote](https://github.com/hashicorp/next-mdx-remote) v3.0, to make it faster and lighter-weight.

For more detail of API changes and migration guild, please refer to [v3.0.0 release note](https://github.com/hashicorp/next-mdx-remote/releases/tag/3.0.0).
2021-05-11 03:40:48 +00:00
JJ Kasper
e00e3c978d
Ensure webpack cache is invalidated for alias change (#24956) 2021-05-10 17:29:33 -05:00
Houssein Djirdeh
6d0150f02e
ESLint Plugin: Prevent bad imports of next/document and next/head (#24832)
Adds lint rules to the Next.js ESLint plugin to:

- Disallow importing `next/head` inside `pages/_document.js`
- Disallow importing `next/document` outside of `pages/_document.js`

Both rules will be surfaced as **errors** within the recommended config of the plugin.

Fixes #13712 #13958
2021-05-10 21:28:06 +00:00
Henrik Wenz
a18c3c2493
Update with-three-js example (#24857)
## Changes

- Update dependencies
- Use new `useAnimations` hook
- Remove next-transpile-modules in favour of drei
- Refactor Components
- Remove dynamic import
- Enable webpack5 (by removing `next.config.js`)
- Removed missing key warning

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.

## Documentation / Examples

- [x] Make sure the linting passes
2021-05-10 20:23:25 +00:00
Mike Plis
ea9fe972fb
Fix build in blog-starter-typescript example (#24695)
This example currently fails to build with the error:

```
-> % yarn build
yarn run v1.22.10
$ next build
warn  - React 17.0.1 or newer will be required to leverage all of the upcoming features in Next.js 11. Read more: https://nextjs.org/docs/messages/react-version
info  - Using webpack 5. Reason: no next.config.js https://nextjs.org/docs/messages/webpack5
Failed to compile.

./components/alert.tsx:2:16
Type error: Could not find a declaration file for module 'classnames'. '/Users/mike/workspace/blog/node_modules/classnames/index.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/classnames` if it exists or add a new declaration (.d.ts) file containing `declare module 'classnames';`

  1 | import Container from './container'
> 2 | import cn from 'classnames'
    |                ^
  3 | import { EXAMPLE_PATH } from '../lib/constants'
  4 |
  5 | type Props = {
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
```

As of [`v2.3.1`](https://github.com/JedWatson/classnames/blob/master/HISTORY.md#v230--2021-04-01), the `classnames` package started providing its own types, so the `@types/classnames` package [became a stub](https://unpkg.com/browse/@types/classnames@2.3.1/). We get the error because the `classnames` version is pinned to the old, type-less version, while `@types/classnames` picked up the new stubbed version.

Removing `@types/classnames` and updating `classnames` to the latest version fixes the build error.

## Documentation / Examples

- [x] Make sure the linting passes
2021-05-10 19:59:49 +00:00
Houssein Djirdeh
44072205d8
ESLint Plugin: Custom Font at page-level rule (#24789)
Adds a lint rule warning to the Next.js ESLint plugin if a custom Google Font is added at page-level instead of with a custom document (`.document.js`)

_Note: This will be generalized to include more font providers in the near future._
2021-05-10 19:08:14 +00:00
Houssein Djirdeh
569da9d286
ESLint Plugin: passHref is not assigned (#24670)
Adds a lint rule warning to the Next.js ESLint plugin if `passHref=true` is not assigned for `<Link>` wrapping a custom component.

Fixes #23713
2021-05-10 18:35:11 +00:00
Tobias Koppers
2330bf9ddd
update webpack to 5.37.0 (#24954)
fixes a small bug which caused the webpack chunk to be too big as it includes references to all pages

## Bug

- [x] Related issues linked using `fixes #number`
- [ ] Integration tests added

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.

## Documentation / Examples

- [ ] Make sure the linting passes
2021-05-10 17:18:44 +00:00
Tim Neutkens
14eee3d091 Add label for chrome automatically to PR 2021-05-10 18:27:59 +02:00
Tim Neutkens
da97a18daf v10.2.1-canary.4 2021-05-10 14:43:02 +02:00
Luigi Colombi
59564af9cb
I18n context initial props (#21930)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-05-10 14:11:19 +02:00
Tim Neutkens
802a7721e9
Remove outdated/deprecated/unmainted examples (#24945)
## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.

## Documentation / Examples

- [ ] Make sure the linting passes
2021-05-10 11:30:04 +00:00
Darsh Patel
9e87596bd6
Fix: Non-writable pages/_app breaks build (#24849)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-05-10 10:39:18 +02:00
Janicklas Ralph
86827058e4
Refactor experimental-script component (#24940) 2021-05-10 10:39:08 +02:00
Houssein Djirdeh
59d50ff76d
ESLint Plugin: Google Font rules (#24766) 2021-05-10 10:03:28 +02:00
Tim Neutkens
0425763ed6 Match last PR mention in commit message for release notes 2021-05-07 19:53:38 +02:00
Tim Neutkens
8218d5d508 v10.2.1-canary.3 2021-05-07 19:40:20 +02:00
Radosław Grochowski
7f1c8a9bbe
fix: handle compression for custom-server render calls (#16378) (#18891)
Co-authored-by: Radosław Grochowski <radoslaw.grochowski@grupawp.pl>
Co-authored-by: Tim Neutkens <timneutkens@me.com>
2021-05-07 19:37:51 +02:00
JJ Kasper
9d25194e7d
Ensure next/dynamic transpiles for tests (#24751)
Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
2021-05-07 19:21:54 +02:00
Tobias Koppers
4e8fac93fd
cache typechecking with incremental compilation (#24559)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-05-07 19:21:20 +02:00
Tim Neutkens
42c4743fbd
Remove experimental babel flag (#24776) 2021-05-07 19:17:45 +02:00
Tim Neutkens
9506f15afd
Update custom server examples (#24814) 2021-05-07 18:50:56 +02:00
Tobias Koppers
33e09dffb2
webpack 5 externals fixes (#24603)
* fix check in externals that validate if the require is resolve-able for the server
* performance improvements

Fixes #23130

## Bug

- [x] Related issues linked using `fixes #number`
- [ ] Integration tests added

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.

## Documentation / Examples

- [ ] Make sure the linting passes
2021-05-07 16:32:33 +00:00