Skip to content

Commit

Permalink
Merge branch 'canary' of https://github.com/vercel/next.js into koukou
Browse files Browse the repository at this point in the history
  • Loading branch information
11koukou committed Jan 15, 2022
2 parents 12062ac + 67bc262 commit b25f147
Show file tree
Hide file tree
Showing 89 changed files with 1,666 additions and 915 deletions.
30 changes: 0 additions & 30 deletions .github/workflows/build_test_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -347,35 +347,6 @@ jobs:
- run: xvfb-run node run-tests.js test/integration/with-electron/test/index.test.js
if: ${{needs.build.outputs.docsChange != 'docs only change'}}

testYarnPnP:
runs-on: ubuntu-latest
needs: [build, build-native-dev]
env:
NODE_OPTIONS: '--unhandled-rejections=strict'
YARN_COMPRESSION_LEVEL: '0'
steps:
- name: Setup node
uses: actions/setup-node@v2
if: ${{ steps.docs-change.outputs.docsChange != 'docs only change' }}
with:
node-version: 14

- uses: actions/cache@v2
if: ${{needs.build.outputs.docsChange != 'docs only change'}}
id: restore-build
with:
path: ./*
key: ${{ github.sha }}-${{ github.run_number }}-${{ github.run_attempt }}

- uses: actions/download-artifact@v2
if: ${{needs.build.outputs.docsChange != 'docs only change'}}
with:
name: next-swc-dev-binary
path: packages/next-swc/native

- run: bash ./scripts/test-pnp.sh
if: ${{needs.build.outputs.docsChange != 'docs only change'}}

testsPass:
name: thank you, next
runs-on: ubuntu-latest
Expand All @@ -387,7 +358,6 @@ jobs:
checkPrecompiled,
testIntegration,
testUnit,
testYarnPnP,
testDev,
testProd,
]
Expand Down
7 changes: 3 additions & 4 deletions contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@ examples](#adding-examples)** below.

## Developing

The development branch is `canary`, and this is the branch that all pull
requests should be made against. After publishing a stable release, the changes
in the `canary` branch are rebased into `master`. The changes on the `canary`
branch are published to the `@canary` dist-tag daily.
The development branch is `canary`. This is the branch that all pull
requests should be made against. The changes on the `canary`
branch are published to the `@canary` tag on npm regularly.

To develop locally:

Expand Down
56 changes: 56 additions & 0 deletions docs/advanced-features/compiler.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,34 @@ const customJestConfig = {
module.exports = createJestConfig(customJestConfig)
```

### Remove React Properties

Allows to remove JSX properties. This is often used for testing. Similar to `babel-plugin-react-remove-properties`.

To remove properties matching the default regex `^data-test`:

```js
// next.config.js
module.exports = {
experimental: {
reactRemoveProperties: true,
},
}
```

To remove custom properties:

```js
// next.config.js
module.exports = {
experimental: {
// The regexes defined here are processed in Rust so the syntax is different from
// JavaScript `RegExp`s. See https://docs.rs/regex.
reactRemoveProperties: { properties: ['^data-custom$'] },
},
}
```

### Legacy Decorators

Next.js will automatically detect `experimentalDecorators` in `jsconfig.json` or `tsconfig.json` and apply that. This is commonly used with older versions of libraries like `mobx`.
Expand All @@ -110,6 +138,34 @@ First, update to the latest version of Next.js: `npm install next@latest`. Then,
}
```

### Remove Console

This transform allows for removing all `console.*` calls in application code (not `node_modules`). Similar to `babel-plugin-transform-remove-console`.

Remove all `console.*` calls:

```js
// next.config.js
module.exports = {
experimental: {
removeConsole: true,
},
}
```

Remove `console.*` output except `console.error`:

```js
// next.config.js
module.exports = {
experimental: {
removeConsole: {
exclude: ['error'],
},
},
}
```

### importSource

Next.js will automatically detect `jsxImportSource` in `jsconfig.json` or `tsconfig.json` and apply that. This is commonly used with libraries like Theme UI.
Expand Down
2 changes: 1 addition & 1 deletion docs/advanced-features/security-headers.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module.exports = {
return [
{
// Apply these headers to all routes in your application.
source: '/(.*)',
source: '/:path*',
headers: securityHeaders,
},
]
Expand Down
2 changes: 2 additions & 0 deletions docs/api-reference/next/script.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ The loading strategy of the script.

A method that returns additional JavaScript that should be executed after the script has finished loading.

> **Note: `onLoad` can't be used with the `beforeInteractive` loading strategy.**
The following is an example of how to use the `onLoad` property:

```jsx
Expand Down
14 changes: 7 additions & 7 deletions errors/export-image-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@

#### Why This Error Occurred

You are attempting to run `next export` while importing the `next/image` component configured using the default `loader`.
You are attempting to run `next export` while importing the `next/image` component using the default `loader` configuration.

However, the default `loader` relies on the Image Optimization API which is not available for exported applications.

This is because Next.js optimizes images on-demand, as users request them (not at build time).

#### Possible Ways to Fix It

- Use `next start` to run a server, which includes the Image Optimization API.
- Use any provider which supports Image Optimization (like [Vercel](https://vercel.com/docs/next.js/image-optimization)).
- Configure a third-party [loader](https://nextjs.org/docs/basic-features/image-optimization#loader) in `next.config.js`.
- Use the [`loader`](https://nextjs.org/docs/api-reference/next/image#loader) prop for `next/image`.
- Use [`next start`](https://nextjs.org/docs/api-reference/cli#production) to run a server, which includes the Image Optimization API.
- Use any provider which supports Image Optimization (such as [Vercel](https://vercel.com)).
- [Configure the loader](https://nextjs.org/docs/api-reference/next/image#loader-configuration) in `next.config.js`.
- Use the [`loader`](https://nextjs.org/docs/api-reference/next/image#loader) prop for each instance of `next/image`.

### Useful Links

- [Deployment Documentation](https://nextjs.org/docs/deployment#vercel-recommended)
- [Deployment Documentation](https://nextjs.org/docs/deployment#managed-nextjs-with-vercel)
- [Image Optimization Documentation](https://nextjs.org/docs/basic-features/image-optimization)
- [`next export` Documentation](https://nextjs.org/docs/advanced-features/static-html-export)
- [`next/image` Documentation](https://nextjs.org/docs/api-reference/next/image)
- [Vercel Documentation](https://vercel.com/docs/next.js/image-optimization)
- [Vercel Documentation](https://vercel.com/docs/concepts/next.js/image-optimization)
2 changes: 1 addition & 1 deletion examples/blog-starter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"react": "^17.0.2",
"react-dom": "^17.0.2",
"remark": "13.0.0",
"remark-html": "13.0.1"
"remark-html": "13.0.2"
},
"devDependencies": {
"autoprefixer": "^10.4.0",
Expand Down
4 changes: 2 additions & 2 deletions examples/with-supabase-auth-realtime-db/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
},
"dependencies": {
"@supabase/supabase-js": "^1.2.1",
"@supabase/ui": "^0.6.1",
"@supabase/ui": "^0.36.2",
"next": "latest",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"swr": "0.2.3"
"swr": "1.1.2"
}
}
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@
"registry": "https://registry.npmjs.org/"
}
},
"version": "12.0.8"
"version": "12.0.9-canary.0"
}
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": "12.0.8",
"version": "12.0.9-canary.0",
"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": "12.0.8",
"version": "12.0.9-canary.0",
"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": "12.0.8",
"@next/eslint-plugin-next": "12.0.9-canary.0",
"@rushstack/eslint-patch": "^1.0.8",
"@typescript-eslint/parser": "^5.0.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": "12.0.8",
"version": "12.0.9-canary.0",
"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": "12.0.8",
"version": "12.0.9-canary.0",
"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": "12.0.8",
"version": "12.0.9-canary.0",
"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": "12.0.8",
"version": "12.0.9-canary.0",
"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": "12.0.8",
"version": "12.0.9-canary.0",
"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": "12.0.8",
"version": "12.0.9-canary.0",
"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": "12.0.8",
"version": "12.0.9-canary.0",
"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": "12.0.8",
"version": "12.0.9-canary.0",
"description": "A polyfill for non-dead, nomodule browsers.",
"main": "dist/polyfill-nomodule.js",
"license": "MIT",
Expand Down
Loading

0 comments on commit b25f147

Please sign in to comment.