language stringclasses 1
value | owner stringlengths 2 15 | repo stringlengths 2 21 | sha stringlengths 45 45 | message stringlengths 7 36.3k | path stringlengths 1 199 | patch stringlengths 15 102k | is_multipart bool 2
classes |
|---|---|---|---|---|---|---|---|
Other | vercel | next.js | e72ac7642235d37891deba08fdad31e9963f164c.json | Remove tslint disables (#16116)
We no longer use tslint so these comments don't do anything. | packages/next/types/webpack.d.ts | @@ -600,7 +600,6 @@ declare module 'webpack' {
type Rule = RuleSetRule
namespace Options {
- // tslint:disable-next-line:max-line-length
type Devtool =
| 'eval'
| 'inline-source-map'
@@ -869,13 +868,10 @@ declare module 'webpack' {
modulesSize(): number
size(o... | true |
Other | vercel | next.js | 16345f631e380afa836c12e4918ad4ea68fb4e7d.json | Add codemod documentation (#16067)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> | docs/advanced-features/codemods.md | @@ -0,0 +1,149 @@
+---
+description: Use codemods to update your codebase when upgrading Next.js to the latest version
+---
+
+# Next.js Codemods
+
+Next.js provides Codemod transformations to help upgrade your Next.js codebase when a feature is deprecated.
+
+Codemods are transformations that run on your codebase prog... | true |
Other | vercel | next.js | 16345f631e380afa836c12e4918ad4ea68fb4e7d.json | Add codemod documentation (#16067)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> | docs/manifest.json | @@ -176,6 +176,10 @@
{
"title": "Debugging",
"path": "/docs/advanced-features/debugging.md"
+ },
+ {
+ "title": "Codemods",
+ "path": "/docs/advanced-features/codemods.md"
}
]
}, | true |
Other | vercel | next.js | 16345f631e380afa836c12e4918ad4ea68fb4e7d.json | Add codemod documentation (#16067)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> | packages/next-codemod/README.md | @@ -1,171 +1,9 @@
-# Next.js Codemod
+# Next.js Codemods
-This repository contains Codemod transformations to help upgrade Next.js codebases.
+Next.js provides Codemod transformations to help upgrade your Next.js codebase when a feature is deprecated.
-## v9
+Codemods are transformations that run on your codebase p... | true |
Other | vercel | next.js | d6ad0d084308c6c11aadf87164f7b9f04fc8b017.json | upgrade @ampproject/toolbox-optimizer to 2.6.0 (#16043)
See [release notes](https://github.com/ampproject/amp-toolbox/releases/tag/v2.6.0).
**Highlight:** [hero images can now be server-side rendered](https://github.com/ampproject/amp-toolbox/tree/main/packages/optimizer#preloadheroimage) by annotating then with `dat... | packages/next/package.json | @@ -58,7 +58,7 @@
]
},
"dependencies": {
- "@ampproject/toolbox-optimizer": "2.5.14",
+ "@ampproject/toolbox-optimizer": "2.6.0",
"@babel/code-frame": "7.8.3",
"@babel/core": "7.7.7",
"@babel/plugin-proposal-class-properties": "7.8.3", | true |
Other | vercel | next.js | d6ad0d084308c6c11aadf87164f7b9f04fc8b017.json | upgrade @ampproject/toolbox-optimizer to 2.6.0 (#16043)
See [release notes](https://github.com/ampproject/amp-toolbox/releases/tag/v2.6.0).
**Highlight:** [hero images can now be server-side rendered](https://github.com/ampproject/amp-toolbox/tree/main/packages/optimizer#preloadheroimage) by annotating then with `dat... | yarn.lock | @@ -2,43 +2,44 @@
# yarn lockfile v1
-"@ampproject/toolbox-core@^2.5.4":
- version "2.5.4"
- resolved "https://registry.yarnpkg.com/@ampproject/toolbox-core/-/toolbox-core-2.5.4.tgz#8554c5398b6d65d240085a6b0abb94f9a3276dce"
- integrity sha512-KjHyR0XpQyloTu59IaatU2NCGT5zOhWJtVXQ4Uj/NUaRriN6LlJlzHBxtXmPIb0YHETdD... | true |
Other | vercel | next.js | 89c5689dc978d1987b7bac861fcc03db43a97212.json | Update labeler to include next-codemod (#16041) | .github/labeler.json | @@ -6,7 +6,8 @@
"type: next": [
"packages/next/**",
"packages/react-dev-overlay/**",
- "packages/react-refresh-utils/**"
+ "packages/react-refresh-utils/**",
+ "packages/next-codemod/**"
]
}
} | false |
Other | vercel | next.js | 7acfd7eea7cc06b622704b66c3a5ac3e6b141e97.json | Add files array to @next/codemod (#16049) | packages/next-codemod/package.json | @@ -11,9 +11,13 @@
"jscodeshift": "^0.6.4",
"meow": "7.0.1"
},
+ "files": [
+ "transforms/*.js",
+ "bin/*.js"
+ ],
"scripts": {
- "prepublish": "tsc -d -p tsconfig.json",
- "build": "tsc -d -w -p tsconfig.json",
+ "prepublish": "yarn tsc -d -p tsconfig.json",
+ "build": "yarn tsc -d ... | false |
Other | vercel | next.js | 06d0ba41991185b4dbdc24b0976b60462fe35311.json | Fix typos in @next/codemod CLI (#16042) | packages/next-codemod/bin/cli.ts | @@ -35,7 +35,7 @@ function checkGitStatus(force) {
if (force) {
console.log(`WARNING: ${errorMessage}. Forcibly continuing.`)
} else {
- console.log('Thank you for using react-codemods!')
+ console.log('Thank you for using @next/codemod!')
console.log(
chalk.yellow(
... | false |
Other | vercel | next.js | d1701091b892a392faebe0806be14c25ad75f708.json | Add cli for @next/codemod (#16039)
Largely based on the code @threepointone wrote for react-codemod.
Co-Authored-By: Sunil Pai <threepointone@gmail.com>
Co-authored-by: Sunil Pai <threepointone@gmail.com> | packages/next-codemod/bin/cli.ts | @@ -0,0 +1,208 @@
+/**
+ * Copyright 2015-present, Facebook, Inc.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ *
+ */
+// Based on https://github.com/reactjs/react-codemod/blob/dd8671c9a470a2c342b221ec903c574cf31e9f57/bin/cli.js
+/... | true |
Other | vercel | next.js | d1701091b892a392faebe0806be14c25ad75f708.json | Add cli for @next/codemod (#16039)
Largely based on the code @threepointone wrote for react-codemod.
Co-Authored-By: Sunil Pai <threepointone@gmail.com>
Co-authored-by: Sunil Pai <threepointone@gmail.com> | packages/next-codemod/bin/next-codemod.ts | @@ -0,0 +1,13 @@
+#!/usr/bin/env node
+
+/**
+ * Copyright 2015-present, Facebook, Inc.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ *
+ */
+// Based on https://github.com/reactjs/react-codemod/blob/dd8671c9a470a2c342b221ec903c574c... | true |
Other | vercel | next.js | d1701091b892a392faebe0806be14c25ad75f708.json | Add cli for @next/codemod (#16039)
Largely based on the code @threepointone wrote for react-codemod.
Co-Authored-By: Sunil Pai <threepointone@gmail.com>
Co-authored-by: Sunil Pai <threepointone@gmail.com> | packages/next-codemod/package.json | @@ -3,11 +3,18 @@
"version": "9.5.2-canary.11",
"license": "MIT",
"dependencies": {
- "jscodeshift": "^0.6.4"
+ "chalk": "4.1.0",
+ "execa": "4.0.3",
+ "globby": "11.0.1",
+ "inquirer": "7.3.3",
+ "is-git-clean": "1.1.0",
+ "jscodeshift": "^0.6.4",
+ "meow": "7.0.1"
},
"scripts": ... | true |
Other | vercel | next.js | d1701091b892a392faebe0806be14c25ad75f708.json | Add cli for @next/codemod (#16039)
Largely based on the code @threepointone wrote for react-codemod.
Co-Authored-By: Sunil Pai <threepointone@gmail.com>
Co-authored-by: Sunil Pai <threepointone@gmail.com> | yarn.lock | @@ -3090,10 +3090,31 @@
call-me-maybe "^1.0.1"
glob-to-regexp "^0.3.0"
+"@nodelib/fs.scandir@2.1.3":
+ version "2.1.3"
+ resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.3.tgz#3a582bdb53804c6ba6d146579c46e52130cf4a3b"
+ integrity sha512-eGmwYQn3gxo4r7jdQnkrrN6bY478C3P+a/y72IJuk... | true |
Other | vercel | next.js | 37d2d15b6e8f8441c4922ce7742e1fca846892c6.json | Resolve aliases modules (#16033)
Co-authored-by: Kristoffer K. <merceyz@users.noreply.github.com> | packages/next/build/webpack-config.ts | @@ -359,11 +359,11 @@ export default async function getBaseWebpackConfig(
...(isServer
? {}
: {
- stream: 'stream-browserify',
- path: 'path-browserify',
- crypto: 'crypto-browserify',
- buffer: 'buffer',
- vm: 'vm-browserify',
+ ... | false |
Other | vercel | next.js | eb4be226fd6789c4a90ba8a9291c370ceb984158.json | notify component when route hash changes (#13894)
This resolves https://github.com/vercel/next.js/issues/13659 | packages/next/next-server/lib/router/router.ts | @@ -488,6 +488,7 @@ export default class Router implements BaseRouter {
Router.events.emit('hashChangeStart', as)
this.changeState(method, url, as, options)
this.scrollToHash(cleanedAs)
+ this.notify(this.components[this.route])
Router.events.emit('hashChangeComplete', as)
return... | true |
Other | vercel | next.js | eb4be226fd6789c4a90ba8a9291c370ceb984158.json | notify component when route hash changes (#13894)
This resolves https://github.com/vercel/next.js/issues/13659 | test/integration/client-navigation/pages/nav/hash-changes.js | @@ -1,53 +1,58 @@
-import React, { Component } from 'react'
+import React from 'react'
import Link from 'next/link'
+import { useRouter } from 'next/router'
let count = 0
-export default class SelfReload extends Component {
- static getInitialProps({ res }) {
- if (res) return { count: 0 }
- count += 1
+co... | true |
Other | vercel | next.js | eb4be226fd6789c4a90ba8a9291c370ceb984158.json | notify component when route hash changes (#13894)
This resolves https://github.com/vercel/next.js/issues/13659 | test/integration/client-navigation/test/index.test.js | @@ -497,8 +497,6 @@ describe('Client Navigation', () => {
.click()
.eval('window.pageYOffset')
- console.log(scrollPosition)
-
expect(scrollPosition).toBe(16258)
// Scrolls back to top when scrolling to `#` with no value.
@@ -534,6 +532,22 @@ describe('Client... | true |
Other | vercel | next.js | 3922fa0584ff481f15cd1b4de689967df88159b5.json | with-react-native-web: move meta viewport to _app.js (#15945) | examples/with-react-native-web/pages/_app.js | @@ -0,0 +1,15 @@
+import * as React from 'react'
+import Head from 'next/head'
+
+function MyApp({ Component, pageProps }) {
+ return (
+ <>
+ <Head>
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
+ </Head>
+ <Component {...pageProps} />
+ </>
+ )
+}
+
+export def... | true |
Other | vercel | next.js | 3922fa0584ff481f15cd1b4de689967df88159b5.json | with-react-native-web: move meta viewport to _app.js (#15945) | examples/with-react-native-web/pages/_document.js | @@ -26,9 +26,7 @@ export default class MyDocument extends Document {
render() {
return (
<html style={{ height: '100%' }}>
- <Head>
- <meta name="viewport" content="width=device-width, initial-scale=1" />
- </Head>
+ <Head />
<body style={{ height: '100%', overflow:... | true |
Other | vercel | next.js | e18f74fe2de0672e372aa6425b6b6313a23b91fa.json | Update Fast Refresh doc (#15923)
Co-authored-by: Luis Alvarez D <luis@vercel.com>
Co-authored-by: Tim Neutkens <timneutkens@me.com>
Co-authored-by: Joe Haddad <timer150@gmail.com> | docs/basic-features/fast-refresh.md | @@ -105,6 +105,8 @@ screen!
Sometimes, this can lead to unexpected results. For example, even a `useEffect`
with an empty array of dependencies would still re-run once during Fast Refresh.
-However, writing code resilient to occasional re-running of `useEffect` is a
-good practice even without Fast Refresh. This ma... | false |
Other | vercel | next.js | cbfb8cbcc7b705892dc71e5cf26e870f76cdcc8a.json | Remove querystring from the client (#15378) | packages/next/client/index.js | @@ -1,6 +1,6 @@
/* global location */
import { createRouter, makePublicRouterInstance } from 'next/router'
-import { parse as parseQs, stringify as stringifyQs } from 'querystring'
+import * as querystring from '../next-server/lib/router/utils/querystring'
import React from 'react'
import ReactDOM from 'react-dom'
... | true |
Other | vercel | next.js | cbfb8cbcc7b705892dc71e5cf26e870f76cdcc8a.json | Remove querystring from the client (#15378) | packages/next/client/page-loader.js | @@ -2,7 +2,7 @@ import mitt from '../next-server/lib/mitt'
import { isDynamicRoute } from './../next-server/lib/router/utils/is-dynamic'
import { getRouteMatcher } from './../next-server/lib/router/utils/route-matcher'
import { getRouteRegex } from './../next-server/lib/router/utils/route-regex'
-import { searchPara... | true |
Other | vercel | next.js | cbfb8cbcc7b705892dc71e5cf26e870f76cdcc8a.json | Remove querystring from the client (#15378) | packages/next/next-server/lib/router/router.ts | @@ -16,7 +16,7 @@ import {
import { isDynamicRoute } from './utils/is-dynamic'
import { getRouteMatcher } from './utils/route-matcher'
import { getRouteRegex } from './utils/route-regex'
-import { searchParamsToUrlQuery } from './utils/search-params-to-url-query'
+import { searchParamsToUrlQuery } from './utils/quer... | true |
Other | vercel | next.js | cbfb8cbcc7b705892dc71e5cf26e870f76cdcc8a.json | Remove querystring from the client (#15378) | packages/next/next-server/lib/router/utils/format-url.ts | @@ -21,7 +21,8 @@
// USE OR OTHER DEALINGS IN THE SOFTWARE.
import { UrlObject } from 'url'
-import { encode as encodeQuerystring } from 'querystring'
+import { ParsedUrlQuery } from 'querystring'
+import * as querystring from './querystring'
const slashedProtocols = /https?|ftp|gopher|file/
@@ -45,8 +46,7 @@ ... | true |
Other | vercel | next.js | cbfb8cbcc7b705892dc71e5cf26e870f76cdcc8a.json | Remove querystring from the client (#15378) | packages/next/next-server/lib/router/utils/querystring.ts | @@ -0,0 +1,42 @@
+import { ParsedUrlQuery } from 'querystring'
+
+export function searchParamsToUrlQuery(
+ searchParams: URLSearchParams
+): ParsedUrlQuery {
+ const query: ParsedUrlQuery = {}
+ searchParams.forEach((value, key) => {
+ if (typeof query[key] === 'undefined') {
+ query[key] = value
+ } els... | true |
Other | vercel | next.js | cbfb8cbcc7b705892dc71e5cf26e870f76cdcc8a.json | Remove querystring from the client (#15378) | packages/next/next-server/lib/router/utils/search-params-to-url-query.ts | @@ -1,17 +0,0 @@
-import { ParsedUrlQuery } from 'querystring'
-
-export function searchParamsToUrlQuery(
- searchParams: URLSearchParams
-): ParsedUrlQuery {
- const query: ParsedUrlQuery = {}
- searchParams.forEach((value, key) => {
- if (typeof query[key] === 'undefined') {
- query[key] = value
- } els... | true |
Other | vercel | next.js | c86466f4ee13817c190f6bbe34ee70bb96508261.json | Add variable expansion note (#15917)
Co-authored-by: JJ Kasper <jj@jjsweb.site> | docs/basic-features/environment-variables.md | @@ -46,6 +46,27 @@ export async function getStaticProps() {
}
```
+> **Note**: Next.js will automatically expand variables (`$VAR`) inside of your `.env*` files.
+> This allows you to reference other secrets, like so:
+>
+> ```bash
+> # .env
+> HOSTNAME=localhost
+> PORT=8080
+> HOST=http://$HOSTNAME:$PORT
+> ```
+... | false |
Other | vercel | next.js | 2c424446b80ff503a6c5853f6a3b42d03acf1abc.json | fix typo in export-all-in-page (#15925) | errors/export-all-in-page.md | @@ -29,7 +29,7 @@ export function getStaticProps() {
export * from './one'
```
-Would cause cause the following error:
+Would cause the following error:
```
Module not found: Can't resolve 'fs' in './pages/two.js' | false |
Other | vercel | next.js | f74ee78c3d180e0c1cb5073326a1dfdf1b879097.json | Add trace file for "next dev" (#29633)
Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com> | packages/next/build/index.ts | @@ -132,6 +132,7 @@ export default async function build(
.traceChild('load-next-config')
.traceAsyncFn(() => loadConfig(PHASE_PRODUCTION_BUILD, dir, conf))
const distDir = path.join(dir, config.distDir)
+ setGlobal('phase', PHASE_PRODUCTION_BUILD)
setGlobal('distDir', distDir)
const { ... | true |
Other | vercel | next.js | f74ee78c3d180e0c1cb5073326a1dfdf1b879097.json | Add trace file for "next dev" (#29633)
Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com> | packages/next/server/dev/next-dev-server.ts | @@ -286,6 +286,8 @@ export default class DevServer extends Server {
}
async prepare(): Promise<void> {
+ setGlobal('distDir', this.distDir)
+ setGlobal('phase', PHASE_DEVELOPMENT_SERVER)
await verifyTypeScriptSetup(
this.dir,
this.pagesDir!, | true |
Other | vercel | next.js | f74ee78c3d180e0c1cb5073326a1dfdf1b879097.json | Add trace file for "next dev" (#29633)
Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com> | packages/next/trace/report/to-json.ts | @@ -3,11 +3,64 @@ import { batcher } from './to-zipkin'
import { traceGlobals } from '../shared'
import fs from 'fs'
import path from 'path'
+import { PHASE_DEVELOPMENT_SERVER } from '../../shared/lib/constants'
-let writeStream: fs.WriteStream
+let writeStream: RotatingWriteStream
let traceId: string
let batch:... | true |
Other | vercel | next.js | a9ad8cbbd92ba73ae13e4b28d9851f3e240f960a.json | Update permanent redirect field documentation (#29557)
This explains what the permanent field does a bit more for redirects.
## Documentation / Examples
- [x] Make sure the linting passes
x-ref: https://github.com/vercel/next.js/discussions/29556 | docs/api-reference/next.config.js/redirects.md | @@ -45,7 +45,7 @@ module.exports = {
- `source` is the incoming request path pattern.
- `destination` is the path you want to route to.
-- `permanent` if the redirect is permanent or not.
+- `permanent` `true` or `false` - if `true` will use the 308 status code which instructs clients/search engines to cache the re... | false |
Other | vercel | next.js | a8d8480164b405b68795ee12c5cf1abd1493bb4a.json | Update version @babel/runtime (#29458)
* Update version @babel/runtime
* update fix version @babel/runtime
* update yarn.lock | packages/next/package.json | @@ -64,7 +64,7 @@
]
},
"dependencies": {
- "@babel/runtime": "7.15.3",
+ "@babel/runtime": "7.15.4",
"@hapi/accept": "5.0.2",
"@next/env": "11.1.3-canary.41",
"@next/polyfill-module": "11.1.3-canary.41", | true |
Other | vercel | next.js | a8d8480164b405b68795ee12c5cf1abd1493bb4a.json | Update version @babel/runtime (#29458)
* Update version @babel/runtime
* update fix version @babel/runtime
* update yarn.lock | yarn.lock | @@ -2174,10 +2174,10 @@
core-js-pure "^3.0.0"
regenerator-runtime "^0.13.4"
-"@babel/runtime@7.15.3":
- version "7.15.3"
- resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.15.3.tgz#2e1c2880ca118e5b2f9988322bd8a7656a32502b"
- integrity sha512-OvwMLqNXkCXSz1kSm58sEsNuhqOx/fKpnUnKnFB5v8uDda... | true |
Other | vercel | next.js | d8bb022e9c872e8d486545cf878ab5ece372f16a.json | Add page mapping for Server Components (#29508)
* Add page mapping for Server Components
* Transform client components too
* Refactor and add to on-demand-entry-handler too
* Simplify implementation via pageExtensions
* Fix up errors | packages/next/server/config-shared.ts | @@ -144,6 +144,7 @@ export type NextConfig = { [key: string]: any } & {
isrMemoryCacheSize?: number
outputFileTracing?: boolean
concurrentFeatures?: boolean
+ serverComponents?: boolean
}
}
@@ -225,6 +226,7 @@ export const defaultConfig: NextConfig = {
isrMemoryCacheSize: 50 * 1024 * 1024,
... | true |
Other | vercel | next.js | d8bb022e9c872e8d486545cf878ab5ece372f16a.json | Add page mapping for Server Components (#29508)
* Add page mapping for Server Components
* Transform client components too
* Refactor and add to on-demand-entry-handler too
* Simplify implementation via pageExtensions
* Fix up errors | packages/next/server/config.ts | @@ -462,6 +462,16 @@ function assignDefaults(userConfig: { [key: string]: any }) {
}
}
+ if (result.experimental?.serverComponents) {
+ const pageExtensions: string[] = []
+ ;(result.pageExtensions || []).forEach((ext) => {
+ pageExtensions.push(ext)
+ pageExtensions.push(`server.${ext}`)
+ ... | true |
Other | vercel | next.js | 7cdce8fdddeb308d51ff193e670d6cf59e184e90.json | Add id to inline gtag script (#29530)
## Documentation / Examples
- [x] Make sure the linting passes | examples/with-google-analytics/pages/_app.js | @@ -23,6 +23,7 @@ const App = ({ Component, pageProps }) => {
src={`https://www.googletagmanager.com/gtag/js?id=${gtag.GA_TRACKING_ID}`}
/>
<Script
+ id="gtag-init"
strategy="afterInteractive"
dangerouslySetInnerHTML={{
__html: ` | false |
Other | vercel | next.js | 8ee612781295869a58a2f6b84cb8a9000f996d81.json | Update resolve options for nft (#29524)
Follow-up to https://github.com/vercel/next.js/pull/29473 after additional testing it seems we need to ensure the `main` field is used when tracing packages during builds so that `module` isn't being used unexpectedly. | packages/next/build/webpack/plugins/next-trace-entrypoints-plugin.ts | @@ -9,6 +9,7 @@ import {
isWebpack5,
sources,
} from 'next/dist/compiled/webpack/webpack'
+import { NODE_RESOLVE_OPTIONS } from '../../webpack-config'
const PLUGIN_NAME = 'TraceEntryPointsPlugin'
const TRACE_IGNORES = [
@@ -352,7 +353,12 @@ export class TraceEntryPointsPlugin implements webpack.Plugin {
... | false |
Other | vercel | next.js | 38ac55dd205e36b4b01901566127be1a8892946b.json | Update output tracing resolving (#29473) | .gitignore | @@ -23,6 +23,7 @@ test/**/out*
test/**/next-env.d.ts
.DS_Store
/e2e-tests
+test/tmp/**
# Editors
**/.idea | true |
Other | vercel | next.js | 38ac55dd205e36b4b01901566127be1a8892946b.json | Update output tracing resolving (#29473) | packages/next/build/webpack-config.ts | @@ -1296,7 +1296,6 @@ export default async function getBaseWebpackConfig(
isWebpack5 &&
new TraceEntryPointsPlugin({
appDir: dir,
- esmExternals: config.experimental.esmExternals,
}),
// Moment.js is an extremely popular library that bundles large locale files
... | true |
Other | vercel | next.js | 38ac55dd205e36b4b01901566127be1a8892946b.json | Update output tracing resolving (#29473) | packages/next/build/webpack/plugins/next-trace-entrypoints-plugin.ts | @@ -9,11 +9,6 @@ import {
isWebpack5,
sources,
} from 'next/dist/compiled/webpack/webpack'
-import {
- NODE_ESM_RESOLVE_OPTIONS,
- NODE_RESOLVE_OPTIONS,
-} from '../../webpack-config'
-import { NextConfigComplete } from '../../../server/config-shared'
const PLUGIN_NAME = 'TraceEntryPointsPlugin'
const TRAC... | true |
Other | vercel | next.js | 38ac55dd205e36b4b01901566127be1a8892946b.json | Update output tracing resolving (#29473) | test/integration/production/test/index.test.js | @@ -118,8 +118,6 @@ describe('Production Usage', () => {
/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/,
],
... | true |
Other | vercel | next.js | 38ac55dd205e36b4b01901566127be1a8892946b.json | Update output tracing resolving (#29473) | test/lib/e2e-utils.ts | @@ -96,29 +96,37 @@ export async function createNext(opts: {
nextConfig?: NextConfig
skipStart?: boolean
}): Promise<NextInstance> {
- if (nextInstance) {
- throw new Error(`createNext called without destroying previous instance`)
- }
+ try {
+ if (nextInstance) {
+ throw new Error(`createNext call... | true |
Other | vercel | next.js | 38ac55dd205e36b4b01901566127be1a8892946b.json | Update output tracing resolving (#29473) | test/lib/next-modes/base.ts | @@ -50,12 +50,15 @@ export class NextInstance {
}
console.log(`Creating test directory with isolated next...`)
- const tmpDir = process.env.NEXT_TEST_DIR || (await fs.realpath(os.tmpdir()))
+ const skipIsolatedNext = !!process.env.NEXT_SKIP_ISOLATE
+ const tmpDir = skipIsolatedNext
+ ? path.jo... | true |
Other | vercel | next.js | 38ac55dd205e36b4b01901566127be1a8892946b.json | Update output tracing resolving (#29473) | test/lib/next-modes/next-dev.ts | @@ -1,3 +1,5 @@
+import path from 'path'
+import resolveFrom from 'resolve-from'
import { spawn } from 'child_process'
import { NextInstance } from './base'
@@ -22,7 +24,9 @@ export class NextDevInstance extends NextInstance {
}
// we don't use yarn next here as yarn detaches itself from the
// child... | true |
Other | vercel | next.js | 38ac55dd205e36b4b01901566127be1a8892946b.json | Update output tracing resolving (#29473) | test/lib/next-modes/next-start.ts | @@ -1,5 +1,6 @@
import path from 'path'
import fs from 'fs-extra'
+import resolveFrom from 'resolve-from'
import { spawn, SpawnOptions } from 'child_process'
import { NextInstance } from './base'
@@ -48,18 +49,19 @@ export class NextStartInstance extends NextInstance {
this.emit('stderr', [msg])
}... | true |
Other | vercel | next.js | e5960dc6d6d512950393e3d457aedc4e0d5f7918.json | Add Stitches example to CSS-in-JS docs (#29498)
CC @peduarte | docs/basic-features/built-in-css-support.md | @@ -196,6 +196,7 @@ module.exports = {
<li><a href="https://github.com/vercel/next.js/tree/canary/examples/with-cxs">Cxs</a></li>
<li><a href="https://github.com/vercel/next.js/tree/canary/examples/with-aphrodite">Aphrodite</a></li>
<li><a href="https://github.com/vercel/next.js/tree/canary/examples/with... | false |
Other | vercel | next.js | bb8434c17eb3fe28b1fe35a07e22ef3890812d91.json | Update Prisma example (#29459)
* Correct branch name
* Delete .gitignore
* Update README.md
Co-authored-by: Lee Robinson <me@leerob.io>
Co-authored-by: JJ Kasper <jj@jjsweb.site> | examples/with-prisma/.gitignore | @@ -1,34 +0,0 @@
-# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
-
-# dependencies
-/node_modules
-/.pnp
-.pnp.js
-
-# testing
-/coverage
-
-# next.js
-/.next/
-/out/
-
-# production
-/build
-
-# misc
-.DS_Store
-*.pem
-
-# debug
-npm-debug.log*
-yarn-debug.log*
-yarn-error.log*
-... | true |
Other | vercel | next.js | bb8434c17eb3fe28b1fe35a07e22ef3890812d91.json | Update Prisma example (#29459)
* Correct branch name
* Delete .gitignore
* Update README.md
Co-authored-by: Lee Robinson <me@leerob.io>
Co-authored-by: JJ Kasper <jj@jjsweb.site> | examples/with-prisma/README.md | @@ -1,6 +1,6 @@
-Prisma.io maintains it's own Next.Js examples
+The official examples are maintained by the Prisma team:
-- [Javascript](https://github.com/prisma/prisma-examples/tree/master/javascript/rest-nextjs)
+- [Javascript](https://github.com/prisma/prisma-examples/tree/latest/javascript/rest-nextjs)
- [Types... | true |
Other | vercel | next.js | 7f998950767670321d5ec12522275e86a0ae0c4e.json | Update imperative routing docs to have better a11y (#29382)
We should recommend using a `button` instead of a `span` 👍 | docs/routing/imperatively.md | @@ -18,13 +18,13 @@ The following example shows how to do basic page navigations with [`useRouter`](
```jsx
import { useRouter } from 'next/router'
-function ReadMore() {
+export default function ReadMore() {
const router = useRouter()
return (
- <span onClick={() => router.push('/about')}>Click here to ... | false |
Other | vercel | next.js | 61dae380a81da07e71a53869decc989312b9b3fb.json | chore: upgrade webpack 5 version (#22737) | packages/next/bundles/yarn.lock | @@ -213,19 +213,19 @@ chrome-trace-event@^1.0.2:
tslib "^1.9.0"
colorette@^1.2.1:
- version "1.2.1"
- resolved "https://registry.yarnpkg.com/colorette/-/colorette-1.2.1.tgz#4d0b921325c14faf92633086a536db6e89564b1b"
- integrity sha512-puCDz0CzydiSYOrnXpz/PKd69zRrribezjtE9yd4zvytoRc8+RY/KJPvtPFKZS3E3wP6neGyMe0... | true |
Other | vercel | next.js | 61dae380a81da07e71a53869decc989312b9b3fb.json | chore: upgrade webpack 5 version (#22737) | packages/next/compiled/webpack/bundle5.js | @@ -54,7 +54,7 @@ module.exports = JSON.parse("{\"name\":\"terser\",\"description\":\"JavaScript p
/***/ (function(module) {
"use strict";
-module.exports = {"i8":"5.24.0"};
+module.exports = {"i8":"5.24.3"};
/***/ }),
@@ -32129,12 +32129,12 @@ const createModulesListMessage = (modules, moduleGraph) => {
.m... | true |
Other | vercel | next.js | e04d399ab5d9665168e032ecd3c5d82fe7e15d6a.json | Add missing dependencies in example (#22712)
@babel/plugin-proposal-class-properties is missing in with-mobx-react-lite example | examples/with-mobx-react-lite/package.json | @@ -13,5 +13,8 @@
"react": "^17.0.1",
"react-dom": "^17.0.1"
},
+ "devDependencies": {
+ "@babel/plugin-proposal-class-properties": "^7.1.0"
+ },
"license": "MIT"
} | false |
Other | vercel | next.js | bdc20c26578e40ad88335c919d78057e6ddbec65.json | Add Azure Pipelines example to no-cache docs (#22708)
I added this in to my own pipeline to fix the no-cache error and thought it may be of use to others. | errors/no-cache.md | @@ -111,3 +111,15 @@ Using Heroku's [custom cache](https://devcenter.heroku.com/articles/nodejs-suppo
```javascript
"cacheDirectories": [".next/cache"]
```
+
+#### Azure Pipelines
+
+Using Azure Pipelines' [Cache task](https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/utility/cache), add the following ta... | false |
Other | vercel | next.js | 006eba32256ef67b1fa9cb0b466effca249b1921.json | Add note for using `getStaticProps` with `404.js` (#22693)
Help clarify that this option is available! | docs/advanced-features/custom-error-page.md | @@ -21,6 +21,8 @@ export default function Custom404() {
}
```
+> **Note**: You can use [`getStaticProps`](/docs/basic-features/data-fetching.md#getstaticprops-static-generation) inside this page if you need to fetch data at build time.
+
## 500 Page
By default Next.js provides a 500 error page that matches the ... | false |
Other | vercel | next.js | b874bc7f821f8cb39d888fdb94b66405abcd0eb1.json | Add note about preloading to routing introduction. (#22656)
Preloading is mentioned in the `next/link` docs, but not in the routing introduction. | docs/routing/introduction.md | @@ -74,6 +74,8 @@ In the example above we have multiple links, each one maps a path (`href`) to a
- `/about` → `pages/about.js`
- `/blog/hello-world` → `pages/blog/[slug].js`
+Any `<Link />` in the viewport (initially or through scroll) will be prefetched by default (including the corresponding data) for pages usin... | false |
Other | vercel | next.js | 0a35b578d4ab482da3b199c501ce192783a7f2a1.json | Add use cases for API Routes to documentation. (#22616)
I've seen this confusion come up a few times, specifically [here](https://www.reddit.com/r/nextjs/comments/lsmpon/is_there_a_benefit_to_using_api_when_you_are_only/) for the latest. | docs/api-routes/introduction.md | @@ -15,7 +15,7 @@ description: Next.js supports API Routes, which allow you to build your API with
</ul>
</details>
-API routes provide a straightforward solution to build your **API** with Next.js.
+API routes provide a solution to build your **API** with Next.js.
Any file inside the folder `pages/api` is map... | false |
Other | vercel | next.js | 1ebc9bbb5e220aa6adbe8f2067534ad978ac0620.json | Load next.config.js async (#22578)
Just the conversion of config loading from sync to async from https://github.com/vercel/next.js/pull/22153
cc @Timer | packages/next/build/index.ts | @@ -125,8 +125,9 @@ export default async function build(
loadEnvConfig(dir, false, Log)
)
- const config = traceFn(tracer.startSpan('load-next-config'), () =>
- loadConfig(PHASE_PRODUCTION_BUILD, dir, conf)
+ const config = await traceAsyncFn(
+ tracer.startSpan('load-next-config'),
+ ... | true |
Other | vercel | next.js | 1ebc9bbb5e220aa6adbe8f2067534ad978ac0620.json | Load next.config.js async (#22578)
Just the conversion of config loading from sync to async from https://github.com/vercel/next.js/pull/22153
cc @Timer | packages/next/export/index.ts | @@ -148,9 +148,9 @@ export default async function exportApp(
const nextConfig =
configuration ||
- traceFn(tracer.startSpan('load-next-config'), () =>
+ (await traceAsyncFn(tracer.startSpan('load-next-config'), () =>
loadConfig(PHASE_EXPORT, dir)
- )
+ ))
const threads = ... | true |
Other | vercel | next.js | 1ebc9bbb5e220aa6adbe8f2067534ad978ac0620.json | Load next.config.js async (#22578)
Just the conversion of config loading from sync to async from https://github.com/vercel/next.js/pull/22153
cc @Timer | packages/next/next-server/server/config.ts | @@ -487,17 +487,16 @@ export function normalizeConfig(phase: string, config: any) {
return config
}
-export default function loadConfig(
+export default async function loadConfig(
phase: string,
dir: string,
customConfig?: object | null
) {
if (customConfig) {
return assignDefaults({ configOrigi... | true |
Other | vercel | next.js | 1ebc9bbb5e220aa6adbe8f2067534ad978ac0620.json | Load next.config.js async (#22578)
Just the conversion of config loading from sync to async from https://github.com/vercel/next.js/pull/22153
cc @Timer | packages/next/next-server/server/next-server.ts | @@ -27,7 +27,6 @@ import {
CLIENT_STATIC_FILES_RUNTIME,
PAGES_MANIFEST,
PERMANENT_REDIRECT_STATUS,
- PHASE_PRODUCTION_SERVER,
PRERENDER_MANIFEST,
ROUTES_MANIFEST,
SERVERLESS_DIRECTORY,
@@ -50,11 +49,7 @@ import {
tryGetPreviewData,
__ApiPreviewProps,
} from './api-utils'
-import loadConfig, {
... | true |
Other | vercel | next.js | 1ebc9bbb5e220aa6adbe8f2067534ad978ac0620.json | Load next.config.js async (#22578)
Just the conversion of config loading from sync to async from https://github.com/vercel/next.js/pull/22153
cc @Timer | packages/next/server/lib/start-server.ts | @@ -11,7 +11,7 @@ export default async function start(
customServer: false,
})
const srv = http.createServer(app.getRequestHandler())
- await new Promise((resolve, reject) => {
+ await new Promise<void>((resolve, reject) => {
// This code catches EADDRINUSE error if the port is already in use
srv... | true |
Other | vercel | next.js | 1ebc9bbb5e220aa6adbe8f2067534ad978ac0620.json | Load next.config.js async (#22578)
Just the conversion of config loading from sync to async from https://github.com/vercel/next.js/pull/22153
cc @Timer | packages/next/server/next-dev-server.ts | @@ -38,6 +38,7 @@ import HotReloader from './hot-reloader'
import { findPageFile } from './lib/find-page-file'
import { getNodeOptionsWithoutInspect } from './lib/utils'
import { withCoalescedInvoke } from '../lib/coalesced-function'
+import { NextConfig } from '../next-server/server/config'
if (typeof React.Susp... | true |
Other | vercel | next.js | 1ebc9bbb5e220aa6adbe8f2067534ad978ac0620.json | Load next.config.js async (#22578)
Just the conversion of config loading from sync to async from https://github.com/vercel/next.js/pull/22153
cc @Timer | packages/next/server/next.ts | @@ -1,6 +1,14 @@
import Server, { ServerConstructor } from '../next-server/server/next-server'
import { NON_STANDARD_NODE_ENV } from '../lib/constants'
import * as log from '../build/output/log'
+import loadConfig, { NextConfig } from '../next-server/server/config'
+import { resolve } from 'path'
+import {
+ PHASE_... | true |
Other | vercel | next.js | 1ebc9bbb5e220aa6adbe8f2067534ad978ac0620.json | Load next.config.js async (#22578)
Just the conversion of config loading from sync to async from https://github.com/vercel/next.js/pull/22153
cc @Timer | test/integration/cli/test/index.test.js | @@ -89,7 +89,7 @@ describe('CLI Usage', () => {
test('should exit when SIGINT is signalled', async () => {
const killSigint = (instance) =>
- setTimeout(() => instance.kill('SIGINT'), 500)
+ setTimeout(() => instance.kill('SIGINT'), 1000)
const { code, signal } = await runNextCommand(... | true |
Other | vercel | next.js | 1ebc9bbb5e220aa6adbe8f2067534ad978ac0620.json | Load next.config.js async (#22578)
Just the conversion of config loading from sync to async from https://github.com/vercel/next.js/pull/22153
cc @Timer | test/integration/production-start-no-build/test/index.test.js | @@ -6,12 +6,13 @@ jest.setTimeout(1000 * 60 * 5)
describe('Production Usage without production build', () => {
it('should show error when there is no production build', async () => {
- expect(() => {
- nextServer({
+ await expect(async () => {
+ const srv = nextServer({
dir: appDir,
... | true |
Other | vercel | next.js | 1ebc9bbb5e220aa6adbe8f2067534ad978ac0620.json | Load next.config.js async (#22578)
Just the conversion of config loading from sync to async from https://github.com/vercel/next.js/pull/22153
cc @Timer | test/integration/required-server-files/test/index.test.js | @@ -4,7 +4,7 @@ import http from 'http'
import fs from 'fs-extra'
import { join } from 'path'
import cheerio from 'cheerio'
-import Server from 'next/dist/next-server/server/next-server'
+import { nextServer } from 'next-test-utils'
import {
fetchViaHTTP,
findPort,
@@ -47,7 +47,7 @@ describe('Required Server ... | true |
Other | vercel | next.js | 1ebc9bbb5e220aa6adbe8f2067534ad978ac0620.json | Load next.config.js async (#22578)
Just the conversion of config loading from sync to async from https://github.com/vercel/next.js/pull/22153
cc @Timer | test/isolated/config.unit.test.js | @@ -8,108 +8,109 @@ const pathToConfig = join(__dirname, '_resolvedata', 'without-function')
const pathToConfigFn = join(__dirname, '_resolvedata', 'with-function')
describe('config', () => {
- it('Should get the configuration', () => {
- const config = loadConfig(PHASE_DEVELOPMENT_SERVER, pathToConfig)
+ it('... | true |
Other | vercel | next.js | a289d3805724099862ca477c4d4719d8e5078c4d.json | Simplify code examples for dynamic API routes (#22546)
Deep matching destructuring syntax is hard to understand and read vs. `const { ... } = req.query`. | docs/api-routes/dynamic-api-routes.md | @@ -17,10 +17,7 @@ For example, the API route `pages/api/post/[pid].js` has the following code:
```js
export default function handler(req, res) {
- const {
- query: { pid },
- } = req
-
+ const { pid } = req.query
res.end(`Post: ${pid}`)
}
```
@@ -69,10 +66,7 @@ An API route for `pages/api/post/[...slug]... | false |
Other | vercel | next.js | 69fe678ea92e9036f956d2314a06d6d653f0125a.json | docs(deployment): Update user ownership in docker deployment docs (#22539)
After testing the new docker deployment documentation, ran into the following error when running the container if you're using `next/image`:
```
[Error: EACCES: permission denied, unlink '/app/.next/cache/images/2+fKe4RlpMaSTNc8npKwiCItZgik9aO... | docs/deployment.md | @@ -105,17 +105,20 @@ FROM node:alpine AS runner
WORKDIR /app
ENV NODE_ENV production
-RUN addgroup -g 1001 -S nodejs
-RUN adduser -S nextjs -u 1001
-USER nextjs
-EXPOSE 3000
# You only need to copy next.config.js if you are NOT using the default configuration
# COPY --from=builder /app/next.config.js ./
COPY ... | false |
Other | vercel | next.js | 6d068aed4f81085e2619cd0d51dbd91b2bac4e97.json | Fix experimental optimizeCss for SSR (#22513)
This ensures `distDir` is set under `renderOpts` in `next-server` so that it is present when experimental `optimizeCss` is enabled.
x-ref: https://github.com/vercel/next.js/pull/16539 | packages/next/next-server/server/next-server.ts | @@ -161,6 +161,7 @@ export default class Server {
locales?: string[]
defaultLocale?: string
domainLocales?: DomainLocales
+ distDir: string
}
private compression?: Middleware
private onErrorMiddleware?: ({ err }: { err: Error }) => Promise<void>
@@ -218,6 +219,7 @@ export default class Server... | true |
Other | vercel | next.js | 6d068aed4f81085e2619cd0d51dbd91b2bac4e97.json | Fix experimental optimizeCss for SSR (#22513)
This ensures `distDir` is set under `renderOpts` in `next-server` so that it is present when experimental `optimizeCss` is enabled.
x-ref: https://github.com/vercel/next.js/pull/16539 | test/integration/critical-css/pages/index.js | @@ -8,4 +8,10 @@ export default function Home() {
)
}
-Home.getInitialProps = () => ({})
+export const getServerSideProps = () => {
+ return {
+ props: {
+ hello: 'world',
+ },
+ }
+} | true |
Other | vercel | next.js | 6d068aed4f81085e2619cd0d51dbd91b2bac4e97.json | Fix experimental optimizeCss for SSR (#22513)
This ensures `distDir` is set under `renderOpts` in `next-server` so that it is present when experimental `optimizeCss` is enabled.
x-ref: https://github.com/vercel/next.js/pull/16539 | test/integration/critical-css/test/index.test.js | @@ -19,15 +19,15 @@ let app
function runTests() {
it('should inline critical CSS', async () => {
- const html = await renderViaHTTP(appPort, '/index')
+ const html = await renderViaHTTP(appPort, '/')
expect(html).toMatch(
/<link rel="stylesheet" href="\/_next\/static\/css\/.*\.css" .*>/
)
... | true |
Other | vercel | next.js | e5bc0cdae0f17c09f89ab609b6187b9178ef3204.json | docs(deployment): Update working directory in builder stage (#22478)
Update docker file example in deploy documentation to use correct working directory in builder stage. It will fail to copy files from that stage since it's attempting to copy files that don't exist. | docs/deployment.md | @@ -95,6 +95,7 @@ RUN yarn install --frozen-lockfile
# Rebuild the source code only when needed
FROM node:alpine AS builder
+WORKDIR /app
COPY . .
COPY --from=deps /app/node_modules ./node_modules
RUN yarn build | false |
Other | vercel | next.js | 5cf16ece71495b6bd3f2b51ef3cead7fee04cd0b.json | Ensure static 500 hydrates correctly with query (#22468)
Follow-up to https://github.com/vercel/next.js/pull/22139 this ensures the default 500 error page hydrates with the correct `statusCode` prop when updating query values on the client since currently it will switch the 404 `statusCode` when one isn't present. An ... | packages/next/next-server/lib/router/router.ts | @@ -1110,6 +1110,18 @@ export default class Router implements BaseRouter {
// shallow routing is only allowed for same page URL changes.
const isValidShallowRoute = options.shallow && this.route === route
+
+ if (
+ (options as any)._h &&
+ pathname === '/_error' &&
+ self.__NE... | true |
Other | vercel | next.js | 5cf16ece71495b6bd3f2b51ef3cead7fee04cd0b.json | Ensure static 500 hydrates correctly with query (#22468)
Follow-up to https://github.com/vercel/next.js/pull/22139 this ensures the default 500 error page hydrates with the correct `statusCode` prop when updating query values on the client since currently it will switch the 404 `statusCode` when one isn't present. An ... | test/integration/500-page/test/index.test.js | @@ -1,6 +1,7 @@
/* eslint-env jest */
import fs from 'fs-extra'
+import webdriver from 'next-webdriver'
import { join } from 'path'
import {
killApp,
@@ -12,6 +13,9 @@ import {
fetchViaHTTP,
waitFor,
getPageFileFromPagesManifest,
+ getPagesManifest,
+ updatePagesManifest,
+ check,
} from 'next-tes... | true |
Other | vercel | next.js | 5cf16ece71495b6bd3f2b51ef3cead7fee04cd0b.json | Ensure static 500 hydrates correctly with query (#22468)
Follow-up to https://github.com/vercel/next.js/pull/22139 this ensures the default 500 error page hydrates with the correct `statusCode` prop when updating query values on the client since currently it will switch the 404 `statusCode` when one isn't present. An ... | test/integration/build-output/test/index.test.js | @@ -95,7 +95,7 @@ describe('Build Output', () => {
expect(indexSize.endsWith('B')).toBe(true)
// should be no bigger than 63.9 kb
- expect(parseFloat(indexFirstLoad)).toBeCloseTo(63.9, 1)
+ expect(parseFloat(indexFirstLoad)).toBeCloseTo(64, 1)
expect(indexFirstLoad.endsWith('kB')).toBe(... | true |
Other | vercel | next.js | 5cf16ece71495b6bd3f2b51ef3cead7fee04cd0b.json | Ensure static 500 hydrates correctly with query (#22468)
Follow-up to https://github.com/vercel/next.js/pull/22139 this ensures the default 500 error page hydrates with the correct `statusCode` prop when updating query values on the client since currently it will switch the 404 `statusCode` when one isn't present. An ... | test/lib/next-test-utils.js | @@ -1,6 +1,7 @@
import spawn from 'cross-spawn'
import express from 'express'
import { existsSync, readFileSync, unlinkSync, writeFileSync } from 'fs'
+import { writeFile } from 'fs-extra'
import getPort from 'get-port'
import http from 'http'
// `next` here is the symlink in `test/node_modules/next` which points... | true |
Other | vercel | next.js | 4b587d34b867b4f5bad20d520b789f1543249df2.json | fix(examples/with-three-js): Upgrade drei@2.2.21 & three@0.125.0 #22365 (#22431)
If the three dependency is upgraded to version 0.125.0 and upwards, the following errors occur:
- Compilation error: Attempted import error: 'Geometry' is not exported from 'three'.
- ReferenceError: Blob is not defined.
Solution:
Upgra... | examples/with-three-js/package.json | @@ -8,12 +8,12 @@
"start": "next start"
},
"dependencies": {
- "drei": "2.2.13",
+ "drei": "2.2.21",
"next": "10.0.5",
"react": "17.0.1",
"react-dom": "17.0.1",
"react-three-fiber": "5.3.11",
- "three": "0.124.0"
+ "three": "0.125.0"
},
"devDependencies": {
"next-tr... | false |
Other | vercel | next.js | 85f7efaf1f90e90cbf653e3f6459035867fad9fe.json | chore: fix typo in web.js (#22150)
hte -> the | examples/custom-server-actionhero/config/servers/web.js | @@ -9,7 +9,7 @@ exports['default'] = {
secure: false,
// Passed to https.createServer if secure=true. Should contain SSL certificates
serverOptions: {},
- // Should we redirect all traffic to the first host in this array if hte request header doesn't match?
+ // Should we redire... | false |
Other | vercel | next.js | 9793e9004f9c0041ead7786fd978e3b676bf7bc1.json | Add isPreview field to router (#21638)
This adds an `isPreview` field to the `next/router` to allow detecting when in preview mode.
Closes: https://github.com/vercel/next.js/issues/14903 | docs/api-reference/next/router.md | @@ -50,6 +50,7 @@ The following is the definition of the `router` object returned by both [`useRou
- `locales`: `String[]` - All supported locales (if enabled).
- `defaultLocale`: `String` - The current default locale (if enabled).
- `isReady`: `boolean` - Whether the router fields are updated client-side and ready ... | true |
Other | vercel | next.js | 9793e9004f9c0041ead7786fd978e3b676bf7bc1.json | Add isPreview field to router (#21638)
This adds an `isPreview` field to the `next/router` to allow detecting when in preview mode.
Closes: https://github.com/vercel/next.js/issues/14903 | packages/next/client/index.tsx | @@ -71,6 +71,7 @@ const {
locale,
locales,
domainLocales,
+ isPreview,
} = data
let { defaultLocale } = data
@@ -375,6 +376,7 @@ export default async (opts: { webpackHMR?: any } = {}) => {
locales,
defaultLocale,
domainLocales,
+ isPreview,
})
// call init-client middleware | true |
Other | vercel | next.js | 9793e9004f9c0041ead7786fd978e3b676bf7bc1.json | Add isPreview field to router (#21638)
This adds an `isPreview` field to the `next/router` to allow detecting when in preview mode.
Closes: https://github.com/vercel/next.js/issues/14903 | packages/next/client/router.ts | @@ -41,6 +41,7 @@ const urlPropertyFields = [
'locales',
'defaultLocale',
'isReady',
+ 'isPreview',
'isLocaleDomain',
]
const routerEvents = [ | true |
Other | vercel | next.js | 9793e9004f9c0041ead7786fd978e3b676bf7bc1.json | Add isPreview field to router (#21638)
This adds an `isPreview` field to the `next/router` to allow detecting when in preview mode.
Closes: https://github.com/vercel/next.js/issues/14903 | packages/next/next-server/lib/router/router.ts | @@ -363,6 +363,7 @@ export type NextRouter = BaseRouter &
| 'events'
| 'isFallback'
| 'isReady'
+ | 'isPreview'
>
export type PrefetchOptions = {
@@ -489,6 +490,7 @@ export default class Router implements BaseRouter {
defaultLocale?: string
domainLocales?: DomainLocales
isReady: boolean... | true |
Other | vercel | next.js | 9793e9004f9c0041ead7786fd978e3b676bf7bc1.json | Add isPreview field to router (#21638)
This adds an `isPreview` field to the `next/router` to allow detecting when in preview mode.
Closes: https://github.com/vercel/next.js/issues/14903 | packages/next/next-server/lib/utils.ts | @@ -103,6 +103,7 @@ export type NEXT_DATA = {
locales?: string[]
defaultLocale?: string
domainLocales?: DomainLocales
+ isPreview?: boolean
}
/** | true |
Other | vercel | next.js | 9793e9004f9c0041ead7786fd978e3b676bf7bc1.json | Add isPreview field to router (#21638)
This adds an `isPreview` field to the `next/router` to allow detecting when in preview mode.
Closes: https://github.com/vercel/next.js/issues/14903 | packages/next/next-server/server/render.tsx | @@ -80,6 +80,7 @@ class ServerRouter implements NextRouter {
locales?: string[]
defaultLocale?: string
domainLocales?: DomainLocales
+ isPreview: boolean
isLocaleDomain: boolean
// TODO: Remove in the next major version, as this would mean the user is adding event listeners in server-side `render` metho... | true |
Other | vercel | next.js | 9793e9004f9c0041ead7786fd978e3b676bf7bc1.json | Add isPreview field to router (#21638)
This adds an `isPreview` field to the `next/router` to allow detecting when in preview mode.
Closes: https://github.com/vercel/next.js/issues/14903 | test/integration/build-output/test/index.test.js | @@ -104,7 +104,7 @@ describe('Build Output', () => {
expect(parseFloat(err404FirstLoad)).toBeCloseTo(67.1, 0)
expect(err404FirstLoad.endsWith('kB')).toBe(true)
- expect(parseFloat(sharedByAll)).toBeCloseTo(63.6, 1)
+ expect(parseFloat(sharedByAll)).toBeCloseTo(63.7, 1)
expect(sharedByAl... | true |
Other | vercel | next.js | 9793e9004f9c0041ead7786fd978e3b676bf7bc1.json | Add isPreview field to router (#21638)
This adds an `isPreview` field to the `next/router` to allow detecting when in preview mode.
Closes: https://github.com/vercel/next.js/issues/14903 | test/integration/getserversideprops-preview/pages/index.js | @@ -1,3 +1,5 @@
+import { useRouter } from 'next/router'
+
export function getServerSideProps({ res, preview, previewData }) {
// test override in preview mode
res.setHeader('Cache-Control', 'public, max-age=3600')
@@ -11,13 +13,14 @@ export function getServerSideProps({ res, preview, previewData }) {
}
expo... | true |
Other | vercel | next.js | 9793e9004f9c0041ead7786fd978e3b676bf7bc1.json | Add isPreview field to router (#21638)
This adds an `isPreview` field to the `next/router` to allow detecting when in preview mode.
Closes: https://github.com/vercel/next.js/issues/14903 | test/integration/getserversideprops-preview/test/index.test.js | @@ -30,7 +30,12 @@ function getData(html) {
const $ = cheerio.load(html)
const nextData = $('#__NEXT_DATA__')
const preEl = $('#props-pre')
- return { nextData: JSON.parse(nextData.html()), pre: preEl.text() }
+ const routerData = JSON.parse($('#router').text())
+ return {
+ nextData: JSON.parse(nextData... | true |
Other | vercel | next.js | 9793e9004f9c0041ead7786fd978e3b676bf7bc1.json | Add isPreview field to router (#21638)
This adds an `isPreview` field to the `next/router` to allow detecting when in preview mode.
Closes: https://github.com/vercel/next.js/issues/14903 | test/integration/prerender-preview/pages/index.js | @@ -1,3 +1,5 @@
+import { useRouter } from 'next/router'
+
export function getStaticProps({ preview, previewData }) {
return {
props: {
@@ -9,13 +11,14 @@ export function getStaticProps({ preview, previewData }) {
}
export default function ({ hasProps, preview, previewData }) {
- if (!hasProps) {
- ret... | true |
Other | vercel | next.js | 9793e9004f9c0041ead7786fd978e3b676bf7bc1.json | Add isPreview field to router (#21638)
This adds an `isPreview` field to the `next/router` to allow detecting when in preview mode.
Closes: https://github.com/vercel/next.js/issues/14903 | test/integration/prerender-preview/test/index.test.js | @@ -30,7 +30,12 @@ function getData(html) {
const $ = cheerio.load(html)
const nextData = $('#__NEXT_DATA__')
const preEl = $('#props-pre')
- return { nextData: JSON.parse(nextData.html()), pre: preEl.text() }
+ const routerData = JSON.parse($('#router').text())
+ return {
+ nextData: JSON.parse(nextData... | true |
Other | vercel | next.js | 9793e9004f9c0041ead7786fd978e3b676bf7bc1.json | Add isPreview field to router (#21638)
This adds an `isPreview` field to the `next/router` to allow detecting when in preview mode.
Closes: https://github.com/vercel/next.js/issues/14903 | test/integration/typescript/pages/hello.tsx | @@ -20,6 +20,7 @@ export default function HelloPage(): JSX.Element {
console.log(process.browser)
console.log(router.pathname)
console.log(router.isReady)
+ console.log(router.isPreview)
return (
<div>
<p>One trillion dollars: {1_000_000_000_000}</p> | true |
Other | vercel | next.js | 15133b47ec7bfc413aa068d92fb678626cf47571.json | Fix typescript types. (#23771)
Fix typescript type for cache and null check in mutation result.
## Bug
- fixes : https://github.com/vercel/next.js/issues/23770
**That issue deals with -**
- Return the codeflow if data is not returned from the mutation, and that fixes this warning.
![Screenshot from 2021-04-07 18-2... | examples/with-typescript-graphql/pages/index.tsx | @@ -1,6 +1,7 @@
import Link from 'next/link'
import { useState } from 'react'
import {
+ ViewerQuery,
useViewerQuery,
useUpdateNameMutation,
ViewerDocument,
@@ -19,21 +20,18 @@ const Index = () => {
},
//Follow apollo suggestion to update cache
//https://www.apollographql.com/docs/angu... | false |
Other | vercel | next.js | b2ee0a93fe5653a050550455d817f7e460205b4a.json | Fix IE11 incompatibility due to string litterals (#23784)
Fixes #22270
## Bug
- [X] Related issues linked using `fixes #number`
- [ ] Integration tests added | azure-pipelines.yml | @@ -69,7 +69,7 @@ stages:
- stage: Test
dependsOn: Build
jobs:
- - job: test_ie11_production
+ - job: test_ie11
pool:
vmImage: 'windows-2019'
steps:
@@ -86,7 +86,7 @@ stages:
path: $(System.DefaultWorkingDirectory)
displayName: Cache Build
... | true |
Other | vercel | next.js | b2ee0a93fe5653a050550455d817f7e460205b4a.json | Fix IE11 incompatibility due to string litterals (#23784)
Fixes #22270
## Bug
- [X] Related issues linked using `fixes #number`
- [ ] Integration tests added | packages/next/build/webpack/loaders/next-style-loader/runtime/injectStylesIntoStyleTag.js | @@ -67,7 +67,7 @@ function modulesToDom(list, options) {
const item = list[i]
const id = options.base ? item[0] + options.base : item[0]
const count = idCountMap[id] || 0
- const identifier = `${id} ${count}`
+ const identifier = id + ' ' + count.toString()
idCountMap[id] = count + 1
@@ -8... | true |
Other | vercel | next.js | b2ee0a93fe5653a050550455d817f7e460205b4a.json | Fix IE11 incompatibility due to string litterals (#23784)
Fixes #22270
## Bug
- [X] Related issues linked using `fixes #number`
- [ ] Integration tests added | test/integration/css-client-nav/test/index.test.js | @@ -5,6 +5,7 @@ import { remove } from 'fs-extra'
import {
findPort,
killApp,
+ launchApp,
nextBuild,
nextStart,
renderViaHTTP,
@@ -15,25 +16,12 @@ import { join } from 'path'
jest.setTimeout(1000 * 60 * 1)
const fixturesDir = join(__dirname, '../../css-fixtures')
+const appDir = join(fixturesDir, ... | true |
Other | vercel | next.js | 279e105279f3c95d22ec13cb915766e25956f658.json | Update .now.sh to .vercel.app. (#22359) | docs/advanced-features/preview-mode.md | @@ -9,19 +9,19 @@ description: Next.js has the preview mode for statically generated pages. You ca
<details open>
<summary><b>Examples</b></summary>
<ul>
- <li><a href="https://github.com/vercel/next.js/tree/canary/examples/cms-wordpress">WordPress Example</a> (<a href="https://next-blog-wordpress.now.sh">Dem... | true |
Other | vercel | next.js | 279e105279f3c95d22ec13cb915766e25956f658.json | Update .now.sh to .vercel.app. (#22359) | docs/basic-features/data-fetching.md | @@ -9,22 +9,22 @@ description: 'Next.js has 2 pre-rendering modes: Static Generation and Server-si
<details open>
<summary><b>Examples</b></summary>
<ul>
- <li><a href="https://github.com/vercel/next.js/tree/canary/examples/cms-wordpress">WordPress Example</a> (<a href="https://next-blog-wordpress.now.sh">Dem... | true |
Other | vercel | next.js | 279e105279f3c95d22ec13cb915766e25956f658.json | Update .now.sh to .vercel.app. (#22359) | docs/basic-features/pages.md | @@ -48,22 +48,22 @@ You can also use **Client-side Rendering** along with Static Generation or Serve
<details open>
<summary><b>Examples</b></summary>
<ul>
- <li><a href="https://github.com/vercel/next.js/tree/canary/examples/cms-wordpress">WordPress Example</a> (<a href="https://next-blog-wordpress.now.sh">D... | true |
Other | vercel | next.js | 279e105279f3c95d22ec13cb915766e25956f658.json | Update .now.sh to .vercel.app. (#22359) | docs/faq.md | @@ -39,7 +39,7 @@ description: Get to know more about Next.js with the frequently asked questions.
<details>
<summary>How do I fetch data?</summary>
- <p>It's up to you. You can use the <a href="https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch">fetch API</a> or <a href="https://swr.now.sh/"... | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.