Skip to content

Commit 58598e1

Browse files
leimoniosamrobbins85huozhipetermekhaeilRobVermeer
authored
Add example notion (#1)
* [WIP] Add cms notion integration example - index page * Add cover images for pages * Add post page * Remove preview functionality * Add module.exports to security headers documentation (vercel#26466) Without `module.exports`, the provided code won't work if just pasted into `next.config.js` ## Documentation / Examples - [x] Make sure the linting passes * fix: ignore invalid accept-language header (vercel#26476) Fixes vercel#22329 ## Bug - [x] Related issues linked using fixes vercel#22329 - [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 * chore: Add Alex to lint documentation (vercel#26354) This Pull Request adds [Alex](https://alexjs.com/) to our documentation. It catches insensitive, inconsiderate writing. The original PR (vercel#25821) is too large so I have decided to break it down into smaller PRs. This PR is the first part. Then I will continue to add the rest of the documentation in smaller PRs. ## More Information on Alex: https://alexjs.com/ https://github.com/get-alex/alex ## Documentation / Examples - [x] Make sure the linting passes * Fix domain locales not available on client (vercel#26083) * bug: Fix domain locales not available on client * Add test case * update tests Co-authored-by: JJ Kasper <[email protected]> * Update to only add image import types when enabled (vercel#26485) * Update to only add image import types when enabled * add type check to test * Update i18n fields in docs (vercel#26492) Closes: vercel#24991 ## Documentation / Examples - [x] Make sure the linting passes * v11.0.1-canary.7 * Strongly type `Router.events.on` and `Router.events.off` (vercel#26456) This strongly types `Router.events.on` and `Router.events.off`. Previously the event type was `string` but now it's `'routeChangeStart' | 'beforeHistoryChange' | 'routeChangeComplete' | 'routeChangeError' | 'hashChangeStart' | 'hashChangeComplete'` ## Bug - ~[ ] Related issues linked using `fixes #number`~ - [x] Integration tests added Closes vercel#25679 Closes vercel#23753 Closes vercel#15497 * Update next Link & Image components * Ensure image-types file is included (vercel#26495) * Update react & react-dom to v17 * Update tailwind to use jit * v11.0.1-canary.8 * v11.0.1 * Don't test image domains in test env (vercel#26502) fixes vercel#21549 Co-authored-by: JJ Kasper <[email protected]> * docs: updated minimum Node.js version (vercel#26528) ## Documentation / Examples - [x] Make sure the linting passes According to new requirements in `package.json` minimum Node.js version for now is 12.0 * Update next-env note in docs (vercel#26536) This ensures we don't recommend editing the `next-env` file since we need to be able to tweak it to accept future types we add in Next.js ## Documentation / Examples - [x] Make sure the linting passes Closes: vercel#26533 * [examples] Fix ssr-caching example. (vercel#26540) Closes vercel#12019 with a better example of proper SSR caching. * Fix props not updating when changing the locale and keeping hash (vercel#26205) Currently, there is only a `hashChangeStart` and subsequent `hashChangeComplete` event and no props update (which would be used to get translations, etc.). Happy for any feedback fixes vercel#23467 ## 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 * Add note about adding additional types (vercel#26545) * Add note about adding additional types * Update to bold edit also * Apply suggestions from code review Co-authored-by: Steven <[email protected]> * Allow user to override next-image-loader (vercel#26548) In PR vercel#26281, we solved one use case but broke another. This PR will allow the user to [override the built-in loader](vercel#26281 (comment)) via custom webpack config. * v11.0.2-canary.0 * chore: Enable Alex documentation linting for error pages (vercel#26526) * Update SWR example to include fetcher function. (vercel#26520) * Previous example doesn't work * Apply suggestions from code review * Update docs/basic-features/data-fetching.md * lint-fix Co-authored-by: Lee Robinson <[email protected]> Co-authored-by: JJ Kasper <[email protected]> * tailwind examps upgraded to v2.2 (vercel#26549) ## Documentation / Examples - [x] Make sure the linting passes * doc: prettify docs for next script (vercel#26572) x-ref: vercel#26518 (comment) ## Documentation / Examples - [x] Make sure the linting passes * Add logging when a custom babelrc is loaded (vercel#26570) Partially solves vercel#26539 by adding back the log output when a config file is used ## 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 * Add comment to not edit in next-env file (vercel#26573) This adds a comment to the generated `next-env.d.ts` to mention it should not be edited pointing to the documentation which contains an example of adding custom types separately. x-ref: vercel#26560 ## Documentation / Examples - [x] Make sure the linting passes * Separate node polyfill test from basic suite (vercel#26550) * Separate node polyfill test from basic suite * update test * fix with-loading example for next 11 (vercel#26569) ## Documentation / Examples - [X] Make sure the linting passes This PR updates the with-loading example to follow the documentation of router events for next 11 * v11.0.2-canary.1 * Add trace url on bootup (vercel#26594) * Add trace url on bootup * Update whitelist -> accesslist * Add name to webpack-invalidated * v11.0.2-canary.2 * Add check for ObjectExpression when iterating on <link> tags for font optimization (vercel#26608) Fixes vercel#26547 ## 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 * Enable Alex documentation linting for docs (vercel#26598) * Add link to live demo already hosted (vercel#25718) * Add link to live demo already hosted To make it easier for people to simply see the live example without having to deploy a whole new project * update link Co-authored-by: JJ Kasper <[email protected]> * Update next/image docs for relative parent with layout=fill. (vercel#26615) vercel#18739 (reply in thread) * Fix GSP redirect cache error (vercel#26627) This makes sure we don't attempt flushing cache info to disk for `getStaticProps` `redirect` items with `revalidate` Fixes: vercel#20816 ## Bug - [x] Related issues linked using `fixes #number` - [x] Integration tests added * Correct statusCode when visiting _error directly (vercel#26610) This fixes non-stop reloading when visiting `_error` directly in development caused by the `statusCode` being 200 unexpectedly while HMR returns the page as `invalid` which triggers `on-demand-entries` to reload the page. ## Bug - [x] Related issues linked using `fixes #number` - [x] Integration tests added Fixes: vercel#8036 x-ref: vercel#8033 * fix: next dynamic with jest (vercel#26614) Fixes vercel#19862 Avoid executing `webpack` property on `loadableGenerated` of loadable component compiled from `next/dynamic` when `require.resolveWeak` is unavailable due to jest runtime missing `require.resolveWeak`. ## Bug - [x] Related issues linked using `fixes #number` - [x] unit tests added * Ensure API routes are not available under the locale (vercel#26629) This ensures API routes are not available under the locale path since API routes don't need to be localized and we don't provide the locale to the API in any way currently so the user wouldn't be aware if the localized API route was visited instead of the non-localized. Fixes: vercel#25790 ## Bug - [x] Related issues linked using `fixes #number` - [x] Integration tests added * v11.0.2-canary.3 * Fix image content type octet stream 400 (vercel#26705) Fixes vercel#23523 by adding image content type detection ## Bug - [x] Related issues linked using `fixes #number` - [x] Integration tests added * Update layouts example to persist state across client-side transitions. (vercel#26706) * Update layouts example * Update examples/layout-component/components/layout.js Co-authored-by: JJ Kasper <[email protected]> * Fix typo on "occured" to "occurred" (vercel#26709) * fix: typo occured -> occurred * fix: typo occured -> occurred * fix: typo occured -> occurred * fix: typo occured -> occurred * lint-fix Co-authored-by: JJ Kasper <[email protected]> * [ESLint] Adds --max-warnings flag to `next lint` (vercel#26697) Adds `--max-warnings` flag to `next lint` to enable setting of a maximum warning threshold. Fixes vercel#26671 * update with-redux-toolkit-typescript (vercel#26714) ## Bug - [X] Related issues linked using `fixes vercel#26713 ` ## 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 ## Screenshots After this small change the warning disappears. ![image](https://user-images.githubusercontent.com/47717492/123749377-fd56fb80-d8d2-11eb-8b70-dbb7f6f16050.png) * Simplify `next-dev-server` implementation (vercel#26230) `next-dev-server` having its own implementations of `renderToHTML` and `renderErrorToHTML` has historically made reasoning about streaming hard, as it adds additional places where status codes are explicitly set and the full HTML is blocked on. Instead, this PR simplifies things considerably by moving the majority of the custom logic for e.g. hot reloading and on-demand compilation to when we're resolving the page to be loaded, rather than upfront when handling the request. It also cleans up a few other details (e.g. default error page rendering) that managed to creep into the base implementation over time. One unfortunate side effect is that this makes compilation errors slightly more difficult. Previously, we'd render them directly. Now, we have to rethrow them. But since they've already been logged (by the watch pipeline), we have to make sure they don't get logged again. * Update PR labeler action * Simplify stats action (vercel#26751) * Move code shared between server/client to "shared" folder (vercel#26734) * Move next-server directory files to server directory (vercel#26756) * Move next-server directory files to server directory * Update tests * Update paths in other places * Support new hydrate API in latest react 18 alpha release (vercel#26664) * fix: react 18 new hydration API * support react 18 * compat latest react only, fix resolved version * fix tests * Some changes based on reactwg/react-18#5 * fix test Co-authored-by: Tim Neutkens <[email protected]> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> * Disable build-output size specific tests (vercel#26769) * Disable build-output size specific tests * remove size-limit test * lint-fix * Add upstream `max-age` to optimized image (vercel#26739) This solves the main use case from Issue vercel#19914. Previously, we would set the `Cache-Control` header to a constant and rely on the server cache. This would mean the browser would always request the image and the server could response with 304 Not Modified to omit the response body. This PR changes the behavior such that the `max-age` will propagate from the upstream server to the Next.js Image Optimization Server and allow browser caching. ("upstream" meaning external server or just an internal route to an image) This PR does not change the `max-age` for static imports which will remain `public, max-age=315360000, immutable`. #### Pros: - Fewer HTTP requests after initial browser visit - User configurable `max-age` via the upstream image `Cache-Control` header #### Cons: - ~~Might be annoying for `next dev` when modifying a source image~~ (solved: use `max-age=0` for dev) - Might cause browser to cache longer than expected (up to 2x longer than the server cache if requested in the last second before expiration) ## Bug - [x] Related issues linked using `fixes #number` * Fix blurred image position when using objectPosition (vercel#26590) ## Bug fixes vercel#26309 ## Documentation / Examples see vercel#26309 - [ ] Make sure the linting passes * Update azure tests (vercel#26779) * Stabilize relay-analytics test (vercel#26782) * Leverage blocked page for _error (vercel#26748) ## Enhance simplify detection for visiting `_error` x-ref: vercel#26610 * Update codeowners to add new maintainers (vercel#26770) * examples: fix typo `lunix` → `linux` (vercel#26796) ## 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 * Update repo scripts to separate folder (vercel#26787) * fix: detect loop in client error page (vercel#26567) Co-authored-by: Tobias Koppers <[email protected]> Co-authored-by: Tim Neutkens <[email protected]> * Update snapshot for font-optimization test (vercel#26823) This fixes the `font-optimization` test failing from the links/content changing slightly in the snapshot. ## 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 * Add `onLoadingComplete()` prop to Image component (vercel#26824) This adds a new prop, `onLoadingComplete()`, to handle the most common use case of `ref`. I also added docs and a warning when using `ref` so we recommend the new prop instead. - Fixes vercel#18398 - Fixes vercel#22482 * Add "Vary: Accept" header to /_next/image responses (vercel#26788) This pull request adds "Vary: Accept" header to responses from the image optimizer (i.e. the /_next/image endpoint). The image optimizer prefers re-encoding JPG files to WebP, but some browsers (such as Safari 14 on Catalina) do not yet support WebP. In such cases the optimizer uses the Accept header sent by the browser to send out a JPG response. Thus the optimizer's response may depend on the Accept header. Potential caching proxies can be informed of this fact by adding "Vary: Accept" to the response headers. Otherwise WebP data may be served to browsers that do not support it, for example in the following scenario: * A browser that supports WebP requests the JPG. The optimizer re-encodes it to WebP. The proxy caches the WebP data. * After this another browser that doesn't support WebP requests the JPG. The proxy sends the WebP data to the browser. - [x] Integration tests added - [x] Make sure the linting passes * Fix using-preact example deps (vercel#26821) Fix after vercel#26133 * Add additional tests for image type detection (vercel#26832) Adding additional tests. Follow up to vercel#26705 * Fix immutable header for image with static import & unoptimized (vercel#26836) Fixes vercel#26587 * Update `publish-canary` script to include checkout (vercel#26840) * Update `publish-canary` script to include checkout * Update contrib with publishing section * v11.0.2-canary.4 * Make sure 404 pages do not get cached by a CDN when using next start (vercel#24983) Co-authored-by: Jiachi Liu <[email protected]> Co-authored-by: JJ Kasper <[email protected]> * Update to environment-variable.md (vercel#26863) ## 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 - [x] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. ## Documentation / Examples - [ ] Make sure the linting passes ## Why the change I lost quite a few hours figuring out why my environment variable was `undefined` in the browser. I read about the built-in support and was like: "Oh nice" and didn't read much further. I missed the part about how you need to prefix your variables with `NEXT_PUBLIC_` in order to expose them to the browser. I think a hint to this in the anchor link to that section will make it more discoverable as it's then mentioned near the top and will save people who are like me some time and a headache. * Don't emit duplicate image files (vercel#26843) fixes vercel#26607 This change makes it so the image loader plugin only emits a file while processing an image import for the client. The final generated image URL was already the same in SSR and CSR anyway, so this change doesn't have any functional impact. I also changed the name of the static page in the image component tests, since it was causing some conflicts with the static assets folder. * Add instructions on how to add nextjs.org/docs/messages urls (vercel#26865) Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> * Rename example folder to with-notion * Update references of example * Reorder docs manifest and rename to Script Optimization. (vercel#26874) So there's _conformance_ between the other docs / optimizations. * Fix typo on "occured" to "occurred" (vercel#26876) - Fix typo on "occured" to "occurred" * Update README Co-authored-by: Sam Robbins <[email protected]> Co-authored-by: Jiachi Liu <[email protected]> Co-authored-by: Peter Mekhaeil <[email protected]> Co-authored-by: Rob Vermeer <[email protected]> Co-authored-by: JJ Kasper <[email protected]> Co-authored-by: Brandon Bayer <[email protected]> Co-authored-by: Alex Castle <[email protected]> Co-authored-by: Vitaly Baev <[email protected]> Co-authored-by: Lee Robinson <[email protected]> Co-authored-by: destruc7i0n <[email protected]> Co-authored-by: Steven <[email protected]> Co-authored-by: Joshua Byrd <[email protected]> Co-authored-by: Pranav P <[email protected]> Co-authored-by: Tim Neutkens <[email protected]> Co-authored-by: John <[email protected]> Co-authored-by: Tim Neutkens <[email protected]> Co-authored-by: Vadorequest <[email protected]> Co-authored-by: hiro <[email protected]> Co-authored-by: Houssein Djirdeh <[email protected]> Co-authored-by: Soham Shah <[email protected]> Co-authored-by: Gerald Monaco <[email protected]> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> Co-authored-by: Nils Schönwald <[email protected]> Co-authored-by: D. Kasi Pavan Kumar <[email protected]> Co-authored-by: Tobias Koppers <[email protected]> Co-authored-by: Joachim Viide <[email protected]> Co-authored-by: Artur Sedlukha <[email protected]> Co-authored-by: Paul van den Dool <[email protected]> Co-authored-by: hiro <[email protected]>
1 parent 562640d commit 58598e1

File tree

364 files changed

+4842
-1414
lines changed

Some content is hidden

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

364 files changed

+4842
-1414
lines changed

.alexignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
CODE_OF_CONDUCT.md
2+
examples/

.alexrc

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"allow": [
3+
"attacks",
4+
"color",
5+
"dead",
6+
"execute",
7+
"executed",
8+
"executes",
9+
"execution",
10+
"executions",
11+
"failed",
12+
"failure",
13+
"failures",
14+
"fire",
15+
"fires",
16+
"hook",
17+
"hooks",
18+
"host-hostess",
19+
"invalid"
20+
]
21+
}

.github/CODEOWNERS

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Learn how to add code owners here:
22
# https://help.github.com/en/articles/about-code-owners
33

4-
* @timneutkens @ijjk @lfades @divmain @shuding
5-
/docs/ @timneutkens @ijjk @lfades @divmain @shuding @leerob
6-
/examples/ @timneutkens @ijjk @lfades @divmain @shuding @leerob
4+
* @timneutkens @ijjk @shuding @styfle @huozhi @padmaia
5+
/docs/ @timneutkens @ijjk @shuding @styfle @huozhi @padmaia @leerob @lfades
6+
/examples/ @timneutkens @ijjk @shuding @styfle @huozhi @padmaia @leerob @lfades

.github/labeler.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,22 @@
99
"packages/react-refresh-utils/**",
1010
"packages/next-codemod/**"
1111
],
12-
"type: chrome": [
12+
"created-by: Chrome Aurora": [
1313
{ "type": "user", "pattern": "spanicker" },
1414
{ "type": "user", "pattern": "housseindjirdeh" },
1515
{ "type": "user", "pattern": "devknoll" },
1616
{ "type": "user", "pattern": "janicklas-ralph" },
1717
{ "type": "user", "pattern": "atcastle" },
1818
{ "type": "user", "pattern": "Joonpark13" }
19+
],
20+
"created-by: Next.js team": [
21+
{ "type": "user", "pattern": "ijjk" },
22+
{ "type": "user", "pattern": "padmaia" },
23+
{ "type": "user", "pattern": "huozhi" },
24+
{ "type": "user", "pattern": "shuding" },
25+
{ "type": "user", "pattern": "sokra" },
26+
{ "type": "user", "pattern": "styfle" },
27+
{ "type": "user", "pattern": "timneutkens" }
1928
]
2029
}
2130
}

