Skip to content

Commit 5711312

Browse files
authored
Merge branch 'canary' into eslint8
2 parents cb18a61 + abd87a5 commit 5711312

File tree

50 files changed

+431
-314
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+431
-314
lines changed

.eslintrc.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,15 @@
3030
},
3131
"overrides": [
3232
{
33-
"files": ["test/**/*.test.js"],
33+
"files": ["test/**/*.js", "test/**/*.ts", "**/*.test.ts"],
3434
"extends": ["plugin:jest/recommended"],
3535
"rules": {
3636
"jest/expect-expect": "off",
3737
"jest/no-disabled-tests": "off",
3838
"jest/no-conditional-expect": "off",
3939
"jest/valid-title": "off",
40-
"jest/no-interpolation-in-snapshots": "off"
40+
"jest/no-interpolation-in-snapshots": "off",
41+
"jest/no-export": "off"
4142
}
4243
},
4344
{ "files": ["**/__tests__/**"], "env": { "jest": true } },

docs/api-routes/response-helpers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ type ResponseData {
8989
message: string
9090
}
9191

92-
export default function handler(req: NextApiRequest, res: NextApiResponse<ResponseData>) => {
92+
export default function handler(req: NextApiRequest, res: NextApiResponse<ResponseData>) {
9393
res.status(200).json({ message: 'Hello from Next.js!' })
9494
}
9595
```

docs/authentication.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ const Profile = () => {
4848
export default Profile
4949
```
5050

51-
You can view this [example in action](https://next-with-iron-session.vercel.app/). Check out the [`with-iron-session`](https://github.com/vercel/next.js/tree/canary/examples/with-iron-session) example to see how it works.
51+
You can view this [example in action](https://iron-session-example.vercel.app/). Check out the [`with-iron-session`](https://github.com/vercel/next.js/tree/canary/examples/with-iron-session) example to see how it works.
5252

5353
### Authenticating Server-Rendered Pages
5454

@@ -71,10 +71,7 @@ import withSession from '../lib/session'
7171
import Layout from '../components/Layout'
7272

7373
export const getServerSideProps = withSession(async function ({ req, res }) {
74-
// Get the user's session based on the request
75-
const user = req.session.get('user')
76-
77-
if (!user) {
74+
if (!req.session.user) {
7875
return {
7976
redirect: {
8077
destination: '/login',
@@ -119,7 +116,7 @@ Now that we've discussed authentication patterns, let's look at specific provide
119116

120117
If you have an existing database with user data, you'll likely want to utilize an open-source solution that's provider agnostic.
121118

122-
- If you want a low-level, encrypted, and stateless session utility use [`next-iron-session`](https://github.com/vercel/next.js/tree/canary/examples/with-iron-session).
119+
- If you want a low-level, encrypted, and stateless session utility use [`iron-session`](https://github.com/vercel/next.js/tree/canary/examples/with-iron-session).
123120
- If you want a full-featured authentication system with built-in providers (Google, Facebook, GitHub…), JWT, JWE, email/password, magic links and more… use [`next-auth`](https://github.com/nextauthjs/next-auth-example).
124121

125122
Both of these libraries support either authentication pattern. If you're interested in [Passport](http://www.passportjs.org/), we also have examples for it using secure and encrypted cookies:

docs/routing/introduction.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ description: Next.js has a built-in, opinionated, and file-system based Router.
66

77
Next.js has a file-system based router built on the [concept of pages](/docs/basic-features/pages.md).
88

9-
When a file is added to the `pages` directory it's automatically available as a route.
9+
When a file is added to the `pages` directory, it's automatically available as a route.
1010

1111
The files inside the `pages` directory can be used to define most common patterns.
1212

@@ -19,14 +19,14 @@ The router will automatically route files named `index` to the root of the direc
1919

2020
#### Nested routes
2121

22-
The router supports nested files. If you create a nested folder structure files will be automatically routed in the same way still.
22+
The router supports nested files. If you create a nested folder structure, files will automatically be routed in the same way still.
2323

2424
- `pages/blog/first-post.js``/blog/first-post`
2525
- `pages/dashboard/settings/username.js``/dashboard/settings/username`
2626

2727
#### Dynamic route segments
2828

29-
To match a dynamic segment you can use the bracket syntax. This allows you to match named parameters.
29+
To match a dynamic segment, you can use the bracket syntax. This allows you to match named parameters.
3030

3131
- `pages/blog/[slug].js``/blog/:slug` (`/blog/hello-world`)
3232
- `pages/[username]/settings.js``/:username/settings` (`/foo/settings`)
@@ -68,7 +68,7 @@ function Home() {
6868
export default Home
6969
```
7070

71-
In the example above we have multiple links, each one maps a path (`href`) to a known page:
71+
The example above uses multiple links. Each one maps a path (`href`) to a known page:
7272

7373
- `/``pages/index.js`
7474
- `/about``pages/about.js`
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
import { StyleRegistry } from 'styled-jsx'
2+
3+
export const decorators = [
4+
(Story) => (
5+
<StyleRegistry>
6+
<Story />
7+
</StyleRegistry>
8+
),
9+
]
10+
111
export const parameters = {
212
actions: { argTypesRegex: '^on[A-Z].*' },
313
}

examples/with-storybook-styled-jsx-scss/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"build-storybook": "build-storybook --no-dll"
1010
},
1111
"dependencies": {
12-
"next": "^10.0.0",
12+
"next": "latest",
1313
"react": "^17.0.2",
1414
"react-dom": "^17.0.2"
1515
},

lerna.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@
1717
"registry": "https://registry.npmjs.org/"
1818
}
1919
},
20-
"version": "12.0.4-canary.12"
20+
"version": "12.0.4"
2121
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"next-no-sourcemaps": "node --trace-deprecation packages/next/dist/bin/next",
4040
"clean-trace-jaeger": "rm -rf test/integration/basic/.next && TRACE_TARGET=JAEGER node --trace-deprecation --enable-source-maps packages/next/dist/bin/next build test/integration/basic",
4141
"debug": "node --inspect packages/next/dist/bin/next",
42-
"postinstall": "node scripts/install-native.mjs"
42+
"postinstall": "git config feature.manyFiles true && node scripts/install-native.mjs"
4343
},
4444
"pre-commit": "lint-staged",
4545
"devDependencies": {

packages/create-next-app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "create-next-app",
3-
"version": "12.0.4-canary.12",
3+
"version": "12.0.4",
44
"keywords": [
55
"react",
66
"next",

packages/eslint-config-next/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "eslint-config-next",
3-
"version": "12.0.4-canary.12",
3+
"version": "12.0.4",
44
"description": "ESLint configuration used by NextJS.",
55
"main": "index.js",
66
"license": "MIT",
@@ -9,7 +9,7 @@
99
"directory": "packages/eslint-config-next"
1010
},
1111
"dependencies": {
12-
"@next/eslint-plugin-next": "12.0.4-canary.12",
12+
"@next/eslint-plugin-next": "12.0.4",
1313
"@rushstack/eslint-patch": "^1.0.8",
1414
"@typescript-eslint/parser": "^5.0.0",
1515
"eslint-import-resolver-node": "^0.3.4",

0 commit comments

Comments
 (0)