Commit graph

8490 commits

Author SHA1 Message Date
Tobias Koppers
3a78ccd43f
Add type checking events (#24595)
Will send events like this:

```
[telemetry] {
  "eventName": "NEXT_TYPE_CHECK_COMPLETED",
  "payload": {
    "durationInSeconds": 2,
    "typescriptVersion": "3.8.3",
    "inputFilesCount": 16,
    "totalFilesCount": 289,
    "incremental": false
  }
}
```

## 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-04 08:41:01 +00:00
Lee Robinson
3e6ce9071b
Update font optimization docs to mention opting out. (#24756) 2021-05-03 18:35:10 +00:00
Tobias Koppers
1d643eb6e1
update webpack to 5.36.2, use dependOn (#24656)
* update webpack to 5.36.2
* use dependOn to optimize chunks
* disable vendor splitting for main and _app chunks

=> decreases bundle size in general, gets rid of the 2 extra vendor chunks shared by all pages.

## 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-03 10:25:44 +00:00
Bart Nagel
a77f3845f6
Clarify whether router.pathname includes basePath (#24675)
The docs were vague on this -- `router.asPath` mentions that it doesn't include `basePath` but `router.pathname` didn't say either way.

## Documentation / Examples

- [ ] Make sure the linting passes: I haven't checked; I presume you have a CI bot for this.
2021-05-01 15:56:30 +00:00
JJ Kasper
9c47ca2cfd
v10.2.1-canary.2 2021-04-30 13:27:54 -05:00
Joon Park
c76170e829
Add experimental blurry placeholder to image component (#24153)
This is the image component implementation of the blurry placeholder as described in #24004. The matching server side implementation is currently planned.

## Feature

- [x] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [x] Related issue #18858 
- [x] Integration tests added

(Documentation and telemetry to follow after server side is implemented)
2021-04-30 17:05:03 +00:00
Ishank Sharma
9bbb968c43
Fix/link router 24075 take asPath instead of pathName in router (#24199)
Fixes: #24075

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


## Documentation / Examples

- [x] Make sure the linting passes
2021-04-30 16:34:23 +00:00
Pepijn Senders
d5de1c53c1
Don't swallow MODULE_NOT_FOUND error (#24577)
## Bug

- [x] Related issues linked using [`fixes #24328`](https://github.com/vercel/next.js/pull/24328#issuecomment-828847472)
- [ ] Integration tests added

The change in #24328 will swallow any `MODULE_NOT_FOUND` errors triggered in the page. If you for example have a page with a broken import, it will tell you `Error: Failed to load /whatever`. This of course doesn't really tell people what is going on internally (a broken import). I added a check to see if the error actually happened in the page.
2021-04-30 15:45:25 +00:00
Houssein Djirdeh
e783b0a2e8
Adds ESLint with default rule-set (#23702)
This PR re-includes ESLint with some notable changes, namely a guided setup similar to how TypeScript is instantiated in a Next.js application.

To add ESLint to a project, developers will have to create an `.eslintrc` file in the root of their project or add an empty `eslintConfig` object to their `package.json` file.

```js
touch .eslintrc
```

Then running `next build` will show instructions to install the required packages needed:

<img width="862" alt="Screen Shot 2021-04-19 at 7 38 27 PM" src="https://user-images.githubusercontent.com/12476932/115316182-dfd51b00-a146-11eb-830c-90bad20ed151.png">

Once installed and `next build` is run again, `.eslintrc` will be automatically configured to include the default config:

```json
{
  "extends": "next"
}
```

In addition to this change:

- The feature is now under the experimental flag and requires opt-in. After testing and feedback, it will be switched to the top-level namespace and turned on by default.
- A new ESLint shareable configuration package is included that can be extended in any application with `{ extends: 'next' }`
  - This default config extends recommended rule sets from [`eslint-plugin-react`](https://www.npmjs.com/package/eslint-plugin-react), [`eslint-plugin-react-hooks`](https://www.npmjs.com/package/eslint-plugin-react-hooks), and [`eslint-plugin-next`](https://www.npmjs.com/package/@next/eslint-plugin-next)
- All rules in [`eslint-plugin-next`](https://www.npmjs.com/package/@next/eslint-plugin-next) have been modified to include actionable links that show more information to help resolve each issue
2021-04-30 11:09:07 +00:00
JJ Kasper
49cd08da17
v10.2.1-canary.1 2021-04-29 19:52:43 -05:00
JJ Kasper
01c15c5150
Remove un-used lib files (#24625) 2021-04-29 19:48:39 -05:00
JJ Kasper
f9faf3f96a
v10.2.1-canary.0 2021-04-29 12:55:54 -05:00
JJ Kasper
1e441fe440
Replace regex lexer with minimal regex for named groups (#24604) 2021-04-29 12:50:06 -05:00
Shu Ding
89d2c4e198
Fix Image compatibility issue when using sizes (#24569)
When using `sizes`, [`matchAll`](https://caniuse.com/mdn-javascript_builtins_string_matchall) isn't supported by older browsers like IE and Safari 12. This PR changes it to `exec`.

There're already tests of `sizes` with multiple `vw` values covered.

Fixes #23677.

## 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`
- [ ] 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-04-29 10:07:27 +00:00
Sumanth Ratna
a35dedb7d3
Remove unnecessary optimizeFonts key from type (#24563)
https://github.com/vercel/next.js/pull/21676 moved `fontOptimization` out of the experimental key of `NextConfig` to the top level, so it should be removed from the type

## 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-04-28 22:47:31 +00:00
Lee Robinson
9721374440
Add documentation on Font Optimization. (#24572) 2021-04-28 22:11:05 +00:00
Darsh Patel
2d6b56086e
Fix: with-passport example dependency issue (#24567)
fixes #24401

Simply bumping `swr` to the latest version seems to fix the issue. 🥂 

Couldn't find a consistent pattern across the examples, but most examples are flexible with swr version and use the semver caret.

Very standard use of the useSWR hook is there in the example with nothing obviously version specific.
2021-04-28 19:19:22 +00:00
JJ Kasper
6b97bcea5b
v10.2.0 2021-04-28 09:32:18 -05:00
JJ Kasper
0abbb75b29
v10.1.4-canary.18 2021-04-28 08:58:39 -05:00
Tim Neutkens
b26077bd25
Upgrade postcss (#24546)
Fixes #24421



## Bug

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

Can't add an integration test currently, we'll add Node 16 tests later.

## 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-04-28 13:16:41 +00:00
Tim Neutkens
53c19ff185
Test fixes for Babel mode (#24312)
* Try enabling Babel turbo mode

* Pass config file explicitly to babel turbo loader.

* Update NextBabelLoaderOptions to use `configFile` instead of `babelrc`.

* Re-add support for options passed to next/babel preset with new babel loader.

* Load babel config files depending on their file extension.

* Include `next/babel` if no Babel config is provided.

* Minor cleanup.

* Avoid duplicate `next/babel` entries.

* No need to pass configFile anymore.

* Fix multiple small issues in merging loader opts with cached config.

* Remove redundant logging (that also breaks a test).

* Include file extension CharacteristicsGermaneToCaching.

* bump

* Disable turboMode now that tests pass

Co-authored-by: Dale Bustad <dale@divmain.com>
2021-04-28 11:51:57 +02:00
JJ Kasper
f3d518385c
Remove experimental note for has routes (#24529)
This removes the warnings/notes for the `has` custom-routes feature being experimental

## Documentation / Examples

- [x] Make sure the linting passes
2021-04-28 09:08:38 +00:00
Mario Souto
5de5e49bd5
feat: bump styled-components lib version examples (#24482)
Hi folks I know many people that use that example and it could be using the new version of React to be according with the NextJS v11 

## Documentation / Examples

- [ ] Make sure the linting passes
- [ ] Make sure that the bumped up versions are okay
2021-04-27 17:55:06 +00:00
JJ Kasper
0f2bd4f252
v10.1.4-canary.17 2021-04-27 12:02:08 -05:00
JJ Kasper
efa58efd0c
Ensure stalled CSS triggers fallback navigation (#24488)
This ensures when CSS requests stall that they are included in the route load timeout so that stalled CSS requests don't block us from falling back to a hard navigation. This handles a rare case noticed by @pacocoursey where a transition did not complete while attempting to load CSS assets. 

## Bug

- [ ] Related issues linked using `fixes #number`
- [x] Integration tests added
2021-04-27 07:49:28 +00:00
Janicklas Ralph
fff183c4cd
Font optimization bug fix (#24162)
## Bug

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

Fixes #23896
2021-04-26 18:30:21 +00:00
Jerry K Jia
fc538790ec
Fix: Object Destructuring Error (#24397)
According to the official Next.js documentation on [Environmental Variables](https://nextjs.org/docs/basic-features/environment-variables): 
> `process.env` is not a standard JavaScript object, so you’re not able to use object destructuring. Environment variables must be referenced as e.g. `process.env.NEXT_PUBLIC_PUBLISHABLE_KEY`, not `const { NEXT_PUBLIC_PUBLISHABLE_KEY } = process.env`.

<!--
Thanks for opening a PR! Your contribution is much appreciated.
In order to make sure your PR is handled as smoothly as possible we request that you follow the checklist sections below.
Choose the right checklist for the change that you're making:
-->

## 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-04-26 14:59:37 +00:00
JJ Kasper
cac9ccf9ce
Ensure proxy rewrite does not hang on error (#24394)
* Ensure proxy rewrite does not hang on error

* remove logs

* Listen to req close
2021-04-26 08:40:32 -05:00
Tim Neutkens
cf4ba8d705
Upgrade eslint to the latest version (#24377)
## 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-04-25 18:34:36 +00:00
Allen Hai
08ee60d56e
[next] update initial config message (#23165)
This PR updates the initial typescript config message to mention that strict-mode is off by default to maintain expectations about type errors. 

[Tweet](https://twitter.com/timneutkens/status/1372218890260987904?s=20)
2021-04-25 15:56:37 +00:00
Sam Poder
a6ba432641
Now -> Vercel in api-routes-rest (#24431)
View title :)
2021-04-25 03:06:11 +00:00
Gerald Monaco
29402f3c68
Replace experimental reactMode with reactRoot (#24280)
* Remove reactMode config

* Add config + warning

* Tweak wording on warning

* Tweak wording on warning

* Don't default reactRoot for 10.x

* yak shaving

* Add warning when using old reactMode
2021-04-24 15:19:07 -05:00
Joe Haddad
2743a74b62
v10.1.4-canary.16 2021-04-23 15:23:56 -04:00
Tim Neutkens
a9d2f2f160
Update 3.feature_request.yml 2021-04-23 16:58:44 +02:00
Tim Neutkens
f90461502e
Update 2.example_bug_report.yml 2021-04-23 16:58:29 +02:00
Tim Neutkens
4aa0ba7f7c
Update 1.bug_report.yml 2021-04-23 16:56:46 +02:00
Gerald Monaco
40216be6a8
Workaround for discrete passive effects change (#24369)
This test is failing for the same reason as https://github.com/facebook/react/pull/21173, so we'll borrow their fix, and follow along for updates.
2021-04-23 14:28:59 +00:00
Joe Haddad
079c629165
experimental: remove legacy plugin system (#20759)
* chore: remove old plugins implementation

* chore: remove `onErrorMiddleware`

* Reduce allowed middleware

* remove collect plugins file

* remove old tests

* remove old demo packages
2021-04-22 14:03:13 -05:00
Gerald Monaco
cce82cd7bc
Fix side effects in router-is-ready tests (#24360)
Fixes the [failing react@experimental tests](https://github.com/vercel/next.js/actions/workflows/test_react_experimental.yml).
2021-04-22 17:20:39 +00:00
JJ Kasper
1e9f45931c
v10.1.4-canary.15 2021-04-22 09:51:04 -05:00
Shu Ding
6cd1c87451
Fix not exposing server errors in hot reloader (#24331)
Fixes #24056.

## Bug

- [x] Related issues linked using `fixes #number`
- [x] 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-04-22 11:47:15 +00:00
JJ Kasper
85d87a3795
Ensure dev overlay is triggered for more _app/_document errors (#24328)
This expands on https://github.com/vercel/next.js/issues/24070 and ensures we show the dev overlay for additional cases like where `_app` or `_document` have syntax errors causing compilation to not be able to complete. This achieves showing the dev overlay even when compilation fails from a syntax error by doing a third minimal compilation in development with the needed client-side assets to render the dev overlay. 

## Bug

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

x-ref: https://github.com/vercel/next.js/issues/24070
2021-04-22 11:08:47 +00:00
Jarrod Watts
c481147b86
Update with-aws-amplify-typescript example (#24292)
- Update the Readme to use the latest Amplify CLI versions' prompts
- Update the example to use the [SSR features of AWS Amplify ](https://aws.amazon.com/blogs/mobile/ssr-support-for-aws-amplify-javascript-libraries/)
- Update to use Next version `10` instead of `9`
- Correctly use the types produced by the Amplify CLI in `API.ts`
- Add `amplify auth`  and auth rules to the GraphQL model as suggested by the Amplify CLI.
2021-04-22 10:01:27 +00:00
JJ Kasper
1caa7f4971
Bump next-babel-loader cache key (#24335)
This bumps the babel cache key since we modified the `react-loadable` babel plugin and we don't want any cached versions used since the module names generated in previous cached version won't match the newly expected values. 

x-ref: https://github.com/vercel/next.js/pull/24281 

## 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-04-22 08:26:07 +00:00
Janicklas Ralph
9edb1ef16d
Adding script loader files to package.json (#24326)
Adding script loader files to package.json
2021-04-22 03:35:38 +00:00
Kyle Marshall
a29d8c9eaf
Ensure locale key not duplicated when navigating back to root path with a query or hash value (#24323)
This ensures that a duplicate locale key is not prepended to the path when navigating back (using browsers back button) to the root path containing query parameters or a hash value.

Current behaviour:
* `/fr?value=1` -> `/fr/another` -> click browser back button -> `/fr/fr?value=1`
* `/fr?value=1` -> `/fr?value=2` -> click browser back button -> `/fr/fr?value=1`
* `/fr#section` -> `/fr/another` -> click browser back button -> `/fr/fr#section`
* `/fr#section` -> `/fr#another` -> click browser back button -> `/fr/fr#section`

Fix:
Remove query string or hash value from path before determining whether to add the locale to the path in `addLocale` function.

## Bug

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

Fixes: #24287
2021-04-22 03:06:26 +00:00
Shu Uesugi
2979f30087
Fix strapi links (#24330)
Fix broken links on the `cms-strapi` example.

- [x] https://strapi.io/documentation/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/heroku.html
- [x] 23b184781a/backend/extensions/upload/config/settings.js

## Documentation / Examples

- [x] Make sure the linting passes
2021-04-21 21:58:49 +00:00
Sokratis Vidros
e89a080c46
Fix for with-clerk example (#24324)
## 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

The predev npm script assumes that vercel cli is installed. It's better for the example to run without it.
2021-04-21 19:27:36 +00:00
Sokratis Vidros
dfe1b05ff5
Add Clerk.dev example (#24311)
## 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-04-21 18:59:45 +00:00
JJ Kasper
a0e3198aa0
Add test for top-level _document error (#24313)
This adds an additional test for the change in https://github.com/vercel/next.js/pull/24079 to ensure top-level errors in `_document` are also handled correctly. 

## 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-04-21 15:21:23 +00:00