.github/pull_request_template.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Choose the right checklist for the change that you're making:
88

99
- [ ] Related issues linked using `fixes #number`
1010
- [ ] Integration tests added
11+
- [ ] Errors have helpful link attached, see `contributing.md`
1112

1213
## Feature
1314

@@ -16,6 +17,7 @@ Choose the right checklist for the change that you're making:
1617
- [ ] Integration tests added
1718
- [ ] Documentation added
1819
- [ ] Telemetry added. In case of a feature if it's used or not.
20+
- [ ] Errors have helpful link attached, see `contributing.md`
1921

2022
## Documentation / Examples
2123

.github/workflows/build_test_deploy.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
with:
5656
path: ./*
5757
key: ${{ github.sha }}
58-
- run: ./check-pre-compiled.sh
58+
- run: ./scripts/check-pre-compiled.sh
5959
if: ${{needs.build.outputs.docsChange != 'docs only change'}}
6060

6161
testUnit:
@@ -146,7 +146,7 @@ jobs:
146146
path: ./*
147147
key: ${{ github.sha }}
148148

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

152152
testsPass:
@@ -251,7 +251,7 @@ jobs:
251251
path: ./*
252252
key: ${{ github.sha }}
253253

254-
- run: ./publish-release.sh
254+
- run: ./scripts/publish-release.sh
255255

256256
prStats:
257257
name: Release Stats
@@ -263,7 +263,7 @@ jobs:
263263
with:
264264
path: ./*
265265
key: ${{ github.sha }}
266-
- run: ./release-stats.sh
266+
- run: ./scripts/release-stats.sh
267267
- uses: ./.github/actions/next-stats-action
268268
env:
269269
PR_STATS_COMMENT_TOKEN: ${{ secrets.PR_STATS_COMMENT_TOKEN }}

azure-pipelines.yml

Lines changed: 34 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -111,36 +111,37 @@ stages:
111111
- script: |
112112
node run-tests.js -g 1/1 --timings --azure --type unit
113113
displayName: 'Run tests'
114-
115-
- job: test_chrome_integration
116-
pool:
117-
vmImage: 'windows-2019'
118-
strategy:
119-
matrix:
120-
nodejs-1:
121-
group: 1/4
122-
nodejs-2:
123-
group: 2/4
124-
nodejs-3:
125-
group: 3/4
126-
nodejs-4:
127-
group: 4/4
128-
steps:
129-
- checkout: none
130-
- script: |
131-
wmic datafile where name="C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe" get Version /value
132-
displayName: 'List Chrome version'
133-
- task: NodeTool@0
134-
inputs:
135-
versionSpec: $(node_version)
136-
displayName: 'Install Node.js'
137-
- task: Cache@2
138-
inputs:
139-
# use deterministic cache key that is specific
140-
# to this test run
141-
key: $(Build.SourceVersion)
142-
path: $(System.DefaultWorkingDirectory)
143-
displayName: Cache Build
144-
- script: |
145-
node run-tests.js -g $(group) --timings --azure
146-
displayName: 'Run tests'
114+
# TODO: investigate re-enabling when stability matches running in
115+
# tests in ubuntu environment
116+
# - job: test_chrome_integration
117+
# pool:
118+
# vmImage: 'windows-2019'
119+
# strategy:
120+
# matrix:
121+
# nodejs-1:
122+
# group: 1/4
123+
# nodejs-2:
124+
# group: 2/4
125+
# nodejs-3:
126+
# group: 3/4
127+
# nodejs-4:
128+
# group: 4/4
129+
# steps:
130+
# - checkout: none
131+
# - script: |
132+
# wmic datafile where name="C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe" get Version /value
133+
# displayName: 'List Chrome version'
134+
# - task: NodeTool@0
135+
# inputs:
136+
# versionSpec: $(node_version)
137+
# displayName: 'Install Node.js'
138+
# - task: Cache@2
139+
# inputs:
140+
# # use deterministic cache key that is specific
141+
# # to this test run
142+
# key: $(Build.SourceVersion)
143+
# path: $(System.DefaultWorkingDirectory)
144+
# displayName: Cache Build
145+
# - script: |
146+
# node run-tests.js -g $(group) --timings --azure
147+
# displayName: 'Run tests'

contributing.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,20 @@ Read about our [Commitment to Open Source](https://vercel.com/oss).
1414
1515
To contribute to [our examples](examples), take a look at the [“Adding examples” section](#adding-examples).
1616

17+
## Adding warning/error descriptions
18+
19+
In Next.js we have a system to add helpful links to warnings and errors.
20+
21+
This allows for the logged message to be short while giving a broader description and instructions on how to solve the warning/error.
22+
23+
In general all warnings and errors added should have these links attached.
24+
25+
Below are the steps to add a new link:
26+
27+
- Create a new markdown file under the `errors` directory based on `errors/template.md`: `cp errors/template.md errors/<error-file-name>.md`
28+
- Add the newly added file to `errors/manifest.json`
29+
- Add the following url to your warning/error: `https://nextjs.org/docs/messages/<file-path-without-dotmd>`. For example to link to `errors/api-routes-static-export.md` you use the url: `https://nextjs.org/docs/messages/api-routes-static-export`
30+
1731
## To run tests
1832

1933
Make sure you have `chromedriver` installed for your Chrome version. You can install it with
@@ -46,7 +60,7 @@ Running a specific test suite inside of the `test/integration` directory:
4660
yarn testonly --testPathPattern "production"
4761
```
4862

49-
Running just one test in the `production` test suite:
63+
Running one test in the `production` test suite:
5064

5165
```sh
5266
yarn testonly --testPathPattern "production" -t "should allow etag header support"
@@ -155,3 +169,7 @@ yarn create next-app --example DIRECTORY_NAME DIRECTORY_NAME-app
155169

156170
Deploy it to the cloud with [Vercel](https://vercel.com/new?utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)).
157171
````
172+
173+
## Publishing
174+
175+
Repository maintainers can use `yarn publish-canary` to publish a new version of all packages to npm.

docs/advanced-features/codemods.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ export default withRouter(
169169
)
170170
```
171171

172-
This is just one case. All the cases that are transformed (and tested) can be found in the [`__testfixtures__` directory](https://github.com/vercel/next.js/tree/canary/packages/next-codemod/transforms/__testfixtures__/url-to-withrouter).
172+
This is one case. All the cases that are transformed (and tested) can be found in the [`__testfixtures__` directory](https://github.com/vercel/next.js/tree/canary/packages/next-codemod/transforms/__testfixtures__/url-to-withrouter).
173173

174174
#### Usage
175175

docs/advanced-features/custom-app.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ The `Component` prop is the active `page`, so whenever you navigate between rout
4242

4343
### Caveats
4444

45-
- If your app is running and you just added a custom `App`, you'll need to restart the development server. Only required if `pages/_app.js` didn't exist before.
45+
- If your app is running and you added a custom `App`, you'll need to restart the development server. Only required if `pages/_app.js` didn't exist before.
4646
- Adding a custom `getInitialProps` in your `App` will disable [Automatic Static Optimization](/docs/advanced-features/automatic-static-optimization.md) in pages without [Static Generation](/docs/basic-features/data-fetching.md#getstaticprops-static-generation).
4747
- When you add `getInitialProps` in your custom app, you must `import App from "next/app"`, call `App.getInitialProps(appContext)` inside `getInitialProps` and merge the returned object into the return value.
4848
- `App` currently does not support Next.js [Data Fetching methods](/docs/basic-features/data-fetching.md) like [`getStaticProps`](/docs/basic-features/data-fetching.md#getstaticprops-static-generation) or [`getServerSideProps`](/docs/basic-features/data-fetching.md#getserversideprops-server-side-rendering).

docs/advanced-features/debugging.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ Now hit <kdb>F5</kbd> or select **Debug: Start Debugging** from the Command Pale
6969

7070
Now you can use the [`debugger`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/debugger) statement to pause your backend or frontend code anytime you want to observe and debug your code more precisely.
7171

72-
If you trigger the underlying code by refreshing the current page, clicking on a page link or fetching an API route, your code will be paused and the debugger window will pop up.
72+
If you trigger the underlying code by refreshing the current page, clicking on a page link or fetching an API route, your code will be paused and the debugger window will appear.
7373

7474
To learn more on how to use a JavaScript debugger, take a look at the following documentation:
7575

docs/advanced-features/dynamic-import.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export default function Page() {
4545

4646
You can think of dynamic imports as another way to split your code into manageable chunks.
4747

48-
React components can also be imported using dynamic imports, but in this case we use it in conjunction with `next/dynamic` to make sure it works just like any other React Component. Check out the sections below for more details on how it works.
48+
React components can also be imported using dynamic imports, but in this case we use it in conjunction with `next/dynamic` to make sure it works like any other React Component. Check out the sections below for more details on how it works.
4949

5050
## Basic usage
5151

docs/advanced-features/i18n-routing.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ module.exports = {
5252
{
5353
domain: 'example.fr',
5454
defaultLocale: 'fr',
55+
// an optional http field can also be used to test
56+
// locale domains locally with http instead of https
57+
http: true,
5558
},
5659
],
5760
},

docs/advanced-features/multi-zones.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ With multi zones support, you can merge both these apps into a single one allowi
1818

1919
## How to define a zone
2020

21-
There are no special zones related APIs. You only need to do following:
21+
There are no zone related APIs. You only need to do following:
2222

2323
- Make sure to keep only the pages you need in your app, meaning that an app can't have pages from another app, if app `A` has `/blog` then app `B` shouldn't have it too.
2424
- Make sure to configure a [basePath](/docs/api-reference/next.config.js/basepath.md) to avoid conflicts with pages and static files.

docs/advanced-features/security-headers.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,18 @@ To improve the security of your application, you can use [`headers`](/docs/api-r
1111

1212
// You can choose which headers to add to the list
1313
// after learning more below.
14-
const securityHeaders = [];
15-
16-
async headers() {
17-
return [
18-
{
19-
// Apply these headers to all routes in your application.
20-
source: '/(.*)',
21-
headers: securityHeaders
22-
}
23-
]
14+
const securityHeaders = []
15+
16+
module.exports = {
17+
async headers() {
18+
return [
19+
{
20+
// Apply these headers to all routes in your application.
21+
source: '/(.*)',
22+
headers: securityHeaders,
23+
},
24+
]
25+
},
2426
}
2527
```
2628

docs/advanced-features/static-html-export.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ The exported app supports almost every feature of Next.js, including dynamic rou
1717

1818
`next export` works by prerendering all pages to HTML. For [dynamic routes](/docs/routing/dynamic-routes.md), your page can export a [`getStaticPaths`](/docs/basic-features/data-fetching.md#getstaticpaths-static-generation) function to let the exporter know which HTML pages to generate for that route.
1919

20-
> `next export` is intended for scenarios where **none** of your pages have server-side or incremental data requirements (though statically-rendered pages can still [fetch data on the client side](/docs/basic-features/data-fetching.md#fetching-data-on-the-client-side) just fine).
20+
> `next export` is intended for scenarios where **none** of your pages have server-side or incremental data requirements (though statically-rendered pages can still [fetch data on the client side](/docs/basic-features/data-fetching.md#fetching-data-on-the-client-side)).
2121
>
2222
> If you're looking to make a hybrid site where only _some_ pages are prerendered to static HTML, Next.js already does that automatically for you! Read up on [Automatic Static Optimization](/docs/advanced-features/automatic-static-optimization.md) for details.
2323
>

docs/api-reference/cli.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ NODE_OPTIONS='--inspect' next
4646
- **Size** – The number of assets downloaded when navigating to the page client-side. The size for each route only includes its dependencies.
4747
- **First Load JS** – The number of assets downloaded when visiting the page from the server. The amount of JS shared by all is shown as a separate metric.
4848

49-
The first load is colored green, yellow, or red. Aim for green for performant applications.
49+
The first load is indicated by green, yellow, or red. Aim for green for performant applications.
5050

5151
You can enable production profiling for React with the `--profile` flag in `next build`. This requires [Next.js 9.5](https://nextjs.org/blog/next-9-5):
5252

docs/api-reference/create-next-app.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Create Next.js apps in one command with create-next-app.
44

55
# Create Next App
66

7-
The easiest way to get started with Next.js is by using `create-next-app`. This simple CLI tool enables you to quickly start building a new Next.js application, with everything set up for you. You can create a new app using the default Next.js template, or by using one of the [official Next.js examples](https://github.com/vercel/next.js/tree/canary/examples). To get started, use the following command:
7+
The easiest way to get started with Next.js is by using `create-next-app`. This CLI tool enables you to quickly start building a new Next.js application, with everything set up for you. You can create a new app using the default Next.js template, or by using one of the [official Next.js examples](https://github.com/vercel/next.js/tree/canary/examples). To get started, use the following command:
88

99
```bash
1010
npx create-next-app

docs/api-reference/next.config.js/introduction.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ module.exports = (phase, { defaultConfig }) => {
2626
}
2727
```
2828

29-
`phase` is the current context in which the configuration is loaded. You can see the [available phases](https://github.com/vercel/next.js/blob/canary/packages/next/next-server/lib/constants.ts#L1-L4). Phases can be imported from `next/constants`:
29+
`phase` is the current context in which the configuration is loaded. You can see the [available phases](https://github.com/vercel/next.js/blob/canary/packages/next/shared/lib/constants.ts#L1-L4). Phases can be imported from `next/constants`:
3030

3131
```js
3232
const { PHASE_DEVELOPMENT_SERVER } = require('next/constants')
@@ -44,7 +44,7 @@ module.exports = (phase, { defaultConfig }) => {
4444
}
4545
```
4646

47-
The commented lines are the place where you can put the configs allowed by `next.config.js`, which are [defined in this file](https://github.com/vercel/next.js/blob/canary/packages/next/next-server/server/config-shared.ts#L68).
47+
The commented lines are the place where you can put the configs allowed by `next.config.js`, which are [defined in this file](https://github.com/vercel/next.js/blob/canary/packages/next/server/config-shared.ts#L68).
4848

4949
However, none of the configs are required, and it's not necessary to understand what each config does. Instead, search for the features you need to enable or modify in this section and they will show you what to do.
5050

docs/api-reference/next/image.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ When `responsive`, the image will scale the dimensions down for smaller
102102
viewports and scale up for larger viewports.
103103

104104
When `fill`, the image will stretch both width and height to the dimensions of
105-
the parent element, usually paired with the [`objectFit`](#objectFit) property.
105+
the parent element, provided the parent element is relative. This is usually paired with the [`objectFit`](#objectFit) property.
106106

107107
Try it out:
108108

@@ -195,6 +195,10 @@ The image position when using `layout="fill"`.
195195

196196
[Learn more](https://developer.mozilla.org/en-US/docs/Web/CSS/object-position)
197197

198+
### onLoadingComplete
199+
200+
A callback function that is invoked once the image is completely loaded and the placeholder has been removed.
201+
198202
### loading
199203

200204
> **Attention**: This property is only meant for advanced usage. Switching an
@@ -242,6 +246,7 @@ Other properties on the `<Image />` component will be passed to the underlying
242246
- `srcSet`. Use
243247
[Device Sizes](/docs/basic-features/image-optimization.md#device-sizes)
244248
instead.
249+
- `ref`. Use [`onLoadingComplete`](#onloadingcomplete) instead.
245250
- `decoding`. It is always `"async"`.
246251

247252
## Related

docs/api-reference/next/link.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export default Home
6565

6666
## If the route has dynamic segments
6767

68-
There is nothing special to do when linking to a [dynamic route](/docs/routing/dynamic-routes.md), including [catch all routes](/docs/routing/dynamic-routes.md#catch-all-routes), since Next.js 9.5.3 (for older versions check our [previous docs](https://nextjs.org/docs/tag/v9.5.2/api-reference/next/link#dynamic-routes)). However, it can become quite common and handy to use [interpolation](/docs/routing/introduction.md#linking-to-dynamic-paths) or an [URL Object](#with-url-object) to generate the link.
68+
There is nothing to do when linking to a [dynamic route](/docs/routing/dynamic-routes.md), including [catch all routes](/docs/routing/dynamic-routes.md#catch-all-routes), since Next.js 9.5.3 (for older versions check our [previous docs](https://nextjs.org/docs/tag/v9.5.2/api-reference/next/link#dynamic-routes)). However, it can become quite common and handy to use [interpolation](/docs/routing/introduction.md#linking-to-dynamic-paths) or an [URL Object](#with-url-object) to generate the link.
6969

7070
For example, the dynamic route `pages/blog/[slug].js` will match the following link:
7171

0 commit comments

Comments
 (0)