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 | 67681fe097793a464e5e3184f6eefc38dbe24f2f.json | Replace middleware flag with warning (#30160)
Follow-up to https://github.com/vercel/next.js/pull/30154 this replaces the experimental flag with a warning that is shown once on usage instead. | test/integration/middleware-core/test/index.test.js | @@ -17,11 +17,22 @@ jest.setTimeout(1000 * 60 * 2)
const context = {}
context.appDir = join(__dirname, '../')
+const middlewareWarning =
+ 'Warning: using beta Middleware (not covered by semver)'
+
describe('Middleware base tests', () => {
describe('dev mode', () => {
+ let output = ''
beforeAll(async ... | true |
Other | vercel | next.js | 7e81d13a8ea8a6f54d425b47f854d5335e1e4f1f.json | Add experimental config for middleware (#30154)
* Add experimental config for middleware
* Apply suggestions from code review
Co-authored-by: Steven <steven@ceriously.com>
Co-authored-by: Steven <steven@ceriously.com> | packages/next/build/entries.ts | @@ -121,7 +121,7 @@ export function createEntrypoints(
const isLikeServerless = isTargetLikeServerless(target)
- if (page.match(MIDDLEWARE_ROUTE)) {
+ if (page.match(MIDDLEWARE_ROUTE) && config.experimental.middleware) {
const loaderOpts: MiddlewareLoaderOptions = {
absolutePagePath: page... | true |
Other | vercel | next.js | 7e81d13a8ea8a6f54d425b47f854d5335e1e4f1f.json | Add experimental config for middleware (#30154)
* Add experimental config for middleware
* Apply suggestions from code review
Co-authored-by: Steven <steven@ceriously.com>
Co-authored-by: Steven <steven@ceriously.com> | packages/next/build/index.ts | @@ -284,6 +284,14 @@ export default async function build(
)
)
const pageKeys = Object.keys(mappedPages)
+ const hasMiddleware = pageKeys.some((page) => MIDDLEWARE_ROUTE.test(page))
+
+ if (hasMiddleware && !config.experimental.middleware) {
+ console.warn(
+ `Warning: detected _mi... | true |
Other | vercel | next.js | 7e81d13a8ea8a6f54d425b47f854d5335e1e4f1f.json | Add experimental config for middleware (#30154)
* Add experimental config for middleware
* Apply suggestions from code review
Co-authored-by: Steven <steven@ceriously.com>
Co-authored-by: Steven <steven@ceriously.com> | packages/next/build/webpack-config.ts | @@ -946,6 +946,7 @@ export default async function getBaseWebpackConfig(
parallel: config.experimental.cpus,
swcMinify: config.experimental.swcMinify,
terserOptions,
+ middlewareEnabled: config.experimental.middleware,
}).apply(compiler)
},
/... | true |
Other | vercel | next.js | 7e81d13a8ea8a6f54d425b47f854d5335e1e4f1f.json | Add experimental config for middleware (#30154)
* Add experimental config for middleware
* Apply suggestions from code review
Co-authored-by: Steven <steven@ceriously.com>
Co-authored-by: Steven <steven@ceriously.com> | packages/next/build/webpack/plugins/terser-webpack-plugin/src/index.js | @@ -49,13 +49,20 @@ function buildError(error, file) {
export class TerserPlugin {
constructor(options = {}) {
- const { cacheDir, terserOptions = {}, parallel, swcMinify } = options
+ const {
+ cacheDir,
+ terserOptions = {},
+ parallel,
+ swcMinify,
+ middlewareEnabled,
+ } = o... | true |
Other | vercel | next.js | 7e81d13a8ea8a6f54d425b47f854d5335e1e4f1f.json | Add experimental config for middleware (#30154)
* Add experimental config for middleware
* Apply suggestions from code review
Co-authored-by: Steven <steven@ceriously.com>
Co-authored-by: Steven <steven@ceriously.com> | packages/next/client/page-loader.ts | @@ -85,27 +85,31 @@ export default class PageLoader {
}
getMiddlewareList(): Promise<string[]> {
- if (process.env.NODE_ENV === 'production') {
- return getMiddlewareManifest()
- } else {
- if ((window as any).__DEV_MIDDLEWARE_MANIFEST) {
- return (window as any).__DEV_MIDDLEWARE_MANIFEST... | true |
Other | vercel | next.js | 7e81d13a8ea8a6f54d425b47f854d5335e1e4f1f.json | Add experimental config for middleware (#30154)
* Add experimental config for middleware
* Apply suggestions from code review
Co-authored-by: Steven <steven@ceriously.com>
Co-authored-by: Steven <steven@ceriously.com> | packages/next/client/route-loader.ts | @@ -232,27 +232,32 @@ export function getClientBuildManifest(): Promise<ClientBuildManifest> {
markAssetError(new Error('Failed to load client build manifest'))
)
}
+let _getMiddlewareManifest = () => Promise.resolve([])
-export function getMiddlewareManifest(): Promise<any> {
- if (self.__MIDDLEWARE_MANIFE... | true |
Other | vercel | next.js | 7e81d13a8ea8a6f54d425b47f854d5335e1e4f1f.json | Add experimental config for middleware (#30154)
* Add experimental config for middleware
* Apply suggestions from code review
Co-authored-by: Steven <steven@ceriously.com>
Co-authored-by: Steven <steven@ceriously.com> | packages/next/server/config-shared.ts | @@ -119,6 +119,7 @@ export type NextConfig = { [key: string]: any } & {
staticPageGenerationTimeout?: number
crossOrigin?: false | 'anonymous' | 'use-credentials'
experimental?: {
+ middleware?: boolean
swcMinify?: boolean
swcLoader?: boolean
cpus?: number
@@ -203,6 +204,7 @@ export const def... | true |
Other | vercel | next.js | 7e81d13a8ea8a6f54d425b47f854d5335e1e4f1f.json | Add experimental config for middleware (#30154)
* Add experimental config for middleware
* Apply suggestions from code review
Co-authored-by: Steven <steven@ceriously.com>
Co-authored-by: Steven <steven@ceriously.com> | packages/next/server/dev/next-dev-server.ts | @@ -265,10 +265,12 @@ export default class DevServer extends Server {
routedPages.push(pageName)
}
- this.middleware = getSortedRoutes(routedMiddleware).map((page) => ({
- match: getRouteMatcher(getMiddlewareRegex(page)),
- page,
- }))
+ if (this.nextConfig.e... | true |
Other | vercel | next.js | 7e81d13a8ea8a6f54d425b47f854d5335e1e4f1f.json | Add experimental config for middleware (#30154)
* Add experimental config for middleware
* Apply suggestions from code review
Co-authored-by: Steven <steven@ceriously.com>
Co-authored-by: Steven <steven@ceriously.com> | packages/next/server/next-server.ts | @@ -281,7 +281,7 @@ export default class Server {
if (!dev) {
this.pagesManifest = require(pagesManifestPath)
- if (!this.minimalMode) {
+ if (!this.minimalMode && this.nextConfig.experimental.middleware) {
this.middlewareManifest = require(middlewareManifestPath)
}
}
@@ -56... | true |
Other | vercel | next.js | 7e81d13a8ea8a6f54d425b47f854d5335e1e4f1f.json | Add experimental config for middleware (#30154)
* Add experimental config for middleware
* Apply suggestions from code review
Co-authored-by: Steven <steven@ceriously.com>
Co-authored-by: Steven <steven@ceriously.com> | packages/next/shared/lib/router/router.ts | @@ -35,7 +35,13 @@ import { searchParamsToUrlQuery } from './utils/querystring'
import resolveRewrites from './utils/resolve-rewrites'
import { getRouteMatcher } from './utils/route-matcher'
import { getRouteRegex } from './utils/route-regex'
-import { getMiddlewareRegex } from './utils/get-middleware-regex'
+
+let ... | true |
Other | vercel | next.js | 7e81d13a8ea8a6f54d425b47f854d5335e1e4f1f.json | Add experimental config for middleware (#30154)
* Add experimental config for middleware
* Apply suggestions from code review
Co-authored-by: Steven <steven@ceriously.com>
Co-authored-by: Steven <steven@ceriously.com> | test/integration/middleware-base-path/next.config.js | @@ -1,3 +1,6 @@
module.exports = {
basePath: '/root',
+ experimental: {
+ middleware: true,
+ },
} | true |
Other | vercel | next.js | 7e81d13a8ea8a6f54d425b47f854d5335e1e4f1f.json | Add experimental config for middleware (#30154)
* Add experimental config for middleware
* Apply suggestions from code review
Co-authored-by: Steven <steven@ceriously.com>
Co-authored-by: Steven <steven@ceriously.com> | test/integration/middleware-core/next.config.js | @@ -3,4 +3,7 @@ module.exports = {
locales: ['en', 'fr', 'nl'],
defaultLocale: 'en',
},
+ experimental: {
+ middleware: true,
+ },
} | true |
Other | vercel | next.js | 022675404beb93038605d98d230669178bde4539.json | Use default `next.config.js` if not found (#30155)
Some warnings/errors will mention `next.config.js` even if it doesn't exist so we'll make sure to assign a default value of `next.config.js`.
- Follow up to #30152 | packages/next/build/index.ts | @@ -765,11 +765,9 @@ export default async function build(
} = await staticCheckSpan.traceAsyncFn(async () => {
process.env.NEXT_PHASE = PHASE_PRODUCTION_BUILD
- const configFileName = config.configFileName
- const runtimeEnvConfig = {
- publicRuntimeConfig: config.publicRuntimeConfig,
- ... | true |
Other | vercel | next.js | 022675404beb93038605d98d230669178bde4539.json | Use default `next.config.js` if not found (#30155)
Some warnings/errors will mention `next.config.js` even if it doesn't exist so we'll make sure to assign a default value of `next.config.js`.
- Follow up to #30152 | packages/next/server/config.ts | @@ -31,7 +31,7 @@ const experimentalWarning = execOnce(() => {
})
function assignDefaults(userConfig: { [key: string]: any }) {
- const configFileName = userConfig.configFileName || 'next.config.js'
+ const configFileName = userConfig.configFileName
if (typeof userConfig.exportTrailingSlash !== 'undefined') {
... | true |
Other | vercel | next.js | 6f3e9470a626c1f5e63f0ec9c25fdf762afb307e.json | Ensure error message prints `next.config.mjs` (#30152)
This PR ensures we print the correct error message for either `next.config.js` or `next.config.mjs`, whichever was detected. | docs/api-reference/next.config.js/introduction.md | @@ -4,7 +4,7 @@ description: learn more about the configuration file used by Next.js to handle y
# next.config.js
-For custom advanced behavior of Next.js, you can create a `next.config.js` in the root of your project directory (next to `package.json`).
+For custom advanced configuration of Next.js, you can create... | true |
Other | vercel | next.js | 6f3e9470a626c1f5e63f0ec9c25fdf762afb307e.json | Ensure error message prints `next.config.mjs` (#30152)
This PR ensures we print the correct error message for either `next.config.js` or `next.config.mjs`, whichever was detected. | errors/next-config-error.md | @@ -2,13 +2,15 @@
#### Why This Error Occurred
-When attempting to load your `next.config.js` file an error occurred. This could be due to a syntax error or attempting to `require` a module that wasn't available.
+When attempting to load your `next.config.js` or `next.config.mjs` file, an error occurred. This coul... | true |
Other | vercel | next.js | 6f3e9470a626c1f5e63f0ec9c25fdf762afb307e.json | Ensure error message prints `next.config.mjs` (#30152)
This PR ensures we print the correct error message for either `next.config.js` or `next.config.mjs`, whichever was detected. | packages/next/build/index.ts | @@ -765,6 +765,7 @@ export default async function build(
} = await staticCheckSpan.traceAsyncFn(async () => {
process.env.NEXT_PHASE = PHASE_PRODUCTION_BUILD
+ const configFileName = config.configFileName
const runtimeEnvConfig = {
publicRuntimeConfig: config.publicRuntimeConfig,
... | true |
Other | vercel | next.js | 6f3e9470a626c1f5e63f0ec9c25fdf762afb307e.json | Ensure error message prints `next.config.mjs` (#30152)
This PR ensures we print the correct error message for either `next.config.js` or `next.config.mjs`, whichever was detected. | packages/next/build/utils.ts | @@ -617,6 +617,7 @@ export async function getJsPageSizeInKb(
export async function buildStaticPaths(
page: string,
getStaticPaths: GetStaticPaths,
+ configFileName: string,
locales?: string[],
defaultLocale?: string
): Promise<
@@ -788,7 +789,7 @@ export async function buildStaticPaths(
if (entr... | true |
Other | vercel | next.js | 6f3e9470a626c1f5e63f0ec9c25fdf762afb307e.json | Ensure error message prints `next.config.mjs` (#30152)
This PR ensures we print the correct error message for either `next.config.js` or `next.config.mjs`, whichever was detected. | packages/next/build/webpack-config.ts | @@ -1130,7 +1130,7 @@ export default async function getBaseWebpackConfig(
...Object.keys(config.env).reduce((acc, key) => {
if (/^(?:NODE_.+)|^(?:__.+)$/i.test(key)) {
throw new Error(
- `The key "${key}" under "env" in next.config.js is not allowed. https://nextjs.org/docs... | true |
Other | vercel | next.js | 6f3e9470a626c1f5e63f0ec9c25fdf762afb307e.json | Ensure error message prints `next.config.mjs` (#30152)
This PR ensures we print the correct error message for either `next.config.js` or `next.config.mjs`, whichever was detected. | packages/next/server/config-shared.ts | @@ -12,6 +12,7 @@ export type NextConfigComplete = Required<NextConfig> & {
typescript: Required<TypeScriptConfig>
configOrigin?: string
configFile?: string
+ configFileName: string
}
export interface I18NConfig { | true |
Other | vercel | next.js | 6f3e9470a626c1f5e63f0ec9c25fdf762afb307e.json | Ensure error message prints `next.config.mjs` (#30152)
This PR ensures we print the correct error message for either `next.config.js` or `next.config.mjs`, whichever was detected. | packages/next/server/config.ts | @@ -31,10 +31,11 @@ const experimentalWarning = execOnce(() => {
})
function assignDefaults(userConfig: { [key: string]: any }) {
+ const configFileName = userConfig.configFileName || 'next.config.js'
if (typeof userConfig.exportTrailingSlash !== 'undefined') {
console.warn(
chalk.yellow.bold('Warni... | true |
Other | vercel | next.js | 6f3e9470a626c1f5e63f0ec9c25fdf762afb307e.json | Ensure error message prints `next.config.mjs` (#30152)
This PR ensures we print the correct error message for either `next.config.js` or `next.config.mjs`, whichever was detected. | packages/next/server/dev/next-dev-server.ts | @@ -780,15 +780,20 @@ export default class DevServer extends Server {
// from waiting on them for the page to load in dev mode
const __getStaticPaths = async () => {
- const { publicRuntimeConfig, serverRuntimeConfig, httpAgentOptions } =
- this.nextConfig
+ const {
+ configFileName,... | true |
Other | vercel | next.js | 6f3e9470a626c1f5e63f0ec9c25fdf762afb307e.json | Ensure error message prints `next.config.mjs` (#30152)
This PR ensures we print the correct error message for either `next.config.js` or `next.config.mjs`, whichever was detected. | packages/next/server/dev/static-paths-worker.ts | @@ -44,6 +44,7 @@ export async function loadStaticPaths(
return buildStaticPaths(
pathname,
components.getStaticPaths,
+ config.configFileName,
locales,
defaultLocale
) | true |
Other | vercel | next.js | 6f3e9470a626c1f5e63f0ec9c25fdf762afb307e.json | Ensure error message prints `next.config.mjs` (#30152)
This PR ensures we print the correct error message for either `next.config.js` or `next.config.mjs`, whichever was detected. | test/integration/config-syntax-error/test/index.test.js | @@ -4,12 +4,13 @@ import { join } from 'path'
import { nextBuild } from 'next-test-utils'
const appDir = join(__dirname, '..')
-const nextConfig = join(appDir, 'next.config.js')
+const nextConfigJS = join(appDir, 'next.config.js')
+const nextConfigMJS = join(appDir, 'next.config.mjs')
-describe('Invalid resolve a... | true |
Other | vercel | next.js | 58a79e34e5d164e26436ba55793f2a14f4e5c672.json | add linting instructions (#30123) | .github/pull_request_template.md | @@ -21,4 +21,4 @@ Choose the right checklist for the change that you're making:
## Documentation / Examples
-- [ ] Make sure the linting passes
+- [ ] Make sure the linting passes by running `yarn lint` | true |
Other | vercel | next.js | 58a79e34e5d164e26436ba55793f2a14f4e5c672.json | add linting instructions (#30123) | contributing.md | @@ -72,7 +72,7 @@ If you would like to run the tests in headless mode (with the browser windows hi
yarn testheadless
```
-Running a specific test suite inside of the `test/integration` directory:
+Running a specific test suite (e.g. `production`) inside of the `test/integration` directory:
```sh
yarn testonly -... | true |
Other | vercel | next.js | dd81d2c97e707355180938dc5f0f51d25f990f7c.json | Simplify export statement (#30015) | packages/next/types/index.d.ts | @@ -25,9 +25,7 @@ import {
import next from '../dist/server/next'
// @ts-ignore This path is generated at build time and conflicts otherwise
-import { NextConfig as NextConfigType } from '../dist/server/config'
-
-export type NextConfig = NextConfigType
+export { NextConfig } from '../dist/server/config'
// Exte... | false |
Other | vercel | next.js | 610d2b37c86adb10dc15e8644c096fecd15f733b.json | use xxhash64 by default (#30095)
Node.js 17 stopped supporting md4 as hash function
and we wanted to use a faster hash function anyway.
Fixes: https://github.com/vercel/next.js/issues/30078 | packages/next/build/webpack-config.ts | @@ -1012,6 +1012,8 @@ export default async function getBaseWebpackConfig(
strictModuleExceptionHandling: true,
crossOriginLoading: crossOrigin,
webassemblyModuleFilename: 'static/wasm/[modulehash].wasm',
+ hashFunction: 'xxhash64',
+ hashDigestLength: 16,
},
performance: false,
... | true |
Other | vercel | next.js | 610d2b37c86adb10dc15e8644c096fecd15f733b.json | use xxhash64 by default (#30095)
Node.js 17 stopped supporting md4 as hash function
and we wanted to use a faster hash function anyway.
Fixes: https://github.com/vercel/next.js/issues/30078 | test/integration/build-output/test/index.test.js | @@ -11,16 +11,7 @@ const fixturesDir = join(__dirname, '..', 'fixtures')
const nextConfig = new File(join(fixturesDir, 'basic-app/next.config.js'))
describe('Build Output', () => {
- const configs = [{}]
- for (const gzipSize of [true, false]) {
- configs.push(...configs.map((c) => ({ ...c, gzipSize })))
- }
... | true |
Other | vercel | next.js | f068319d4deb9d83210407e96aff81e9e1b4a979.json | Enable shared worker pool by default (#30110) | errors/static-page-generation-timeout.md | @@ -11,7 +11,7 @@ When restarted it will retry all uncompleted jobs, but if a job was unsuccessful
- Make sure that there is no infinite loop during execution.
- Make sure all Promises in `getStaticPaths`/`getStaticProps` `resolve` or `reject` correctly.
- Avoid very long timeouts for network requests.
-- Increase t... | true |
Other | vercel | next.js | f068319d4deb9d83210407e96aff81e9e1b4a979.json | Enable shared worker pool by default (#30110) | packages/next/build/index.ts | @@ -691,7 +691,7 @@ export default async function build(
await promises.readFile(buildManifestPath, 'utf8')
) as BuildManifest
- const timeout = config.experimental.staticPageGenerationTimeout || 0
+ const timeout = config.staticPageGenerationTimeout || 0
const sharedPool = config.experimental.... | true |
Other | vercel | next.js | f068319d4deb9d83210407e96aff81e9e1b4a979.json | Enable shared worker pool by default (#30110) | packages/next/export/index.ts | @@ -520,7 +520,7 @@ export default async function exportApp(
)
}
- const timeout = configuration?.experimental.staticPageGenerationTimeout || 0
+ const timeout = configuration?.staticPageGenerationTimeout || 0
let infoPrinted = false
let exportPage: typeof import('./worker').default
... | true |
Other | vercel | next.js | f068319d4deb9d83210407e96aff81e9e1b4a979.json | Enable shared worker pool by default (#30110) | packages/next/server/config-shared.ts | @@ -114,6 +114,7 @@ export type NextConfig = { [key: string]: any } & {
webpack5?: false
strictPostcssConfiguration?: boolean
}
+ staticPageGenerationTimeout?: number
crossOrigin?: false | 'anonymous' | 'use-credentials'
experimental?: {
swcMinify?: boolean
@@ -141,7 +142,6 @@ export type NextC... | true |
Other | vercel | next.js | 33c687ac425c754d3829fe973bc582a2d9103d16.json | Update react 18 streaming api (#30038) | packages/next/server/render.tsx | @@ -1301,9 +1301,8 @@ function renderToStream(
}
}
- const { abort, startWriting } = (ReactDOMServer as any).pipeToNodeWritable(
+ const { abort, pipe } = (ReactDOMServer as any).renderToPipeableStream(
element,
- stream,
{
onError(error: Error) {
if (!resolved... | true |
Other | vercel | next.js | 33c687ac425c754d3829fe973bc582a2d9103d16.json | Update react 18 streaming api (#30038) | yarn.lock | @@ -16270,21 +16270,21 @@ rc@^1.0.1, rc@^1.1.6, rc@^1.2.7, rc@^1.2.8:
strip-json-comments "~2.0.1"
"react-18@npm:react@next":
- version "18.0.0-alpha-9175f4d15-20210928"
- resolved "https://registry.yarnpkg.com/react/-/react-18.0.0-alpha-9175f4d15-20210928.tgz#44cf184e9dbfe3c14f592a4cdbcdaa3deac9e42e"
- inte... | true |
Other | vercel | next.js | a9865811ba7c7dd4ff95d2967633db45a2ca7614.json | Use webpack resolve with nft (#29342)
This is a follow-up to https://github.com/vercel/next.js/pull/29341 to add using the webpack resolver while tracing for better performance. | packages/next/build/webpack-config.ts | @@ -175,7 +175,7 @@ export function attachReactRefresh(
}
}
-const NODE_RESOLVE_OPTIONS = {
+export const NODE_RESOLVE_OPTIONS = {
dependencyType: 'commonjs',
modules: ['node_modules'],
alias: false,
@@ -196,7 +196,7 @@ const NODE_RESOLVE_OPTIONS = {
restrictions: [],
}
-const NODE_ESM_RESOLVE_OPTI... | true |
Other | vercel | next.js | a9865811ba7c7dd4ff95d2967633db45a2ca7614.json | Use webpack resolve with nft (#29342)
This is a follow-up to https://github.com/vercel/next.js/pull/29341 to add using the webpack resolver while tracing for better performance. | packages/next/build/webpack/plugins/next-trace-entrypoints-plugin.ts | @@ -9,6 +9,11 @@ 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 | 797dca5913446c15ea7787f05ec3cf8b27edb845.json | fix: cover image redirect to undefined (#29311)
fixes #29310
## Bug
- [x] Related issues linked using `fixes #29310`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`
## Feature
- [ ] Implements an existing feature request or RFC. Make sure the feature request has been ... | examples/cms-strapi/components/cover-image.js | @@ -20,9 +20,13 @@ export default function CoverImage({ title, url, slug }) {
)
return (
<div className="sm:mx-0">
- <Link href={`/posts/${slug}`}>
- {slug ? <a aria-label={title}>{image}</a> : image}
- </Link>
+ {slug ? (
+ <Link href={`/posts/${slug}`}>
+ <a aria-label... | false |
Other | vercel | next.js | f8e283c7ba9f8f684511c00aee5e6742123dd2ba.json | Ensure href/as behavior points to correct docs (#29270)
Adds an additional note about `href`/`as` behavior so that users understand which docs should be looked at for how they are using it.
## Documentation / Examples
- [x] Make sure the linting passes
x-ref: https://github.com/vercel/next.js/issues/26169#issuec... | docs/api-reference/next/link.md | @@ -55,7 +55,7 @@ export default Home
`Link` accepts the following props:
- `href` - The path or URL to navigate to. This is the only required prop
-- `as` - Optional decorator for the path that will be shown in the browser URL bar. Before Next.js 9.5.3 this was used for dynamic routes, check our [previous docs](ht... | true |
Other | vercel | next.js | f8e283c7ba9f8f684511c00aee5e6742123dd2ba.json | Ensure href/as behavior points to correct docs (#29270)
Adds an additional note about `href`/`as` behavior so that users understand which docs should be looked at for how they are using it.
## Documentation / Examples
- [x] Make sure the linting passes
x-ref: https://github.com/vercel/next.js/issues/26169#issuec... | docs/api-reference/next/router.md | @@ -71,7 +71,7 @@ router.push(url, as, options)
```
- `url` - The URL to navigate to
-- `as` - Optional decorator for the URL that will be shown in the browser. Before Next.js 9.5.3 this was used for dynamic routes, check our [previous docs](https://nextjs.org/docs/tag/v9.5.2/api-reference/next/link#dynamic-routes)... | true |
Other | vercel | next.js | 800b2beef6335fad17cb11b94f06a7c3f025be8a.json | Remove docker usage for running development tests (#29264) | .github/workflows/build_test_deploy.yml | @@ -144,9 +144,7 @@ jobs:
- run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
if: ${{needs.build.outputs.docsChange != 'docs only change'}}
- # docker run is used here to fix jest snapshots failing inside of the
- # bare GitHub actions environment ... | true |
Other | vercel | next.js | 800b2beef6335fad17cb11b94f06a7c3f025be8a.json | Remove docker usage for running development tests (#29264) | packages/next/compiled/webpack/bundle5.js | @@ -146678,19 +146678,19 @@ module.exports = require("inspector");;
/***/ }),
-/***/ 56052:
+/***/ 32282:
/***/ (function(module) {
"use strict";
-module.exports = require("next/dist/build/webpack/plugins/terser-webpack-plugin");;
+module.exports = require("module");;
/***/ }),
-/***/ 32282:
+/***/ 56052:... | true |
Other | vercel | next.js | 800b2beef6335fad17cb11b94f06a7c3f025be8a.json | Remove docker usage for running development tests (#29264) | test/development/acceptance/ReactRefreshLogBox-scss.test.ts | @@ -3,7 +3,9 @@ import { sandbox } from './helpers'
import { createNext } from 'e2e-utils'
import { NextInstance } from 'test/lib/next-modes/base'
-describe('ReactRefreshLogBox', () => {
+// TODO: figure out why snapshots mismatch on GitHub actions
+// specifically but work in docker and locally
+describe.skip('Rea... | true |
Other | vercel | next.js | b4d8aa8c48e8a69bf1210daa99c8216318461d4c.json | Fix default static /500 with i18n (#29250) | packages/next/export/worker.ts | @@ -197,7 +197,7 @@ export default async function exportPage({
...headerMocks,
} as unknown as ServerResponse
- if (path === '/500' && page === '/_error') {
+ if (updatedPath === '/500' && page === '/_error') {
res.statusCode = 500
}
| true |
Other | vercel | next.js | b4d8aa8c48e8a69bf1210daa99c8216318461d4c.json | Fix default static /500 with i18n (#29250) | test/integration/i18n-support/test/index.test.js | @@ -76,6 +76,17 @@ describe('i18n Support', () => {
})
runTests(ctx)
+
+ it('should have pre-rendered /500 correctly', async () => {
+ for (const locale of locales) {
+ const content = await fs.readFile(
+ join(appDir, '.next/server/pages/', locale, '500.html'),
+ 'utf8'
+ ... | true |
Other | vercel | next.js | 2b57edc63ad4cfca6d3391563d6e3aac33017407.json | Add spans for hot-reloader start (#29251) | packages/next/server/dev/hot-reloader.ts | @@ -263,53 +263,81 @@ export default class HotReloader {
return { finished }
}
- private async clean(): Promise<void> {
- return recursiveDelete(join(this.dir, this.config.distDir), /^cache/)
+ private async clean(span: Span): Promise<void> {
+ return span
+ .traceChild('clean')
+ .traceAsyn... | false |
Other | vercel | next.js | e90825ad88c6f8191bed1dcc43e03465afba32ed.json | fix compilation relationship (#29174)
* fix compilation relationship
* fix compilation relationship
* Ensure loader span is provided correctly
* Fix webpack 4 childcompiler run
* Use compilation hook instead of make hook
Co-authored-by: Tim Neutkens <timneutkens@me.com>
Co-authored-by: Tim Neutkens <ti... | packages/next/build/webpack/plugins/build-manifest-plugin.ts | @@ -28,11 +28,12 @@ export type ClientBuildManifest = Record<string, string[]>
// reduced version to send to the client.
function generateClientManifest(
compiler: any,
+ compilation: any,
assetMap: BuildManifest,
rewrites: CustomRoutes['rewrites']
): string {
- const compilerSpan = spans.get(compiler)
- ... | true |
Other | vercel | next.js | e90825ad88c6f8191bed1dcc43e03465afba32ed.json | fix compilation relationship (#29174)
* fix compilation relationship
* fix compilation relationship
* Ensure loader span is provided correctly
* Fix webpack 4 childcompiler run
* Use compilation hook instead of make hook
Co-authored-by: Tim Neutkens <timneutkens@me.com>
Co-authored-by: Tim Neutkens <ti... | packages/next/build/webpack/plugins/build-stats-plugin.ts | @@ -115,9 +115,10 @@ export default class BuildStatsPlugin {
compiler.hooks.done.tapAsync(
'NextJsBuildStats',
async (stats, callback) => {
- const compilerSpan = spans.get(compiler)
+ const compilationSpan =
+ spans.get(stats.compilation) || spans.get(compiler)
try {
... | true |
Other | vercel | next.js | e90825ad88c6f8191bed1dcc43e03465afba32ed.json | fix compilation relationship (#29174)
* fix compilation relationship
* fix compilation relationship
* Ensure loader span is provided correctly
* Fix webpack 4 childcompiler run
* Use compilation hook instead of make hook
Co-authored-by: Tim Neutkens <timneutkens@me.com>
Co-authored-by: Tim Neutkens <ti... | packages/next/build/webpack/plugins/css-minimizer-plugin.ts | @@ -69,8 +69,9 @@ export class CssMinimizerPlugin {
stage: webpack.Compilation.PROCESS_ASSETS_STAGE_OPTIMIZE_SIZE,
},
async (assets: any) => {
- const compilerSpan = spans.get(compiler)
- const cssMinimizerSpan = compilerSpan!.traceChild(
+ const compi... | true |
Other | vercel | next.js | e90825ad88c6f8191bed1dcc43e03465afba32ed.json | fix compilation relationship (#29174)
* fix compilation relationship
* fix compilation relationship
* Ensure loader span is provided correctly
* Fix webpack 4 childcompiler run
* Use compilation hook instead of make hook
Co-authored-by: Tim Neutkens <timneutkens@me.com>
Co-authored-by: Tim Neutkens <ti... | packages/next/build/webpack/plugins/next-trace-entrypoints-plugin.ts | @@ -301,8 +301,8 @@ export class TraceEntryPointsPlugin implements webpack.Plugin {
apply(compiler: webpack.Compiler) {
if (isWebpack5) {
compiler.hooks.compilation.tap(PLUGIN_NAME, (compilation) => {
- const compilerSpan = spans.get(compiler)!
- const traceEntrypointsPluginSpan = compilerS... | true |
Other | vercel | next.js | e90825ad88c6f8191bed1dcc43e03465afba32ed.json | fix compilation relationship (#29174)
* fix compilation relationship
* fix compilation relationship
* Ensure loader span is provided correctly
* Fix webpack 4 childcompiler run
* Use compilation hook instead of make hook
Co-authored-by: Tim Neutkens <timneutkens@me.com>
Co-authored-by: Tim Neutkens <ti... | packages/next/build/webpack/plugins/profiling-plugin.ts | @@ -2,7 +2,14 @@ import { webpack, isWebpack5 } from 'next/dist/compiled/webpack/webpack'
import { Span } from '../../../trace'
const pluginName = 'ProfilingPlugin'
-export const spans = new WeakMap<any, Span>()
+export const spans = new WeakMap<
+ webpack.compilation.Compilation | webpack.Compiler,
+ Span
+>()
+... | true |
Other | vercel | next.js | e90825ad88c6f8191bed1dcc43e03465afba32ed.json | fix compilation relationship (#29174)
* fix compilation relationship
* fix compilation relationship
* Ensure loader span is provided correctly
* Fix webpack 4 childcompiler run
* Use compilation hook instead of make hook
Co-authored-by: Tim Neutkens <timneutkens@me.com>
Co-authored-by: Tim Neutkens <ti... | packages/next/build/webpack/plugins/terser-webpack-plugin/src/index.js | @@ -122,8 +122,10 @@ export class TerserPlugin {
cache,
{ SourceMapSource, RawSource }
) {
- const compilerSpan = spans.get(compiler)
- const terserSpan = compilerSpan.traceChild('terser-webpack-plugin-optimize')
+ const compilationSpan = spans.get(compilation) || spans.get(compiler)
+ const te... | true |
Other | vercel | next.js | 05a732eb7ae4263ec1f1c1d647f4e581edb0c936.json | Remove useless getComputedStyle call. (#27969)
See https://github.com/w3c/csswg-drafts/issues/6501 to see how I found this.
This line doesn't recompute layout in browsers, because `"height"` is given as a pseudo-element name rather than a property.
The right way to do what it wants is `getComputedStyle(document.body... | packages/next/client/index.tsx | @@ -763,10 +763,6 @@ function doRender(input: RenderRouteInfo): Promise<any> {
).forEach((el) => {
el.parentNode!.removeChild(el)
})
-
- // Force browser to recompute layout, which should prevent a flash of
- // unstyled content:
- getComputedStyle(document.body, 'height')
}
... | false |
Other | vercel | next.js | 2333f7c1b882dff09b944967a29162f9aca42e7d.json | Fix minor typos (#29188)
Fix minor typos:
typescript -> TypeScript | docs/basic-features/typescript.md | @@ -44,7 +44,7 @@ npm run dev
# You'll see instructions like these:
#
-# Please install typescript, @types/react, and @types/node by running:
+# Please install TypeScript, @types/react, and @types/node by running:
#
# yarn add --dev typescript @types/react @types/node
# | true |
Other | vercel | next.js | 2333f7c1b882dff09b944967a29162f9aca42e7d.json | Fix minor typos (#29188)
Fix minor typos:
typescript -> TypeScript | examples/with-aws-amplify-typescript/README.md | @@ -1,4 +1,4 @@
-# AWS Amplify and Typescript with NextJS
+# AWS Amplify and TypeScript with NextJS
[](https://console.aws.amazon.com/amplify/home#/deploy?repo=https://github.com/vercel/next.js/tree/canary/examples/with-aws-amplify-typescript)
| true |
Other | vercel | next.js | 2333f7c1b882dff09b944967a29162f9aca42e7d.json | Fix minor typos (#29188)
Fix minor typos:
typescript -> TypeScript | examples/with-chakra-ui-typescript/README.md | @@ -1,6 +1,6 @@
-# Example app with [chakra-ui](https://github.com/chakra-ui/chakra-ui) and Typescript
+# Example app with [chakra-ui](https://github.com/chakra-ui/chakra-ui) and TypeScript
-This example features how to use [chakra-ui](https://github.com/chakra-ui/chakra-ui) as the component library within a Next.js ... | true |
Other | vercel | next.js | 002ed250874ebc6e3241bfdc38b98f602d763371.json | Add name to invalidated span (#29170) | packages/next/build/webpack/plugins/profiling-plugin.ts | @@ -28,7 +28,7 @@ export class ProfilingPlugin {
}
traceHookPair(
- spanName: string,
+ spanName: string | (() => string),
startHook: any,
stopHook: any,
{
@@ -45,13 +45,11 @@ export class ProfilingPlugin {
) {
let span: Span | undefined
startHook.tap(pluginName, (...params: an... | false |
Other | vercel | next.js | 7a7cb91e80a884beba65fd5b9affe168352cc321.json | Update swc dependencies (#29151)
Updates to the latest `@swc/core` and `@swc/jest` versions that we use for running tests with jest. | package.json | @@ -48,8 +48,8 @@
"@mdx-js/loader": "0.18.0",
"@svgr/webpack": "5.5.0",
"@swc/cli": "0.1.49",
- "@swc/core": "1.2.85",
- "@swc/jest": "0.2.2",
+ "@swc/core": "1.2.88",
+ "@swc/jest": "0.2.3",
"@testing-library/react": "11.2.5",
"@types/cheerio": "0.22.16",
"@types/fs-extra": "8... | true |
Other | vercel | next.js | 7a7cb91e80a884beba65fd5b9affe168352cc321.json | Update swc dependencies (#29151)
Updates to the latest `@swc/core` and `@swc/jest` versions that we use for running tests with jest. | yarn.lock | @@ -4149,90 +4149,90 @@
slash "3.0.0"
source-map "^0.7.3"
-"@swc/core-android-arm64@^1.2.85":
- version "1.2.85"
- resolved "https://registry.yarnpkg.com/@swc/core-android-arm64/-/core-android-arm64-1.2.85.tgz#119c676a28f4bec1334ac1f4a72d64fdca050dbe"
- integrity sha512-XhRCVKrjwZBq7ubTnUtN8klCf/2V/MQNy1... | true |
Other | vercel | next.js | a408416299ec77626b799b752109eb3dc1b6d677.json | get files from entrypoints instead of from chunks (#23174) | packages/next/build/webpack/plugins/build-manifest-plugin.ts | @@ -66,20 +66,16 @@ function generateClientManifest(
})
}
-function isJsFile(file: string): boolean {
- // We don't want to include `.hot-update.js` files into the initial page
- return !file.endsWith('.hot-update.js') && file.endsWith('.js')
-}
-
-function getFilesArray(files: any) {
- if (!files) {
- retu... | false |
Other | vercel | next.js | 7dc45a325e5274960928279ee6a44c2092e81708.json | Add Typescript section to Redux Toolkit Example (#23166)
I have added a new section to the `with-redux-toolkit` example on setting up Typescript with Redux Toolkit and React-Redux.
It links the redux toolkit documentation and Next.js documentation on adding Typescript to a Next.js project. | examples/with-redux-toolkit/README.md | @@ -21,3 +21,9 @@ yarn create next-app --example with-redux-toolkit with-redux-toolkit-app
```
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)).
+
+### TypeScript Setup (optional)
+
+If yo... | false |
Other | vercel | next.js | e36eb381da3771d08eac9d32e8bdb50433f43084.json | Duplicate scroll description (#23103)
- `scroll` - Optional boolean, controls scrolling to the top of the page after navigation. Defaults to `true` and
- `scroll`: Scroll to the top of the page after a navigation. Defaults to `true`
as options for router.push | docs/api-reference/next/router.md | @@ -72,9 +72,8 @@ router.push(url, as, options)
- `url` - The URL to navigate to
- `as` - Optional decorator for the URL that will be shown in the browser. Before Next.js 9.5.3 this was used for dynamic routes, check our [previous docs](https://nextjs.org/docs/tag/v9.5.2/api-reference/next/link#dynamic-routes) to see... | false |
Other | vercel | next.js | c4508d1d13c2fabb6169d7a304200177ecc7d137.json | Update README to fix broken links. (#23058)
Also put current maintainers at the top of the list. | packages/next/README.md | @@ -46,9 +46,9 @@ Please see our [contributing.md](/contributing.md).
## Authors
-- Arunoda Susiripala ([@arunoda](https://twitter.com/arunoda)) – [Vercel](https://vercel.com/about/arunoda-zeit)
- Tim Neutkens ([@timneutkens](https://twitter.com/timneutkens)) – [Vercel](https://vercel.com/about/timneutkens)
- Na... | false |
Other | vercel | next.js | 62967fc667cef919e6af059dc906a62828f10f6f.json | Add note for loading env files during testing (#22982)
This adds a note to the environment variables documentation to mention how the env files can be loaded using the `@next/env` package as this has been brought up a few times.
x-ref: https://github.com/vercel/next.js/issues/22936#issuecomment-796665303
x-ref: http... | docs/basic-features/environment-variables.md | @@ -135,3 +135,15 @@ This one is useful when running tests with tools like `jest` or `cypress` where
There is a small difference between `test` environment, and both `development` and `production` that you need to bear in mind: `.env.local` won't be loaded, as you expect tests to produce the same results for everyone.... | false |
Other | vercel | next.js | 371aa608b20e5cc196b61c9f1370764c420fa9be.json | Install tailwindcss as a development dependency (#22964)
Set tailwindcss as a development dependency https://tailwindcss.com/docs/guides/nextjs#install-tailwind-via-npm | examples/with-tailwindcss/package.json | @@ -10,7 +10,9 @@
"dependencies": {
"next": "latest",
"react": "^17.0.1",
- "react-dom": "^17.0.1",
+ "react-dom": "^17.0.1"
+ },
+ "devDependencies": {
"autoprefixer": "^10.0.4",
"postcss": "^8.1.10",
"tailwindcss": "^2.0.2" | false |
Other | vercel | next.js | fa02b197f5254cfe9f0feabaa64e598d60d4745d.json | Fix typo in source maps documentation. (#22952) | docs/advanced-features/source-maps.md | @@ -4,7 +4,7 @@ description: Enables browser source map generation during the production build.
# Source Maps
-Source Maps are enabled by default during development. During production builds they are disabled as generation source maps can significantly increase build times and memory usage while being generated.
+... | false |
Other | vercel | next.js | e84571d8e36f062f1f66decd03252d6a8ca84811.json | Add appDir field to server files manifest (#22915)
This adds an `appDir` field to the `required-server-files` manifest signifying where the app source is located.
x-ref: https://github.com/vercel/next.js/issues/22847 | packages/next/build/index.ts | @@ -407,6 +407,7 @@ export default async function build(
compress: false,
configFile: undefined,
},
+ appDir: dir,
files: [
ROUTES_MANIFEST,
path.relative(distDir, manifestPath), | true |
Other | vercel | next.js | e84571d8e36f062f1f66decd03252d6a8ca84811.json | Add appDir field to server files manifest (#22915)
This adds an `appDir` field to the `required-server-files` manifest signifying where the app source is located.
x-ref: https://github.com/vercel/next.js/issues/22847 | test/integration/required-server-files/test/index.test.js | @@ -87,6 +87,7 @@ describe('Required Server Files', () => {
expect(requiredFilesManifest.ignore.length).toBeGreaterThan(0)
expect(typeof requiredFilesManifest.config.configFile).toBe('undefined')
expect(typeof requiredFilesManifest.config.trailingSlash).toBe('boolean')
+ expect(typeof requiredFilesMan... | true |
Other | vercel | next.js | e9a1d8fd4237b978ccb6e9637d9f4bcddff0c526.json | Add documentation for new static 500 behavior (#22888)
Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> | docs/advanced-features/custom-error-page.md | @@ -25,9 +25,22 @@ export default function Custom404() {
## 500 Page
-By default Next.js provides a 500 error page that matches the default 404 page’s style. This page is not statically optimized as it allows server-side errors to be reported. This is why 404 and 500 (other errors) are separated.
+Server-rendering... | false |
Other | vercel | next.js | 42b3b162dfebc8928f695ad55dd2b9d9c12aa3ca.json | Remove extra work on cli functions (#22855)
Hi I saw you wrote extra async await code for command line function that doesn't need. I fixed that and code become very smaller and prettier.
 | packages/next/bin/next.ts | @@ -17,13 +17,11 @@ import opentelemetryApi from '@opentelemetry/api'
const defaultCommand = 'dev'
export type cliCommand = (argv?: string[]) => void
const commands: { [command: string]: () => Promise<cliCommand> } = {
- build: async () => await import('../cli/next-build').then((i) => i.nextBuild),
- start: async ... | false |
Other | vercel | next.js | 3f9c469bca080ddf296def4e38a6cf8f9a3c31ad.json | Add RTL to with-next-translate example (#22808)
### Arabic/Hebrew RTL to `with-next-translate` Example
Added a simple example to change HTML direction based on the currently selected language
### References:
- [#19049](https://github.com/vercel/next.js/discussions/19049)
- [#18667](https://github.com/vercel/next.js/... | examples/with-next-translate/i18n.json | @@ -1,5 +1,5 @@
{
- "locales": ["en", "ca"],
+ "locales": ["en", "ca", "ar", "he"],
"defaultLocale": "en",
"pages": {
"*": ["common"], | true |
Other | vercel | next.js | 3f9c469bca080ddf296def4e38a6cf8f9a3c31ad.json | Add RTL to with-next-translate example (#22808)
### Arabic/Hebrew RTL to `with-next-translate` Example
Added a simple example to change HTML direction based on the currently selected language
### References:
- [#19049](https://github.com/vercel/next.js/discussions/19049)
- [#18667](https://github.com/vercel/next.js/... | examples/with-next-translate/locales/ar/common.json | @@ -0,0 +1,5 @@
+{
+ "title": "مثال with-next-translate",
+ "powered": "Powered by",
+ "alt": "Vercel logo"
+} | true |
Other | vercel | next.js | 3f9c469bca080ddf296def4e38a6cf8f9a3c31ad.json | Add RTL to with-next-translate example (#22808)
### Arabic/Hebrew RTL to `with-next-translate` Example
Added a simple example to change HTML direction based on the currently selected language
### References:
- [#19049](https://github.com/vercel/next.js/discussions/19049)
- [#18667](https://github.com/vercel/next.js/... | examples/with-next-translate/locales/ar/home.json | @@ -0,0 +1,14 @@
+{
+ "arabic": "العربية",
+ "catalan": "الكاتالونية",
+ "change-arabic": "تغيير اللغة إلى العربية ",
+ "change-catalan": "تغيير اللغة إلى الكتالانية",
+ "change-english": "تغيير اللغة إلى اللغة الإنجليزية ",
+ "change-hebrew": "تغيير اللغة إلى العبرية",
+ "description": "ابدأ بالتعديل",
+ "engl... | true |
Other | vercel | next.js | 3f9c469bca080ddf296def4e38a6cf8f9a3c31ad.json | Add RTL to with-next-translate example (#22808)
### Arabic/Hebrew RTL to `with-next-translate` Example
Added a simple example to change HTML direction based on the currently selected language
### References:
- [#19049](https://github.com/vercel/next.js/discussions/19049)
- [#18667](https://github.com/vercel/next.js/... | examples/with-next-translate/locales/ca/home.json | @@ -1,9 +1,13 @@
{
+ "arabic": "Àrab",
"catalan": "Català",
+ "change-arabic": "Canvia a la versió en àrab",
"change-catalan": "Canvia a la versió en català",
"change-english": "Canvia a la versió en anglès",
+ "change-hebrew": "Canvieu a la versió hebrea",
"description": "Comença editant",
"english"... | true |
Other | vercel | next.js | 3f9c469bca080ddf296def4e38a6cf8f9a3c31ad.json | Add RTL to with-next-translate example (#22808)
### Arabic/Hebrew RTL to `with-next-translate` Example
Added a simple example to change HTML direction based on the currently selected language
### References:
- [#19049](https://github.com/vercel/next.js/discussions/19049)
- [#18667](https://github.com/vercel/next.js/... | examples/with-next-translate/locales/en/home.json | @@ -1,9 +1,13 @@
{
+ "arabic": "Arabic",
"catalan": "Catalan",
+ "change-arabic": "Change language to Arabic",
"change-catalan": "Change language to Catalan",
"change-english": "Change language to English",
+ "change-hebrew": "Change language to Hebrew",
"description": "Get started by editing",
"engl... | true |
Other | vercel | next.js | 3f9c469bca080ddf296def4e38a6cf8f9a3c31ad.json | Add RTL to with-next-translate example (#22808)
### Arabic/Hebrew RTL to `with-next-translate` Example
Added a simple example to change HTML direction based on the currently selected language
### References:
- [#19049](https://github.com/vercel/next.js/discussions/19049)
- [#18667](https://github.com/vercel/next.js/... | examples/with-next-translate/locales/he/common.json | @@ -0,0 +1,5 @@
+{
+ "title": "דוגמא with-next-translate",
+ "powered": "Powered by",
+ "alt": "Vercel logo"
+} | true |
Other | vercel | next.js | 3f9c469bca080ddf296def4e38a6cf8f9a3c31ad.json | Add RTL to with-next-translate example (#22808)
### Arabic/Hebrew RTL to `with-next-translate` Example
Added a simple example to change HTML direction based on the currently selected language
### References:
- [#19049](https://github.com/vercel/next.js/discussions/19049)
- [#18667](https://github.com/vercel/next.js/... | examples/with-next-translate/locales/he/home.json | @@ -0,0 +1,14 @@
+{
+ "arabic": "עֲרָבִית",
+ "catalan": "קטלאנית",
+ "change-arabic": "שנה שפה לערבית",
+ "change-catalan": "שנה שפה לקטלונית",
+ "change-english": "שנה שפה לאנגלית",
+ "change-hebrew": "שנה את השפה לעברית",
+ "description": "התחל על ידי עריכה",
+ "english": "אנגלית",
+ "hebrew": "עִברִית",
+ ... | true |
Other | vercel | next.js | 3f9c469bca080ddf296def4e38a6cf8f9a3c31ad.json | Add RTL to with-next-translate example (#22808)
### Arabic/Hebrew RTL to `with-next-translate` Example
Added a simple example to change HTML direction based on the currently selected language
### References:
- [#19049](https://github.com/vercel/next.js/discussions/19049)
- [#18667](https://github.com/vercel/next.js/... | examples/with-next-translate/pages/index.js | @@ -4,11 +4,13 @@ import useTranslation from 'next-translate/useTranslation'
import Layout from '../components/Layout'
export default function Home() {
- const { t } = useTranslation()
+ const { t, lang } = useTranslation()
+ const isRTL = lang === 'ar' || lang === 'he'
+ const arrow = isRTL ? String.fromCharCo... | true |
Other | vercel | next.js | afc8ce4d0dd324135ea3f5b4d65ecd95fb455299.json | Fix idleTimeout error being thrown in route loader (#22775)
In the current implementation, `idleTimeout` will always be thrown even if it didn't time out and `Promise.race` was resolved. This causes the error `Error: Route did not complete loading` on every route transition and Chrome Devtools will pause code executio... | packages/next/client/route-loader.ts | @@ -149,10 +149,29 @@ function appendScript(
})
}
-function idleTimeout<T>(ms: number, err: Error): Promise<T> {
- return new Promise((_resolve, reject) =>
- requestIdleCallback(() => setTimeout(() => reject(err), ms))
- )
+// Resolve a promise that times out after given amount of milliseconds.
+function res... | false |
Other | vercel | next.js | a1dc5588c2bbbecf2ee164206879562a387c7f89.json | docs: fix typo in with-unstated/README.md (#26004)
resetted -> reset | examples/with-unstated/README.md | @@ -2,7 +2,7 @@
This example shows how to integrate [Unstated Next](https://github.com/jamiebuilds/unstated-next) with Next.js.
-There are two pages, `/` and `/about`, both render a counter and a timer, the state is saved for the current page and resetted when switching to a different page. To keep a shared state ... | false |
Other | vercel | next.js | 5925bf254a3c5effec0a7c049fcb63abcaa9ce27.json | include lib folder when publishing next-codemod (#26003)
Ensures `lib` is published in @next/codemod
## 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 implement... | packages/next-codemod/package.json | @@ -14,7 +14,8 @@
},
"files": [
"transforms/*.js",
- "bin/*.js"
+ "bin/*.js",
+ "lib/**/*.js"
],
"scripts": {
"prepublish": "yarn tsc -d -p tsconfig.json", | false |
Other | vercel | next.js | 2cff809001bd6b8af9721837c1ccee3a26cb4853.json | Add experimental CRA transform to docs (#25989)
This mentions the experimental create react app transform to the codemods doc including the feedback link while it is experimental.
## Documentation / Examples
- [x] Make sure the linting passes | docs/advanced-features/codemods.md | @@ -17,6 +17,14 @@ Codemods are transformations that run on your codebase programmatically. This al
- `--dry` Do a dry-run, no code will be edited
- `--print` Prints the changed output for comparison
+## Next.js 11
+
+### `cra-to-next` (experimental)
+
+Migrates a Create React App project to Next.js; creating a pag... | false |
Other | vercel | next.js | 79b4cb007b6de73c06ca27cbaf0bd3171e69b89b.json | Add css blur when `placeholder=blur` (#25945)
* Add css blur when `placeholder=blur`
* Fix tests | packages/next/client/image.tsx | @@ -273,12 +273,16 @@ function removePlaceholder(
// This is the desired behavior for now, and will be revisited when error
// handling is worked on for the image component itself.
setTimeout(() => {
+ element.style.filter = 'none'
+ element.style.backgroundSize = 'none'
elem... | true |
Other | vercel | next.js | 79b4cb007b6de73c06ca27cbaf0bd3171e69b89b.json | Add css blur when `placeholder=blur` (#25945)
* Add css blur when `placeholder=blur`
* Fix tests | test/integration/image-component/default/test/static.test.js | @@ -39,12 +39,12 @@ const runTests = () => {
})
it('Should add a blurry placeholder to statically imported jpg', async () => {
expect(html).toContain(
- `style="position:absolute;top:0;left:0;bottom:0;right:0;box-sizing:border-box;padding:0;border:none;margin:auto;display:block;width:0;height:0;min-widt... | true |
Other | vercel | next.js | c6ba29da00a16ecc49f615752bb1490bab8ed9fb.json | docs: use descriptive links instead of "click here" (#25897)
* docs: use descriptive links instead of "click here"
Linking text such as "here" or "click here" is not accessible (and
doesn't look that great either). The best example of why it's better to
use link text that provides context is that some screen read... | contributing.md | @@ -1,6 +1,6 @@
# Contributing to Next.js
-Our Commitment to Open Source can be found [here](https://vercel.com/oss).
+Read about our [Commitment to Open Source](https://vercel.com/oss).
1. [Fork](https://help.github.com/articles/fork-a-repo/) this repository to your own GitHub account and then [clone](https://he... | true |
Other | vercel | next.js | c6ba29da00a16ecc49f615752bb1490bab8ed9fb.json | docs: use descriptive links instead of "click here" (#25897)
* docs: use descriptive links instead of "click here"
Linking text such as "here" or "click here" is not accessible (and
doesn't look that great either). The best example of why it's better to
use link text that provides context is that some screen read... | docs/advanced-features/amp-support/typescript.md | @@ -6,4 +6,4 @@ description: Using AMP with TypeScript? Extend your typings to allow AMP compone
AMP currently doesn't have built-in types for TypeScript, but it's in their roadmap ([#13791](https://github.com/ampproject/amphtml/issues/13791)).
-As a workaround you can manually create a file called `amp.d.ts` insi... | true |
Other | vercel | next.js | c6ba29da00a16ecc49f615752bb1490bab8ed9fb.json | docs: use descriptive links instead of "click here" (#25897)
* docs: use descriptive links instead of "click here"
Linking text such as "here" or "click here" is not accessible (and
doesn't look that great either). The best example of why it's better to
use link text that provides context is that some screen read... | docs/advanced-features/measuring-performance.md | @@ -175,7 +175,7 @@ export function reportWebVitals(metric) {
> }
> ```
>
-> Read more about sending results to Google Analytics [here](https://github.com/GoogleChrome/web-vitals#send-the-results-to-google-analytics).
+> Read more about [sending results to Google Analytics](https://github.com/GoogleChrome/web-vitals... | true |
Other | vercel | next.js | c6ba29da00a16ecc49f615752bb1490bab8ed9fb.json | docs: use descriptive links instead of "click here" (#25897)
* docs: use descriptive links instead of "click here"
Linking text such as "here" or "click here" is not accessible (and
doesn't look that great either). The best example of why it's better to
use link text that provides context is that some screen read... | docs/api-reference/next.config.js/introduction.md | @@ -26,7 +26,7 @@ module.exports = (phase, { defaultConfig }) => {
}
```
-`phase` is the current context in which the configuration is loaded. You can see the available phases [here](https://github.com/vercel/next.js/blob/canary/packages/next/next-server/lib/constants.ts#L1-L4). Phases can be imported from `next/co... | true |
Other | vercel | next.js | c6ba29da00a16ecc49f615752bb1490bab8ed9fb.json | docs: use descriptive links instead of "click here" (#25897)
* docs: use descriptive links instead of "click here"
Linking text such as "here" or "click here" is not accessible (and
doesn't look that great either). The best example of why it's better to
use link text that provides context is that some screen read... | docs/api-reference/next/amp.md | @@ -11,7 +11,7 @@ description: Enable AMP in a page, and control the way Next.js adds AMP to the p
</ul>
</details>
-> AMP support is one of our advanced features, you can read more about it [here](/docs/advanced-features/amp-support/introduction.md).
+> AMP support is one of our advanced features, you can [read ... | true |
Other | vercel | next.js | c6ba29da00a16ecc49f615752bb1490bab8ed9fb.json | docs: use descriptive links instead of "click here" (#25897)
* docs: use descriptive links instead of "click here"
Linking text such as "here" or "click here" is not accessible (and
doesn't look that great either). The best example of why it's better to
use link text that provides context is that some screen read... | docs/api-routes/introduction.md | @@ -29,8 +29,8 @@ export default function handler(req, res) {
For an API route to work, you need to export a function as default (a.k.a **request handler**), which then receives the following parameters:
-- `req`: An instance of [http.IncomingMessage](https://nodejs.org/api/http.html#http_class_http_incomingmessag... | true |
Other | vercel | next.js | c6ba29da00a16ecc49f615752bb1490bab8ed9fb.json | docs: use descriptive links instead of "click here" (#25897)
* docs: use descriptive links instead of "click here"
Linking text such as "here" or "click here" is not accessible (and
doesn't look that great either). The best example of why it's better to
use link text that provides context is that some screen read... | docs/authentication.md | @@ -48,7 +48,7 @@ const Profile = () => {
export default Profile
```
-You can view this example in action [here](https://next-with-iron-session.vercel.app/). Check out the [`with-iron-session`](https://github.com/vercel/next.js/tree/canary/examples/with-iron-session) example to see how it works.
+You can view this ... | true |
Other | vercel | next.js | c6ba29da00a16ecc49f615752bb1490bab8ed9fb.json | docs: use descriptive links instead of "click here" (#25897)
* docs: use descriptive links instead of "click here"
Linking text such as "here" or "click here" is not accessible (and
doesn't look that great either). The best example of why it's better to
use link text that provides context is that some screen read... | errors/postcss-ignored-plugin.md | @@ -17,4 +17,4 @@ Remove the plugin specified in the error message from your custom PostCSS config
#### How do I configure CSS Modules?
CSS Modules are supported in [Next.js' built-in CSS support](https://nextjs.org/docs/advanced-features/customizing-postcss-config).
-You can [read more](https://nextjs.org/docs/adv... | true |
Other | vercel | next.js | c6ba29da00a16ecc49f615752bb1490bab8ed9fb.json | docs: use descriptive links instead of "click here" (#25897)
* docs: use descriptive links instead of "click here"
Linking text such as "here" or "click here" is not accessible (and
doesn't look that great either). The best example of why it's better to
use link text that provides context is that some screen read... | errors/postcss-shape.md | @@ -39,7 +39,7 @@ module.exports = {
}
```
-You can [read more](https://nextjs.org/docs/advanced-features/customizing-postcss-config) about configuring PostCSS in Next.js [here](https://nextjs.org/docs/advanced-features/customizing-postcss-config).
+You can [read more about configuring PostCSS in Next.js here](http... | true |
Other | vercel | next.js | c6ba29da00a16ecc49f615752bb1490bab8ed9fb.json | docs: use descriptive links instead of "click here" (#25897)
* docs: use descriptive links instead of "click here"
Linking text such as "here" or "click here" is not accessible (and
doesn't look that great either). The best example of why it's better to
use link text that provides context is that some screen read... | examples/amp-first/README.md | @@ -1,6 +1,6 @@
# AMP First Boilerplate ⚡
-This example sets up the boilerplate for an AMP First Site. You can see a live version [here](https://my-next-app.sebastianbenz.vercel.app). The boilerplate includes the following features:
+This example sets up the boilerplate for an AMP First Site. You can see a [live ver... | true |
Other | vercel | next.js | c6ba29da00a16ecc49f615752bb1490bab8ed9fb.json | docs: use descriptive links instead of "click here" (#25897)
* docs: use descriptive links instead of "click here"
Linking text such as "here" or "click here" is not accessible (and
doesn't look that great either). The best example of why it's better to
use link text that provides context is that some screen read... | examples/i18n-routing/README.md | @@ -2,7 +2,7 @@
This example shows how to create internationalized pages using Next.js and the i18n routing feature. It shows a normal page, a non-dynamic `getStaticProps` page, a dynamic `getStaticProps` page, and a `getServerSideProps` page.
-For further documentation on this feature see the documentation [here]... | true |
Other | vercel | next.js | c6ba29da00a16ecc49f615752bb1490bab8ed9fb.json | docs: use descriptive links instead of "click here" (#25897)
* docs: use descriptive links instead of "click here"
Linking text such as "here" or "click here" is not accessible (and
doesn't look that great either). The best example of why it's better to
use link text that provides context is that some screen read... | examples/with-electron/README.md | @@ -4,7 +4,7 @@ This example shows how you can use Next.js inside an Electron application to avo
For development it's going to run an HTTP server and let Next.js handle routing. In production it uses `next export` to pre-generate HTML static files and uses them in your app instead of running an HTTP server.
-**You... | true |
Other | vercel | next.js | c6ba29da00a16ecc49f615752bb1490bab8ed9fb.json | docs: use descriptive links instead of "click here" (#25897)
* docs: use descriptive links instead of "click here"
Linking text such as "here" or "click here" is not accessible (and
doesn't look that great either). The best example of why it's better to
use link text that provides context is that some screen read... | examples/with-netlify-cms/content/home.md | @@ -5,4 +5,4 @@ date: 2019-03-17T19:31:20.591Z
## Welcome to the Home Page
-If you want to know more about Next.js + Netlifycms go to the official tutorial [here](https://www.netlifycms.org/docs/nextjs/).
+If you want to know more about Next.js + Netlify CMS go to their [official tutorial](https://www.netlifycms.o... | true |
Other | vercel | next.js | c6ba29da00a16ecc49f615752bb1490bab8ed9fb.json | docs: use descriptive links instead of "click here" (#25897)
* docs: use descriptive links instead of "click here"
Linking text such as "here" or "click here" is not accessible (and
doesn't look that great either). The best example of why it's better to
use link text that provides context is that some screen read... | examples/with-passport/README.md | @@ -4,7 +4,7 @@ This example show how to use [Passport.js](http://www.passportjs.org) with Next.
The example shows how to do a login, signup and logout; and to get the user info using a hook with [SWR](https://swr.vercel.app).
-A DB is not included. You can use any db you want and add it [here](lib/user.js).
+A da... | true |
Other | vercel | next.js | c6ba29da00a16ecc49f615752bb1490bab8ed9fb.json | docs: use descriptive links instead of "click here" (#25897)
* docs: use descriptive links instead of "click here"
Linking text such as "here" or "click here" is not accessible (and
doesn't look that great either). The best example of why it's better to
use link text that provides context is that some screen read... | examples/with-rematch/README.md | @@ -2,7 +2,7 @@
This example has two pages. The first page has a counter which can be incremented synchronously or asynchronously. The second page is a page which shows a list of github users. It fetches data from the github api using this [endpoint](api.github.com/users).
-Since rematch is utility which uses redu... | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.