Skip to content

Commit

Permalink
Merge branch 'canary' into update-react-rsc-api
Browse files Browse the repository at this point in the history
  • Loading branch information
ijjk authored Oct 18, 2021
2 parents 2ea895b + 74c5c5b commit 76d02c4
Show file tree
Hide file tree
Showing 19 changed files with 68 additions and 23 deletions.
10 changes: 10 additions & 0 deletions docs/basic-features/eslint.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,16 @@ The `next/core-web-vitals` rule set is enabled when `next lint` is run for the f

ESLint also contains code formatting rules, which can conflict with your existing [Prettier](https://prettier.io/) setup. We recommend including [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) in your ESLint config to make ESLint and Prettier work together.

First, install the dependency:

```bash
npm install --save-dev eslint-config-prettier
# or
yarn add --dev eslint-config-prettier
```

Then, add `prettier` to your existing ESLint config:

```json
{
"extends": ["next", "prettier"]
Expand Down
2 changes: 1 addition & 1 deletion errors/no-cache.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ uses: actions/cache@v2
with:
path: ${{ github.workspace }}/.next/cache
# Generate a new cache whenever packages or source files change.
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**.[jt]sx?') }}
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
# If source files changed but packages didn't, rebuild from a prior cache.
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@
"registry": "https://registry.npmjs.org/"
}
},
"version": "11.1.3-canary.82"
"version": "11.1.3-canary.83"
}
2 changes: 1 addition & 1 deletion packages/create-next-app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "create-next-app",
"version": "11.1.3-canary.82",
"version": "11.1.3-canary.83",
"keywords": [
"react",
"next",
Expand Down
4 changes: 2 additions & 2 deletions packages/eslint-config-next/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eslint-config-next",
"version": "11.1.3-canary.82",
"version": "11.1.3-canary.83",
"description": "ESLint configuration used by NextJS.",
"main": "index.js",
"license": "MIT",
Expand All @@ -9,7 +9,7 @@
"directory": "packages/eslint-config-next"
},
"dependencies": {
"@next/eslint-plugin-next": "11.1.3-canary.82",
"@next/eslint-plugin-next": "11.1.3-canary.83",
"@rushstack/eslint-patch": "^1.0.6",
"@typescript-eslint/parser": "^4.20.0",
"eslint-import-resolver-node": "^0.3.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin-next/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/eslint-plugin-next",
"version": "11.1.3-canary.82",
"version": "11.1.3-canary.83",
"description": "ESLint plugin for NextJS.",
"main": "lib/index.js",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/next-bundle-analyzer/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/bundle-analyzer",
"version": "11.1.3-canary.82",
"version": "11.1.3-canary.83",
"main": "index.js",
"license": "MIT",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/next-codemod/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/codemod",
"version": "11.1.3-canary.82",
"version": "11.1.3-canary.83",
"license": "MIT",
"dependencies": {
"chalk": "4.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/next-env/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/env",
"version": "11.1.3-canary.82",
"version": "11.1.3-canary.83",
"keywords": [
"react",
"next",
Expand Down
2 changes: 1 addition & 1 deletion packages/next-mdx/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/mdx",
"version": "11.1.3-canary.82",
"version": "11.1.3-canary.83",
"main": "index.js",
"license": "MIT",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/next-plugin-storybook/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/plugin-storybook",
"version": "11.1.3-canary.82",
"version": "11.1.3-canary.83",
"repository": {
"url": "vercel/next.js",
"directory": "packages/next-plugin-storybook"
Expand Down
2 changes: 1 addition & 1 deletion packages/next-polyfill-module/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/polyfill-module",
"version": "11.1.3-canary.82",
"version": "11.1.3-canary.83",
"description": "A standard library polyfill for ES Modules supporting browsers (Edge 16+, Firefox 60+, Chrome 61+, Safari 10.1+)",
"main": "dist/polyfill-module.js",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/next-polyfill-nomodule/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/polyfill-nomodule",
"version": "11.1.3-canary.82",
"version": "11.1.3-canary.83",
"description": "A polyfill for non-dead, nomodule browsers.",
"main": "dist/polyfill-nomodule.js",
"license": "MIT",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,11 @@ export class TraceEntryPointsPlugin implements webpack.Plugin {
for (const file of fileList!) {
const reason = reasons!.get(file)

if (!reason || reason.type === 'initial' || !reason.parents) {
if (
!reason ||
!reason.parents ||
(reason.type === 'initial' && reason.parents.size === 0)
) {
continue
}
propagateToParents(reason.parents, file)
Expand Down
12 changes: 6 additions & 6 deletions packages/next/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "next",
"version": "11.1.3-canary.82",
"version": "11.1.3-canary.83",
"description": "The React Framework",
"main": "./dist/server/next.js",
"license": "MIT",
Expand Down Expand Up @@ -66,10 +66,10 @@
"dependencies": {
"@babel/runtime": "7.15.4",
"@hapi/accept": "5.0.2",
"@next/env": "11.1.3-canary.82",
"@next/polyfill-module": "11.1.3-canary.82",
"@next/react-dev-overlay": "11.1.3-canary.82",
"@next/react-refresh-utils": "11.1.3-canary.82",
"@next/env": "11.1.3-canary.83",
"@next/polyfill-module": "11.1.3-canary.83",
"@next/react-dev-overlay": "11.1.3-canary.83",
"@next/react-refresh-utils": "11.1.3-canary.83",
"@node-rs/helper": "1.2.1",
"assert": "2.0.0",
"browserify-zlib": "0.2.0",
Expand Down Expand Up @@ -150,7 +150,7 @@
"@babel/traverse": "7.15.0",
"@babel/types": "7.15.0",
"@napi-rs/cli": "1.1.0",
"@next/polyfill-nomodule": "11.1.3-canary.82",
"@next/polyfill-nomodule": "11.1.3-canary.83",
"@taskr/clear": "1.1.0",
"@taskr/esnext": "1.1.0",
"@taskr/watch": "1.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/react-dev-overlay/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/react-dev-overlay",
"version": "11.1.3-canary.82",
"version": "11.1.3-canary.83",
"description": "A development-only overlay for developing React applications.",
"repository": {
"url": "vercel/next.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/react-refresh-utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/react-refresh-utils",
"version": "11.1.3-canary.82",
"version": "11.1.3-canary.83",
"description": "An experimental package providing utilities for React Refresh.",
"repository": {
"url": "vercel/next.js",
Expand Down
13 changes: 13 additions & 0 deletions test/integration/production/pages/client-error.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import Link from 'next/link'
import Error from 'next/error'

export default function Page(props) {
return (
<>
<Error title="something went wrong (on purpose)" />
<Link href="/">
<a>to home</a>
</Link>
</>
)
}
20 changes: 19 additions & 1 deletion test/integration/production/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ describe('Production Usage', () => {
})

it('should contain generated page count in output', async () => {
const pageCount = 39
const pageCount = 40
expect(output).toContain(`Generating static pages (0/${pageCount})`)
expect(output).toContain(
`Generating static pages (${pageCount}/${pageCount})`
Expand All @@ -79,6 +79,22 @@ describe('Production Usage', () => {
],
notTests: [/node_modules\/react\/cjs\/react\.development\.js/],
},
{
page: '/client-error',
tests: [
/webpack-runtime\.js/,
/chunks\/.*?\.js/,
/node_modules\/react\/index\.js/,
/node_modules\/react\/package\.json/,
/node_modules\/react\/cjs\/react\.production\.min\.js/,
/next\/link\.js/,
/next\/dist\/client\/link\.js/,
/next\/dist\/shared\/lib\/router\/utils\/resolve-rewrites\.js/,
/next\/dist\/pages\/_error\.js/,
/next\/error\.js/,
],
notTests: [/node_modules\/react\/cjs\/react\.development\.js/],
},
{
page: '/dynamic',
tests: [
Expand Down Expand Up @@ -110,6 +126,8 @@ describe('Production Usage', () => {
notTests: [
/node_modules\/react\/cjs\/react\.development\.js/,
/node_modules\/nanoid\/index\.cjs/,
/next\/dist\/pages\/_error\.js/,
/next\/error\.js/,
],
},
{
Expand Down

0 comments on commit 76d02c4

Please sign in to comment.