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 | efdb87d134563c379807f96dcdc952f08125dd36.json | Drop browser field for edge runtime (#35335)
Related to #31678
For streaming pages,
Nodejs runtime: setting global runtime to `"nodejs"` will work with default module resolution.
Edge runtime: previously next.js will pick up browser field since it's the "similar" asset (unlike nodejs) to edge runtime but browser sp... | test/integration/react-streaming-and-server-components/test/rsc.js | @@ -157,6 +157,11 @@ export default function (context, { runtime, env }) {
})
}
+ it('should not pick browser field from package.json for external libraries', async () => {
+ const html = await renderViaHTTP(context.appPort, '/external-imports')
+ expect(html).toContain('isomorphic-export')
+ })
+
... | true |
Other | vercel | next.js | 98d7ee3a060f9aab49aaa82c19309bbd9de9813e.json | Add libc fields to Linux platform packages (#35354)
Related: https://github.com/yarnpkg/berry/pull/3981
With `yarn 3.2` +, developers will install one less package on the Linux platform | packages/next-swc/crates/napi/npm/linux-arm64-gnu/package.json | @@ -11,6 +11,7 @@
"files": [
"next-swc.linux-arm64-gnu.node"
],
+ "libc": ["glibc"],
"license": "MIT",
"engines": {
"node": ">= 10" | true |
Other | vercel | next.js | 98d7ee3a060f9aab49aaa82c19309bbd9de9813e.json | Add libc fields to Linux platform packages (#35354)
Related: https://github.com/yarnpkg/berry/pull/3981
With `yarn 3.2` +, developers will install one less package on the Linux platform | packages/next-swc/crates/napi/npm/linux-arm64-musl/package.json | @@ -11,6 +11,7 @@
"files": [
"next-swc.linux-arm64-musl.node"
],
+ "libc": ["musl"],
"license": "MIT",
"engines": {
"node": ">= 10" | true |
Other | vercel | next.js | 98d7ee3a060f9aab49aaa82c19309bbd9de9813e.json | Add libc fields to Linux platform packages (#35354)
Related: https://github.com/yarnpkg/berry/pull/3981
With `yarn 3.2` +, developers will install one less package on the Linux platform | packages/next-swc/crates/napi/npm/linux-x64-gnu/package.json | @@ -11,6 +11,7 @@
"files": [
"next-swc.linux-x64-gnu.node"
],
+ "libc": ["glibc"],
"license": "MIT",
"engines": {
"node": ">= 10" | true |
Other | vercel | next.js | 98d7ee3a060f9aab49aaa82c19309bbd9de9813e.json | Add libc fields to Linux platform packages (#35354)
Related: https://github.com/yarnpkg/berry/pull/3981
With `yarn 3.2` +, developers will install one less package on the Linux platform | packages/next-swc/crates/napi/npm/linux-x64-musl/package.json | @@ -11,6 +11,7 @@
"files": [
"next-swc.linux-x64-musl.node"
],
+ "libc": ["musl"],
"license": "MIT",
"engines": {
"node": ">= 10" | true |
Other | vercel | next.js | ed1eedaa9723026ae4b1e5368526660c18ff8c8d.json | Encourage installation of sass as a devDep (#35323) | docs/basic-features/built-in-css-support.md | @@ -153,7 +153,7 @@ You can use component-level Sass via CSS Modules and the `.module.scss` or `.mod
Before you can use Next.js' built-in Sass support, be sure to install [`sass`](https://github.com/sass/sass):
```bash
-npm install sass
+npm install --save-dev sass
```
Sass support has the same benefits and res... | false |
Other | vercel | next.js | 7891645d4b64bb4ee775d0a5a38fc58abc1dfa90.json | Add info on context.ctx argument (#35303) | docs/advanced-features/custom-app.md | @@ -40,6 +40,8 @@ The `Component` prop is the active `page`, so whenever you navigate between rout
`pageProps` is an object with the initial props that were preloaded for your page by one of our [data fetching methods](/docs/basic-features/data-fetching/overview.md), otherwise it's an empty object.
+The `App.getIn... | false |
Other | vercel | next.js | 2cafe367ac839cc09d1702cf2e31583da1f4df19.json | chore: clarify issue template for examples | .github/ISSUE_TEMPLATE/1.bug_report.yml | @@ -1,10 +1,10 @@
name: Bug Report
description: Create a bug report for the Next.js core
-labels: 'template: bug'
+labels: ['template: bug']
body:
- type: markdown
attributes:
- value: Thanks for taking the time to file a bug report! Please fill out this form as completely as possible.
+ value: 'NO... | true |
Other | vercel | next.js | 2cafe367ac839cc09d1702cf2e31583da1f4df19.json | chore: clarify issue template for examples | .github/ISSUE_TEMPLATE/2.example_bug_report.yml | @@ -1,6 +1,6 @@
-name: Example Bug Report
+name: Bug Report for Examples
description: Create a bug report for one of the Next.js examples
-labels: 'type: example,template: bug'
+labels: ['area: examples']
body:
- type: markdown
attributes: | true |
Other | vercel | next.js | 765791a6d1fe56bf4247ea676f4ef8a0f803c034.json | Support overriding request headers in middlewares (#41380)
This PR adds a feature in middleware to add, modify, or delete request headers. This feature is quite useful to pass data from middleware to Serverless/Edge API routes.
### Questions for Reviewers
- Should we deny modifying standard request headers like `T... | packages/next/server/next-server.ts | @@ -1882,6 +1882,37 @@ export default class NextNodeServer extends BaseServer {
result.response.headers.set('x-middleware-rewrite', rel)
}
+ if (result.response.headers.has('x-middleware-override-headers')) {
+ const overriddenHeaders: Set<string> = new Set()
+ ... | true |
Other | vercel | next.js | 765791a6d1fe56bf4247ea676f4ef8a0f803c034.json | Support overriding request headers in middlewares (#41380)
This PR adds a feature in middleware to add, modify, or delete request headers. This feature is quite useful to pass data from middleware to Serverless/Edge API routes.
### Questions for Reviewers
- Should we deny modifying standard request headers like `T... | packages/next/server/web/spec-extension/response.ts | @@ -7,6 +7,25 @@ import { NextCookies } from './cookies'
const INTERNALS = Symbol('internal response')
const REDIRECTS = new Set([301, 302, 303, 307, 308])
+function handleMiddlewareField(
+ init: MiddlewareResponseInit | undefined,
+ headers: Headers
+) {
+ if (init?.request?.headers) {
+ if (!(init.request.... | true |
Other | vercel | next.js | 765791a6d1fe56bf4247ea676f4ef8a0f803c034.json | Support overriding request headers in middlewares (#41380)
This PR adds a feature in middleware to add, modify, or delete request headers. This feature is quite useful to pass data from middleware to Serverless/Edge API routes.
### Questions for Reviewers
- Should we deny modifying standard request headers like `T... | test/e2e/app-dir/app-middleware.test.ts | @@ -0,0 +1,129 @@
+/* eslint-env jest */
+
+import { NextInstance } from 'test/lib/next-modes/base'
+import { fetchViaHTTP } from 'next-test-utils'
+import { createNext, FileRef } from 'e2e-utils'
+import cheerio from 'cheerio'
+import path from 'path'
+
+describe('app-dir with middleware', () => {
+ if ((global as an... | true |
Other | vercel | next.js | 765791a6d1fe56bf4247ea676f4ef8a0f803c034.json | Support overriding request headers in middlewares (#41380)
This PR adds a feature in middleware to add, modify, or delete request headers. This feature is quite useful to pass data from middleware to Serverless/Edge API routes.
### Questions for Reviewers
- Should we deny modifying standard request headers like `T... | test/e2e/app-dir/app-middleware/app/headers/page.js | @@ -0,0 +1,10 @@
+import { headers } from 'next/headers'
+
+export default function SSRPage() {
+ const headersObj = Object.fromEntries(headers())
+ return (
+ <>
+ <p id="headers">{JSON.stringify(headersObj)}</p>
+ </>
+ )
+} | true |
Other | vercel | next.js | 765791a6d1fe56bf4247ea676f4ef8a0f803c034.json | Support overriding request headers in middlewares (#41380)
This PR adds a feature in middleware to add, modify, or delete request headers. This feature is quite useful to pass data from middleware to Serverless/Edge API routes.
### Questions for Reviewers
- Should we deny modifying standard request headers like `T... | test/e2e/app-dir/app-middleware/app/layout.js | @@ -0,0 +1,10 @@
+export default function Layout({ children }) {
+ return (
+ <html lang="en">
+ <head>
+ <title>app-middleware</title>
+ </head>
+ <body>{children}</body>
+ </html>
+ )
+} | true |
Other | vercel | next.js | 765791a6d1fe56bf4247ea676f4ef8a0f803c034.json | Support overriding request headers in middlewares (#41380)
This PR adds a feature in middleware to add, modify, or delete request headers. This feature is quite useful to pass data from middleware to Serverless/Edge API routes.
### Questions for Reviewers
- Should we deny modifying standard request headers like `T... | test/e2e/app-dir/app-middleware/middleware.js | @@ -0,0 +1,30 @@
+import { NextResponse } from 'next/server'
+
+/**
+ * @param {import('next/server').NextRequest} request
+ */
+export async function middleware(request) {
+ const headers = new Headers(request.headers)
+ headers.set('x-from-middleware', 'hello-from-middleware')
+
+ const removeHeaders = request.nex... | true |
Other | vercel | next.js | 765791a6d1fe56bf4247ea676f4ef8a0f803c034.json | Support overriding request headers in middlewares (#41380)
This PR adds a feature in middleware to add, modify, or delete request headers. This feature is quite useful to pass data from middleware to Serverless/Edge API routes.
### Questions for Reviewers
- Should we deny modifying standard request headers like `T... | test/e2e/app-dir/app-middleware/next.config.js | @@ -0,0 +1,7 @@
+module.exports = {
+ experimental: {
+ appDir: true,
+ legacyBrowsers: false,
+ browsersListForSwc: true,
+ },
+} | true |
Other | vercel | next.js | 765791a6d1fe56bf4247ea676f4ef8a0f803c034.json | Support overriding request headers in middlewares (#41380)
This PR adds a feature in middleware to add, modify, or delete request headers. This feature is quite useful to pass data from middleware to Serverless/Edge API routes.
### Questions for Reviewers
- Should we deny modifying standard request headers like `T... | test/e2e/app-dir/app-middleware/pages/api/dump-headers-edge.js | @@ -0,0 +1,11 @@
+export const config = {
+ runtime: 'experimental-edge',
+}
+
+export default (req) => {
+ return Response.json(Object.fromEntries(req.headers.entries()), {
+ headers: {
+ 'headers-from-edge-function': '1',
+ },
+ })
+} | true |
Other | vercel | next.js | 765791a6d1fe56bf4247ea676f4ef8a0f803c034.json | Support overriding request headers in middlewares (#41380)
This PR adds a feature in middleware to add, modify, or delete request headers. This feature is quite useful to pass data from middleware to Serverless/Edge API routes.
### Questions for Reviewers
- Should we deny modifying standard request headers like `T... | test/e2e/app-dir/app-middleware/pages/api/dump-headers-serverless.js | @@ -0,0 +1,6 @@
+export default (req, res) => {
+ return res
+ .status(200)
+ .setHeader('headers-from-serverless', '1')
+ .json(req.headers)
+} | true |
Other | vercel | next.js | 765791a6d1fe56bf4247ea676f4ef8a0f803c034.json | Support overriding request headers in middlewares (#41380)
This PR adds a feature in middleware to add, modify, or delete request headers. This feature is quite useful to pass data from middleware to Serverless/Edge API routes.
### Questions for Reviewers
- Should we deny modifying standard request headers like `T... | test/e2e/middleware-request-header-overrides/app/.gitignore | @@ -0,0 +1 @@
+.vercel | true |
Other | vercel | next.js | 765791a6d1fe56bf4247ea676f4ef8a0f803c034.json | Support overriding request headers in middlewares (#41380)
This PR adds a feature in middleware to add, modify, or delete request headers. This feature is quite useful to pass data from middleware to Serverless/Edge API routes.
### Questions for Reviewers
- Should we deny modifying standard request headers like `T... | test/e2e/middleware-request-header-overrides/app/middleware.js | @@ -0,0 +1,30 @@
+import { NextResponse } from 'next/server'
+
+/**
+ * @param {import('next/server').NextRequest} request
+ */
+export async function middleware(request) {
+ const headers = new Headers(request.headers)
+ headers.set('x-from-middleware', 'hello-from-middleware')
+
+ const removeHeaders = request.nex... | true |
Other | vercel | next.js | 765791a6d1fe56bf4247ea676f4ef8a0f803c034.json | Support overriding request headers in middlewares (#41380)
This PR adds a feature in middleware to add, modify, or delete request headers. This feature is quite useful to pass data from middleware to Serverless/Edge API routes.
### Questions for Reviewers
- Should we deny modifying standard request headers like `T... | test/e2e/middleware-request-header-overrides/app/next.config.js | @@ -0,0 +1 @@
+module.exports = {} | true |
Other | vercel | next.js | 765791a6d1fe56bf4247ea676f4ef8a0f803c034.json | Support overriding request headers in middlewares (#41380)
This PR adds a feature in middleware to add, modify, or delete request headers. This feature is quite useful to pass data from middleware to Serverless/Edge API routes.
### Questions for Reviewers
- Should we deny modifying standard request headers like `T... | test/e2e/middleware-request-header-overrides/app/pages/api/dump-headers-edge.js | @@ -0,0 +1,11 @@
+export const config = {
+ runtime: 'experimental-edge',
+}
+
+export default (req) => {
+ return Response.json(Object.fromEntries(req.headers.entries()), {
+ headers: {
+ 'headers-from-edge-function': '1',
+ },
+ })
+} | true |
Other | vercel | next.js | 765791a6d1fe56bf4247ea676f4ef8a0f803c034.json | Support overriding request headers in middlewares (#41380)
This PR adds a feature in middleware to add, modify, or delete request headers. This feature is quite useful to pass data from middleware to Serverless/Edge API routes.
### Questions for Reviewers
- Should we deny modifying standard request headers like `T... | test/e2e/middleware-request-header-overrides/app/pages/api/dump-headers-serverless.js | @@ -0,0 +1,6 @@
+export default (req, res) => {
+ return res
+ .status(200)
+ .setHeader('headers-from-serverless', '1')
+ .json(req.headers)
+} | true |
Other | vercel | next.js | 765791a6d1fe56bf4247ea676f4ef8a0f803c034.json | Support overriding request headers in middlewares (#41380)
This PR adds a feature in middleware to add, modify, or delete request headers. This feature is quite useful to pass data from middleware to Serverless/Edge API routes.
### Questions for Reviewers
- Should we deny modifying standard request headers like `T... | test/e2e/middleware-request-header-overrides/app/pages/ssr-page.js | @@ -0,0 +1,15 @@
+export default function SSRPage({ headers }) {
+ return (
+ <>
+ <p id="headers">{JSON.stringify(headers)}</p>
+ </>
+ )
+}
+
+export const getServerSideProps = (ctx) => {
+ return {
+ props: {
+ headers: ctx.req.headers,
+ },
+ }
+} | true |
Other | vercel | next.js | 765791a6d1fe56bf4247ea676f4ef8a0f803c034.json | Support overriding request headers in middlewares (#41380)
This PR adds a feature in middleware to add, modify, or delete request headers. This feature is quite useful to pass data from middleware to Serverless/Edge API routes.
### Questions for Reviewers
- Should we deny modifying standard request headers like `T... | test/e2e/middleware-request-header-overrides/test/index.test.ts | @@ -0,0 +1,119 @@
+/* eslint-env jest */
+
+import { join } from 'path'
+import { NextInstance } from 'test/lib/next-modes/base'
+import { fetchViaHTTP } from 'next-test-utils'
+import { createNext, FileRef } from 'e2e-utils'
+import cheerio from 'cheerio'
+
+describe('Middleware Request Headers Overrides', () => {
+ ... | true |
Other | vercel | next.js | 4adab6a61e2e624f26e6685fc67dc2511e97e135.json | Improve server bundling strategy (#41584)
This PR adds a list of popular packages that should always opt-out
bundling in the server layer.
## Bug
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see `contributing.md`
## Feature
- ... | packages/next/build/webpack-config.ts | @@ -13,6 +13,7 @@ import {
WEBPACK_LAYERS,
RSC_MOD_REF_PROXY_ALIAS,
} from '../lib/constants'
+import { EXTERNAL_PACKAGES } from '../lib/server-external-packages'
import { fileExists } from '../lib/file-exists'
import { CustomRoutes } from '../lib/load-custom-routes.js'
import {
@@ -1008,6 +1009,10 @@ export ... | true |
Other | vercel | next.js | 4adab6a61e2e624f26e6685fc67dc2511e97e135.json | Improve server bundling strategy (#41584)
This PR adds a list of popular packages that should always opt-out
bundling in the server layer.
## Bug
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see `contributing.md`
## Feature
- ... | packages/next/lib/server-external-packages.ts | @@ -0,0 +1,20 @@
+// A list of popular packages that cannot be bundled on the server.
+export const EXTERNAL_PACKAGES = [
+ 'eslint',
+ 'typescript',
+ 'prettier',
+ 'postcss',
+ 'jest',
+ 'autoprefixer',
+ 'tailwindcss',
+ 'sharp',
+ 'express',
+ 'ts-node',
+ 'webpack',
+ 'cypress',
+ '@sentry/nextjs',
+ ... | true |
Other | vercel | next.js | 2551978fa40b68882daa349019f13f8f783571f5.json | Increase timeout-minutes for dev jobs | .github/workflows/build_test_deploy.yml | @@ -243,7 +243,7 @@ jobs:
name: Test Development
runs-on: ubuntu-latest
needs: [build, build-native-test]
- timeout-minutes: 30
+ timeout-minutes: 35
env:
NEXT_TELEMETRY_DISABLED: 1
NEXT_TEST_JOB: 1
@@ -396,7 +396,7 @@ jobs:
name: Test Development (E2E)
runs-on: ubuntu-... | false |
Other | vercel | next.js | 008a962df82fbe9558f95fd5c5b1cbbf1fb974e0.json | Run all dev tests with replay on retry (#41168)
<!--
Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change that you're making:
-->
## Bug
- [ ]... | .github/workflows/build_test_deploy.yml | @@ -286,9 +286,25 @@ jobs:
timeout-minutes: 10
if: ${{needs.build.outputs.docsChange == 'nope'}}
+ - run: npx @replayio/playwright install chromium
+ if: ${{needs.build.outputs.docsChange == 'nope'}}
+
- run: node run-tests.js --type development --timings -g ${{ matrix.group }}/2
... | false |
Other | vercel | next.js | f055b167a5d8e57bd9b85613f4d4ea470dbaf4b7.json | Add TypeScript plugin (#41569)
This PR implements the TypeScript plugin (only applied to the app directory), and it will be automatically added to tsconfig.json when running the CLI. Due to how TS plugins work (a package name is required to specify), hence we can't use a subpath import like `next/typescript` for the p... | packages/next/lib/typescript/writeConfigurationDefaults.ts | @@ -187,6 +187,27 @@ export async function writeConfigurationDefaults(
)
}
+ // Enable the Next.js typescript plugin.
+ if (isAppDirEnabled) {
+ if (userTsConfig.compilerOptions) {
+ if (!('plugins' in userTsConfig.compilerOptions)) {
+ userTsConfig.compilerOptions.plugins = []
+ }
+ ... | true |
Other | vercel | next.js | f055b167a5d8e57bd9b85613f4d4ea470dbaf4b7.json | Add TypeScript plugin (#41569)
This PR implements the TypeScript plugin (only applied to the app directory), and it will be automatically added to tsconfig.json when running the CLI. Due to how TS plugins work (a package name is required to specify), hence we can't use a subpath import like `next/typescript` for the p... | packages/next/lib/verifyTypeScriptSetup.ts | @@ -1,5 +1,6 @@
import chalk from 'next/dist/compiled/chalk'
import path from 'path'
+
import {
hasNecessaryDependencies,
NecessaryDependencies, | true |
Other | vercel | next.js | f055b167a5d8e57bd9b85613f4d4ea470dbaf4b7.json | Add TypeScript plugin (#41569)
This PR implements the TypeScript plugin (only applied to the app directory), and it will be automatically added to tsconfig.json when running the CLI. Due to how TS plugins work (a package name is required to specify), hence we can't use a subpath import like `next/typescript` for the p... | packages/next/server/next-typescript.ts | @@ -0,0 +1,613 @@
+/**
+ * This is a TypeScript language service plugin for Next.js app directory,
+ * it provides the following features:
+ *
+ * - Warns about disallowed React APIs in server components.
+ * - Warns about disallowed layout and page exports.
+ * - Autocompletion for entry configurations.
+ * - Hover hi... | true |
Other | vercel | next.js | f055b167a5d8e57bd9b85613f4d4ea470dbaf4b7.json | Add TypeScript plugin (#41569)
This PR implements the TypeScript plugin (only applied to the app directory), and it will be automatically added to tsconfig.json when running the CLI. Due to how TS plugins work (a package name is required to specify), hence we can't use a subpath import like `next/typescript` for the p... | packages/next/server/next.ts | @@ -182,6 +182,15 @@ export class NextServer {
// This file is used for when users run `require('next')`
function createServer(options: NextServerOptions): NextServer {
+ // The package is used as a TypeScript plugin.
+ if (
+ options &&
+ 'typescript' in options &&
+ 'version' in (options as any).typesc... | true |
Other | vercel | next.js | f055b167a5d8e57bd9b85613f4d4ea470dbaf4b7.json | Add TypeScript plugin (#41569)
This PR implements the TypeScript plugin (only applied to the app directory), and it will be automatically added to tsconfig.json when running the CLI. Due to how TS plugins work (a package name is required to specify), hence we can't use a subpath import like `next/typescript` for the p... | test/e2e/app-dir/app-typescript/app/inner/page.tsx | @@ -1,7 +1,18 @@
+/* eslint-disable */
+
+// 'use client'
+
+import { useCallback, useState } from 'react'
+
export default function Page() {
return <div>hello</div>
}
-export const config = {
- runtime: 'nodejs',
-}
+export const runtime = 'nodejs'
+
+export const dynamic = 'auto',
+ revalidate = 100,
+ fetc... | true |
Other | vercel | next.js | f055b167a5d8e57bd9b85613f4d4ea470dbaf4b7.json | Add TypeScript plugin (#41569)
This PR implements the TypeScript plugin (only applied to the app directory), and it will be automatically added to tsconfig.json when running the CLI. Due to how TS plugins work (a package name is required to specify), hence we can't use a subpath import like `next/typescript` for the p... | test/e2e/app-dir/app-typescript/app/layout.tsx | @@ -1,8 +1,10 @@
+/* eslint-disable */
+
export const config = {
revalidate: 0,
}
-// export const revalidate = -1
+export const revalidate = -1
export default function Root({ children }) {
return ( | true |
Other | vercel | next.js | f055b167a5d8e57bd9b85613f4d4ea470dbaf4b7.json | Add TypeScript plugin (#41569)
This PR implements the TypeScript plugin (only applied to the app directory), and it will be automatically added to tsconfig.json when running the CLI. Due to how TS plugins work (a package name is required to specify), hence we can't use a subpath import like `next/typescript` for the p... | test/e2e/app-dir/app-typescript/package.json | @@ -8,5 +8,8 @@
},
"keywords": [],
"author": "",
- "license": "ISC"
+ "license": "ISC",
+ "dependencies": {
+ "typescript": "4.8.2"
+ }
} | true |
Other | vercel | next.js | f055b167a5d8e57bd9b85613f4d4ea470dbaf4b7.json | Add TypeScript plugin (#41569)
This PR implements the TypeScript plugin (only applied to the app directory), and it will be automatically added to tsconfig.json when running the CLI. Due to how TS plugins work (a package name is required to specify), hence we can't use a subpath import like `next/typescript` for the p... | test/e2e/app-dir/app-typescript/pages/index.tsx | @@ -0,0 +1,7 @@
+/* eslint-disable */
+
+import { useState } from 'react'
+
+export default function Page() {
+ return <div>hello</div>
+} | true |
Other | vercel | next.js | f055b167a5d8e57bd9b85613f4d4ea470dbaf4b7.json | Add TypeScript plugin (#41569)
This PR implements the TypeScript plugin (only applied to the app directory), and it will be automatically added to tsconfig.json when running the CLI. Due to how TS plugins work (a package name is required to specify), hence we can't use a subpath import like `next/typescript` for the p... | test/e2e/app-dir/app-typescript/tsconfig.json | @@ -13,7 +13,12 @@
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
- "jsx": "preserve"
+ "jsx": "preserve",
+ "plugins": [
+ {
+ "name": "next"
+ }
+ ]
},
"include": ["next-env.d.ts", ".next/types/**/*.ts", "**/*.ts", "**/*.tsx"],
"exc... | true |
Other | vercel | next.js | 4ba1002175397c8ae4432698706fd458f9cf7313.json | Create hash digest for errors in app in production (#41559) | packages/next/server/app-render.tsx | @@ -42,6 +42,7 @@ import { DYNAMIC_ERROR_CODE } from '../client/components/hooks-server-context'
import { NOT_FOUND_ERROR_CODE } from '../client/components/not-found'
import { HeadManagerContext } from '../shared/lib/head-manager-context'
import { Writable } from 'stream'
+import stringHash from 'next/dist/compiled/... | true |
Other | vercel | next.js | 4ba1002175397c8ae4432698706fd458f9cf7313.json | Create hash digest for errors in app in production (#41559) | test/e2e/app-dir/app/app/error/server-component/custom-digest/page.js | @@ -0,0 +1,9 @@
+export const config = {
+ revalidate: 0,
+}
+
+export default function Page() {
+ const err = new Error('this is a test')
+ err.digest = 'custom'
+ throw err
+} | true |
Other | vercel | next.js | 4ba1002175397c8ae4432698706fd458f9cf7313.json | Create hash digest for errors in app in production (#41559) | test/e2e/app-dir/app/app/error/server-component/error.js | @@ -0,0 +1,13 @@
+'use client'
+
+export default function ErrorBoundary({ error, reset }) {
+ return (
+ <>
+ <p id="error-boundary-message">{error.message}</p>
+ <p id="error-boundary-digest">{error.digest}</p>
+ <button id="reset" onClick={() => reset()}>
+ Try again
+ </button>
+ </... | true |
Other | vercel | next.js | 4ba1002175397c8ae4432698706fd458f9cf7313.json | Create hash digest for errors in app in production (#41559) | test/e2e/app-dir/app/app/error/server-component/page.js | @@ -0,0 +1,7 @@
+export const config = {
+ revalidate: 0,
+}
+
+export default function Page() {
+ throw new Error('this is a test')
+} | true |
Other | vercel | next.js | 4ba1002175397c8ae4432698706fd458f9cf7313.json | Create hash digest for errors in app in production (#41559) | test/e2e/app-dir/index.test.ts | @@ -1553,8 +1553,7 @@ describe('app dir', () => {
if (isDev) {
expect(await hasRedbox(browser)).toBe(true)
- console.log('getRedboxHeader', await getRedboxHeader(browser))
- // expect(await getRedboxHeader(browser)).toMatch(/An error occurred: this is a test/)
+ expect(a... | true |
Other | vercel | next.js | fda355daa2b83ac07f51e06d44bbe2615cff0ad9.json | Improve type checking (#41427)
This PR implements the process of generating strict "type guard" files,
to ensure that all entrypoints have the correct export types. The type
checking process happens automatically during `next build`.
## Bug
- [ ] Related issues linked using `fixes #number`
- [ ] Integration t... | packages/next/build/index.ts | @@ -170,7 +170,8 @@ function verifyTypeScriptSetup(
disableStaticImages: boolean,
cacheDir: string | undefined,
numWorkers: number | undefined,
- enableWorkerThreads: boolean | undefined
+ enableWorkerThreads: boolean | undefined,
+ isAppDirEnabled: boolean
) {
const typeCheckWorker = new JestWorker(
... | true |
Other | vercel | next.js | fda355daa2b83ac07f51e06d44bbe2615cff0ad9.json | Improve type checking (#41427)
This PR implements the process of generating strict "type guard" files,
to ensure that all entrypoints have the correct export types. The type
checking process happens automatically during `next build`.
## Bug
- [ ] Related issues linked using `fixes #number`
- [ ] Integration t... | packages/next/build/webpack-config.ts | @@ -47,6 +47,7 @@ import { regexLikeCss } from './webpack/config/blocks/css'
import { CopyFilePlugin } from './webpack/plugins/copy-file-plugin'
import { FlightManifestPlugin } from './webpack/plugins/flight-manifest-plugin'
import { FlightClientEntryPlugin } from './webpack/plugins/flight-client-entry-plugin'
+impo... | true |
Other | vercel | next.js | fda355daa2b83ac07f51e06d44bbe2615cff0ad9.json | Improve type checking (#41427)
This PR implements the process of generating strict "type guard" files,
to ensure that all entrypoints have the correct export types. The type
checking process happens automatically during `next build`.
## Bug
- [ ] Related issues linked using `fixes #number`
- [ ] Integration t... | packages/next/build/webpack/plugins/flight-client-entry-plugin.ts | @@ -17,9 +17,10 @@ import {
EDGE_RUNTIME_WEBPACK,
FLIGHT_SERVER_CSS_MANIFEST,
} from '../../../shared/lib/constants'
-import { FlightCSSManifest, traverseModules } from './flight-manifest-plugin'
+import { FlightCSSManifest } from './flight-manifest-plugin'
import { ASYNC_CLIENT_MODULES } from './flight-manifes... | true |
Other | vercel | next.js | fda355daa2b83ac07f51e06d44bbe2615cff0ad9.json | Improve type checking (#41427)
This PR implements the process of generating strict "type guard" files,
to ensure that all entrypoints have the correct export types. The type
checking process happens automatically during `next build`.
## Bug
- [ ] Related issues linked using `fixes #number`
- [ ] Integration t... | packages/next/build/webpack/plugins/flight-manifest-plugin.ts | @@ -15,6 +15,8 @@ import {
serverModuleIds,
} from './flight-client-entry-plugin'
+import { traverseModules } from '../utils'
+
// This is the module that will be used to anchor all client references to.
// I.e. it will have all the client files as async deps from this point on.
// We use the Flight client imp... | true |
Other | vercel | next.js | fda355daa2b83ac07f51e06d44bbe2615cff0ad9.json | Improve type checking (#41427)
This PR implements the process of generating strict "type guard" files,
to ensure that all entrypoints have the correct export types. The type
checking process happens automatically during `next build`.
## Bug
- [ ] Related issues linked using `fixes #number`
- [ ] Integration t... | packages/next/build/webpack/plugins/flight-types-plugin.ts | @@ -0,0 +1,136 @@
+import path from 'path'
+
+import { webpack, sources } from 'next/dist/compiled/webpack/webpack'
+import { WEBPACK_LAYERS } from '../../../lib/constants'
+
+const PLUGIN_NAME = 'FlightTypesPlugin'
+
+interface Options {
+ dir: string
+ appDir: string
+ dev: boolean
+ isEdgeServer: boolean
+}
+
+f... | true |
Other | vercel | next.js | fda355daa2b83ac07f51e06d44bbe2615cff0ad9.json | Improve type checking (#41427)
This PR implements the process of generating strict "type guard" files,
to ensure that all entrypoints have the correct export types. The type
checking process happens automatically during `next build`.
## Bug
- [ ] Related issues linked using `fixes #number`
- [ ] Integration t... | packages/next/build/webpack/utils.ts | @@ -0,0 +1,29 @@
+import { webpack } from 'next/dist/compiled/webpack/webpack'
+
+export function traverseModules(
+ compilation: webpack.Compilation,
+ callback: (
+ mod: any,
+ chunk: webpack.Chunk,
+ chunkGroup: typeof compilation.chunkGroups[0],
+ modId: string | number
+ ) => any
+) {
+ compilation... | true |
Other | vercel | next.js | fda355daa2b83ac07f51e06d44bbe2615cff0ad9.json | Improve type checking (#41427)
This PR implements the process of generating strict "type guard" files,
to ensure that all entrypoints have the correct export types. The type
checking process happens automatically during `next build`.
## Bug
- [ ] Related issues linked using `fixes #number`
- [ ] Integration t... | packages/next/lib/typescript/diagnosticFormatter.ts | @@ -11,14 +11,123 @@ export enum DiagnosticCategory {
Message = 3,
}
+function getFormattedLayoutAndPageDiagnosticMessageText(
+ baseDir: string,
+ diagnostic: import('typescript').Diagnostic
+) {
+ const message = diagnostic.messageText
+ const sourceFilepath =
+ diagnostic.file?.text.trim().match(/^\/\/ ... | true |
Other | vercel | next.js | fda355daa2b83ac07f51e06d44bbe2615cff0ad9.json | Improve type checking (#41427)
This PR implements the process of generating strict "type guard" files,
to ensure that all entrypoints have the correct export types. The type
checking process happens automatically during `next build`.
## Bug
- [ ] Related issues linked using `fixes #number`
- [ ] Integration t... | packages/next/lib/typescript/runTypeCheck.ts | @@ -21,7 +21,8 @@ export async function runTypeCheck(
ts: typeof import('typescript'),
baseDir: string,
tsConfigPath: string,
- cacheDir?: string
+ cacheDir?: string,
+ isAppDirEnabled?: boolean
): Promise<TypeCheckResult> {
const effectiveConfiguration = await getTypeScriptConfiguration(
ts,
@@ -6... | true |
Other | vercel | next.js | fda355daa2b83ac07f51e06d44bbe2615cff0ad9.json | Improve type checking (#41427)
This PR implements the process of generating strict "type guard" files,
to ensure that all entrypoints have the correct export types. The type
checking process happens automatically during `next build`.
## Bug
- [ ] Related issues linked using `fixes #number`
- [ ] Integration t... | packages/next/lib/typescript/writeConfigurationDefaults.ts | @@ -102,7 +102,8 @@ export function getRequiredConfiguration(
export async function writeConfigurationDefaults(
ts: typeof import('typescript'),
tsConfigPath: string,
- isFirstTimeSetup: boolean
+ isFirstTimeSetup: boolean,
+ isAppDirEnabled: boolean
): Promise<void> {
if (isFirstTimeSetup) {
await f... | true |
Other | vercel | next.js | fda355daa2b83ac07f51e06d44bbe2615cff0ad9.json | Improve type checking (#41427)
This PR implements the process of generating strict "type guard" files,
to ensure that all entrypoints have the correct export types. The type
checking process happens automatically during `next build`.
## Bug
- [ ] Related issues linked using `fixes #number`
- [ ] Integration t... | packages/next/lib/verifyTypeScriptSetup.ts | @@ -42,13 +42,15 @@ export async function verifyTypeScriptSetup({
tsconfigPath,
typeCheckPreflight,
disableStaticImages,
+ isAppDirEnabled,
}: {
dir: string
cacheDir?: string
tsconfigPath: string
intentDirs: string[]
typeCheckPreflight: boolean
disableStaticImages: boolean
+ isAppDirEnable... | true |
Other | vercel | next.js | fda355daa2b83ac07f51e06d44bbe2615cff0ad9.json | Improve type checking (#41427)
This PR implements the process of generating strict "type guard" files,
to ensure that all entrypoints have the correct export types. The type
checking process happens automatically during `next build`.
## Bug
- [ ] Related issues linked using `fixes #number`
- [ ] Integration t... | packages/next/server/dev/next-dev-server.ts | @@ -643,6 +643,7 @@ export default class DevServer extends Server {
typeCheckPreflight: false,
tsconfigPath: this.nextConfig.typescript.tsconfigPath,
disableStaticImages: this.nextConfig.images.disableStaticImages,
+ isAppDirEnabled: !!this.appDir,
})
if (verifyResult.v... | true |
Other | vercel | next.js | fda355daa2b83ac07f51e06d44bbe2615cff0ad9.json | Improve type checking (#41427)
This PR implements the process of generating strict "type guard" files,
to ensure that all entrypoints have the correct export types. The type
checking process happens automatically during `next build`.
## Bug
- [ ] Related issues linked using `fixes #number`
- [ ] Integration t... | test/e2e/app-dir/app-edge/app/app-edge/layout.tsx | @@ -9,7 +9,3 @@ export default function Layout({ children }: { children: React.ReactNode }) {
useSelectedLayoutSegment()
return children
}
-
-export const config = {
- runtime: 'experimental-edge',
-} | true |
Other | vercel | next.js | fda355daa2b83ac07f51e06d44bbe2615cff0ad9.json | Improve type checking (#41427)
This PR implements the process of generating strict "type guard" files,
to ensure that all entrypoints have the correct export types. The type
checking process happens automatically during `next build`.
## Bug
- [ ] Related issues linked using `fixes #number`
- [ ] Integration t... | test/e2e/app-dir/app-edge/tsconfig.json | @@ -19,6 +19,6 @@
"@/ui/*": ["ui/*"]
}
},
- "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
+ "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"exclude": ["node_modules"]
} | true |
Other | vercel | next.js | fda355daa2b83ac07f51e06d44bbe2615cff0ad9.json | Improve type checking (#41427)
This PR implements the process of generating strict "type guard" files,
to ensure that all entrypoints have the correct export types. The type
checking process happens automatically during `next build`.
## Bug
- [ ] Related issues linked using `fixes #number`
- [ ] Integration t... | test/e2e/app-dir/app-typescript/app/inner/page.tsx | @@ -0,0 +1,7 @@
+export default function Page() {
+ return <div>hello</div>
+}
+
+export const config = {
+ runtime: 'nodejs',
+} | true |
Other | vercel | next.js | fda355daa2b83ac07f51e06d44bbe2615cff0ad9.json | Improve type checking (#41427)
This PR implements the process of generating strict "type guard" files,
to ensure that all entrypoints have the correct export types. The type
checking process happens automatically during `next build`.
## Bug
- [ ] Related issues linked using `fixes #number`
- [ ] Integration t... | test/e2e/app-dir/app-typescript/app/layout.js | @@ -0,0 +1,16 @@
+export const config = {
+ revalidate: 0,
+}
+
+// export const revalidate = -1
+
+export default function Root({ children }) {
+ return (
+ <html className="this-is-the-document-html">
+ <head>
+ <title>Hello</title>
+ </head>
+ <body className="this-is-the-document-body">{c... | true |
Other | vercel | next.js | fda355daa2b83ac07f51e06d44bbe2615cff0ad9.json | Improve type checking (#41427)
This PR implements the process of generating strict "type guard" files,
to ensure that all entrypoints have the correct export types. The type
checking process happens automatically during `next build`.
## Bug
- [ ] Related issues linked using `fixes #number`
- [ ] Integration t... | test/e2e/app-dir/app-typescript/next.config.js | @@ -0,0 +1,5 @@
+module.exports = {
+ experimental: {
+ appDir: true,
+ },
+} | true |
Other | vercel | next.js | fda355daa2b83ac07f51e06d44bbe2615cff0ad9.json | Improve type checking (#41427)
This PR implements the process of generating strict "type guard" files,
to ensure that all entrypoints have the correct export types. The type
checking process happens automatically during `next build`.
## Bug
- [ ] Related issues linked using `fixes #number`
- [ ] Integration t... | test/e2e/app-dir/app-typescript/package.json | @@ -0,0 +1,12 @@
+{
+ "name": "app-typescript",
+ "version": "1.0.0",
+ "description": "",
+ "main": "index.js",
+ "scripts": {
+ "test": "echo \"Error: no test specified\" && exit 1"
+ },
+ "keywords": [],
+ "author": "",
+ "license": "ISC"
+} | true |
Other | vercel | next.js | fda355daa2b83ac07f51e06d44bbe2615cff0ad9.json | Improve type checking (#41427)
This PR implements the process of generating strict "type guard" files,
to ensure that all entrypoints have the correct export types. The type
checking process happens automatically during `next build`.
## Bug
- [ ] Related issues linked using `fixes #number`
- [ ] Integration t... | test/e2e/app-dir/app-typescript/tsconfig.json | @@ -0,0 +1,20 @@
+{
+ "compilerOptions": {
+ "target": "es5",
+ "lib": ["dom", "dom.iterable", "esnext"],
+ "allowJs": true,
+ "skipLibCheck": true,
+ "strict": false,
+ "forceConsistentCasingInFileNames": true,
+ "noEmit": true,
+ "incremental": true,
+ "esModuleInterop": true,
+ "module... | true |
Other | vercel | next.js | 9ac231a0b4f4e9cbd8fffe1f9155962f5b212df4.json | chore(examples): upgrade Stripe example (#41550) | examples/with-stripe-typescript/components/Cart.tsx | @@ -1,5 +1,5 @@
import React, { ReactNode } from 'react'
-import { CartProvider } from 'use-shopping-cart/react'
+import { CartProvider } from 'use-shopping-cart'
import * as config from '../config'
const Cart = ({ children }: { children: ReactNode }) => ( | true |
Other | vercel | next.js | 9ac231a0b4f4e9cbd8fffe1f9155962f5b212df4.json | chore(examples): upgrade Stripe example (#41550) | examples/with-stripe-typescript/components/CartSummary.tsx | @@ -2,7 +2,7 @@ import React, { useState, useEffect } from 'react'
import StripeTestCards from '../components/StripeTestCards'
-import { useShoppingCart } from 'use-shopping-cart/react'
+import { useShoppingCart } from 'use-shopping-cart'
import { fetchPostJSON } from '../utils/api-helpers'
const CartSummary =... | true |
Other | vercel | next.js | 9ac231a0b4f4e9cbd8fffe1f9155962f5b212df4.json | chore(examples): upgrade Stripe example (#41550) | examples/with-stripe-typescript/components/ClearCart.tsx | @@ -1,5 +1,5 @@
import { useEffect } from 'react'
-import { useShoppingCart } from 'use-shopping-cart/react'
+import { useShoppingCart } from 'use-shopping-cart'
export default function ClearCart() {
const { clearCart } = useShoppingCart() | true |
Other | vercel | next.js | 9ac231a0b4f4e9cbd8fffe1f9155962f5b212df4.json | chore(examples): upgrade Stripe example (#41550) | examples/with-stripe-typescript/components/Products.tsx | @@ -1,6 +1,6 @@
import products from '../data/products'
import { formatCurrencyString } from 'use-shopping-cart'
-import { useShoppingCart } from 'use-shopping-cart/react'
+import { useShoppingCart } from 'use-shopping-cart'
const Products = () => {
const { addItem, removeItem } = useShoppingCart() | true |
Other | vercel | next.js | 9ac231a0b4f4e9cbd8fffe1f9155962f5b212df4.json | chore(examples): upgrade Stripe example (#41550) | examples/with-stripe-typescript/package.json | @@ -6,22 +6,23 @@
"start": "next start"
},
"dependencies": {
- "@stripe/react-stripe-js": "1.7.0",
- "@stripe/stripe-js": "1.22.0",
- "micro": "^9.3.4",
+ "@stripe/react-stripe-js": "1.13.0",
+ "@stripe/stripe-js": "1.42.0",
+ "micro": "^9.4.1",
"micro-cors": "^0.1.1",
"next": "la... | true |
Other | vercel | next.js | 7bde099a43f2c39730107c326c2c494bef484f0d.json | chore: Update swc_core to `v0.39.7` (#41544)
This PR updates swc crates to https://github.com/swc-project/swc/commit/287c2f2941c0f9858533f8eb6059f0d32fa29dbc
- Closes https://github.com/vercel/next.js/issues/41527. | packages/next-swc/Cargo.lock | @@ -165,9 +165,9 @@ dependencies = [
[[package]]
name = "binding_macros"
-version = "0.20.33"
+version = "0.20.40"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5dd93110b899b44eaf4a68f6c1f0e2f9bdb7f6ce8b3c5a33f90b6e0240617629"
+checksum = "7f0239cba0f7a458f594af9d3dd3b1797fae99ff208... | true |
Other | vercel | next.js | 7bde099a43f2c39730107c326c2c494bef484f0d.json | chore: Update swc_core to `v0.39.7` (#41544)
This PR updates swc crates to https://github.com/swc-project/swc/commit/287c2f2941c0f9858533f8eb6059f0d32fa29dbc
- Closes https://github.com/vercel/next.js/issues/41527. | packages/next-swc/crates/core/Cargo.toml | @@ -42,9 +42,9 @@ swc_core = { features = [
"ecma_parser_typescript",
"cached",
"base"
-], version = "0.38.22" }
+], version = "0.39.7" }
[dev-dependencies]
-swc_core = { features = ["testing_transform"], version = "0.38.22" }
-testing = "0.31.8"
+swc_core = { features = ["testing_transform"], version = "0.... | true |
Other | vercel | next.js | 7bde099a43f2c39730107c326c2c494bef484f0d.json | chore: Update swc_core to `v0.39.7` (#41544)
This PR updates swc crates to https://github.com/swc-project/swc/commit/287c2f2941c0f9858533f8eb6059f0d32fa29dbc
- Closes https://github.com/vercel/next.js/issues/41527. | packages/next-swc/crates/emotion/Cargo.toml | @@ -19,9 +19,9 @@ regex = "1.5"
serde = "1"
sourcemap = "6.0.1"
tracing = { version = "0.1.32", features = ["release_max_level_info"] }
-swc_core = { features = ["common", "ecma_ast","ecma_codegen", "ecma_utils", "ecma_visit", "trace_macro"], version = "0.38.22" }
+swc_core = { features = ["common", "ecma_ast","ecma... | true |
Other | vercel | next.js | 7bde099a43f2c39730107c326c2c494bef484f0d.json | chore: Update swc_core to `v0.39.7` (#41544)
This PR updates swc crates to https://github.com/swc-project/swc/commit/287c2f2941c0f9858533f8eb6059f0d32fa29dbc
- Closes https://github.com/vercel/next.js/issues/41527. | packages/next-swc/crates/modularize_imports/Cargo.toml | @@ -15,8 +15,8 @@ handlebars = "4.2.1"
once_cell = "1.13.0"
regex = "1.5"
serde = "1"
-swc_core = { features = ["cached", "ecma_ast", "ecma_visit"], version = "0.38.22" }
+swc_core = { features = ["cached", "ecma_ast", "ecma_visit"], version = "0.39.7" }
[dev-dependencies]
-swc_core = { features = ["testing_trans... | true |
Other | vercel | next.js | 7bde099a43f2c39730107c326c2c494bef484f0d.json | chore: Update swc_core to `v0.39.7` (#41544)
This PR updates swc crates to https://github.com/swc-project/swc/commit/287c2f2941c0f9858533f8eb6059f0d32fa29dbc
- Closes https://github.com/vercel/next.js/issues/41527. | packages/next-swc/crates/napi/Cargo.toml | @@ -50,7 +50,7 @@ swc_core = { features = [
"ecma_transforms_typescript",
"ecma_utils",
"ecma_visit",
-], version = "0.38.22" }
+], version = "0.39.7" }
tracing = { version = "0.1.32", features = ["release_max_level_info"] }
tracing-futures = "0.2.5"
tracing-subscriber = "0.3.9" | true |
Other | vercel | next.js | 7bde099a43f2c39730107c326c2c494bef484f0d.json | chore: Update swc_core to `v0.39.7` (#41544)
This PR updates swc crates to https://github.com/swc-project/swc/commit/287c2f2941c0f9858533f8eb6059f0d32fa29dbc
- Closes https://github.com/vercel/next.js/issues/41527. | packages/next-swc/crates/styled_components/Cargo.toml | @@ -21,13 +21,13 @@ swc_core = { features = [
"ecma_ast",
"ecma_utils",
"ecma_visit"
-], version = "0.38.22" }
+], version = "0.39.7" }
[dev-dependencies]
serde_json = "1"
-testing = "0.31.8"
+testing = "0.31.9"
swc_core = { features = [
"ecma_parser",
"ecma_transforms",
"testing_transform"
-], v... | true |
Other | vercel | next.js | 7bde099a43f2c39730107c326c2c494bef484f0d.json | chore: Update swc_core to `v0.39.7` (#41544)
This PR updates swc crates to https://github.com/swc-project/swc/commit/287c2f2941c0f9858533f8eb6059f0d32fa29dbc
- Closes https://github.com/vercel/next.js/issues/41527. | packages/next-swc/crates/styled_jsx/Cargo.toml | @@ -24,10 +24,10 @@ swc_core = { features = [
"ecma_minifier",
"ecma_utils",
"ecma_visit"
-], version = "0.38.22" }
+], version = "0.39.7" }
[dev-dependencies]
-testing = "0.31.8"
+testing = "0.31.9"
swc_core = { features = [
"testing_transform"
-], version = "0.38.22" }
+], version = "0.39.7" } | true |
Other | vercel | next.js | 7bde099a43f2c39730107c326c2c494bef484f0d.json | chore: Update swc_core to `v0.39.7` (#41544)
This PR updates swc crates to https://github.com/swc-project/swc/commit/287c2f2941c0f9858533f8eb6059f0d32fa29dbc
- Closes https://github.com/vercel/next.js/issues/41527. | packages/next-swc/crates/wasm/Cargo.toml | @@ -45,7 +45,7 @@ swc_core = { features = [
"ecma_parser_typescript",
"ecma_utils",
"ecma_visit"
-], version = "0.38.22" }
+], version = "0.39.7" }
# Workaround a bug | true |
Other | vercel | next.js | 3e2aec5e767a580a2cc9510a72f72913006a8a4d.json | Fix E2E deploy test for API bodies (#41542)
Fixes:
https://github.com/vercel/next.js/actions/runs/3275381974/jobs/5390966319 | test/e2e/middleware-fetches-with-body/index.test.ts | @@ -64,7 +64,10 @@ describe('Middleware fetches with body', () => {
)
expect(res.status).toBe(413)
- expect(res.statusText).toBe('Body exceeded 1mb limit')
+
+ if (!(global as any).isNextDeploy) {
+ expect(res.statusText).toBe('Body exceeded 1mb limit')
+ }
})
it('shoul... | false |
Other | vercel | next.js | 17773a1cf3b087f0c4dee75b07b9f9c5fa70c4ce.json | Fix links to `next/legacy/image` demo (#41539)
This PR fixes links to `next/legacy/image` (demo, deploy, etc) | docs/api-reference/next/legacy/image.md | @@ -89,18 +89,18 @@ The layout behavior of the image as the viewport changes size.
| `responsive` | Scale to fit width of container | `640w`, `750w`, ... `2048w`, `3840w` (based on [imageSizes](#image-sizes) and [deviceSizes](#device-sizes)) | `100vw` | yes |
| `fil... | true |
Other | vercel | next.js | 17773a1cf3b087f0c4dee75b07b9f9c5fa70c4ce.json | Fix links to `next/legacy/image` demo (#41539)
This PR fixes links to `next/legacy/image` (demo, deploy, etc) | docs/basic-features/image-optimization.md | @@ -193,7 +193,7 @@ This is the default for `<div>` elements but should be specified otherwise.
### Styling Examples
-For examples of the Image component used with the various styles, see the [Image component example app](https://image-component.nextjs.gallery).
+For examples of the Image component used with the v... | true |
Other | vercel | next.js | 17773a1cf3b087f0c4dee75b07b9f9c5fa70c4ce.json | Fix links to `next/legacy/image` demo (#41539)
This PR fixes links to `next/legacy/image` (demo, deploy, etc) | examples/image-component/README.md | @@ -6,7 +6,7 @@ The index page ([`pages/index.js`](pages/index.js)) has a couple images, one int
## Live demo
-[https://image-component.nextjs.gallery/](https://image-component.nextjs.gallery/)
+[https://image-component.nextjs.gallery](https://image-component.nextjs.gallery)
## Deploy your own
| true |
Other | vercel | next.js | 17773a1cf3b087f0c4dee75b07b9f9c5fa70c4ce.json | Fix links to `next/legacy/image` demo (#41539)
This PR fixes links to `next/legacy/image` (demo, deploy, etc) | examples/image-legacy-component/README.md | @@ -1,29 +1,29 @@
-# Image Component Example
+# Legacy Image Component Example
-This example shows how to use the [Image Component in Next.js](https://nextjs.org/docs/api-reference/next/image) serve optimized, responsive images.
+This example shows how to use the [Legacy Image Component in Next.js](https://nextjs.org... | true |
Other | vercel | next.js | ebae05eeedde21cced6dfb325a184da74e739e20.json | Update edge runtime to 1.1.0-beta.40 (#41513)
changes: https://github.com/vercel/edge-runtime/compare/edge-runtime@1.1.0-beta.39...edge-runtime@1.1.0-beta.40 | package.json | @@ -57,7 +57,7 @@
"@babel/plugin-proposal-object-rest-spread": "7.14.7",
"@babel/preset-flow": "7.14.5",
"@babel/preset-react": "7.14.5",
- "@edge-runtime/jest-environment": "1.1.0-beta.35",
+ "@edge-runtime/jest-environment": "1.1.0-beta.36",
"@fullhuman/postcss-purgecss": "1.3.0",
"@mdx... | true |
Other | vercel | next.js | ebae05eeedde21cced6dfb325a184da74e739e20.json | Update edge runtime to 1.1.0-beta.40 (#41513)
changes: https://github.com/vercel/edge-runtime/compare/edge-runtime@1.1.0-beta.39...edge-runtime@1.1.0-beta.40 | packages/next/compiled/@edge-runtime/primitives/console.js | @@ -121,8 +121,11 @@ var require_dist = __commonJS({
return typeof value === type;
}
__name(kind, "kind");
- var getConstructorName = /* @__PURE__ */ __name((object) => object.constructor.name, "getConstructorName");
- var getPrefix = /* @__PURE__ */ __name((constructor, size = "") => `${construc... | true |
Other | vercel | next.js | ebae05eeedde21cced6dfb325a184da74e739e20.json | Update edge runtime to 1.1.0-beta.40 (#41513)
changes: https://github.com/vercel/edge-runtime/compare/edge-runtime@1.1.0-beta.39...edge-runtime@1.1.0-beta.40 | packages/next/compiled/@edge-runtime/primitives/package.json | @@ -1 +1 @@
-{"name":"@edge-runtime/primitives","version":"1.1.0-beta.36","main":"./index.js","license":"MPLv2"}
+{"name":"@edge-runtime/primitives","version":"1.1.0-beta.37","main":"./index.js","license":"MPLv2"} | true |
Other | vercel | next.js | ebae05eeedde21cced6dfb325a184da74e739e20.json | Update edge runtime to 1.1.0-beta.40 (#41513)
changes: https://github.com/vercel/edge-runtime/compare/edge-runtime@1.1.0-beta.39...edge-runtime@1.1.0-beta.40 | packages/next/compiled/edge-runtime/index.js | @@ -1 +1 @@
-(()=>{var __webpack_modules__={543:(__unused_webpack_module,exports,__nccwpck_require__)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.EdgeVM=void 0;const buffer_1=__nccwpck_require__(300);const require_1=__nccwpck_require__(246);const vm_1=__nccwpck_require__(256);const v... | true |
Other | vercel | next.js | ebae05eeedde21cced6dfb325a184da74e739e20.json | Update edge runtime to 1.1.0-beta.40 (#41513)
changes: https://github.com/vercel/edge-runtime/compare/edge-runtime@1.1.0-beta.39...edge-runtime@1.1.0-beta.40 | packages/next/package.json | @@ -121,7 +121,7 @@
"@babel/runtime": "7.15.4",
"@babel/traverse": "7.18.0",
"@babel/types": "7.18.0",
- "@edge-runtime/primitives": "1.1.0-beta.36",
+ "@edge-runtime/primitives": "1.1.0-beta.37",
"@hapi/accept": "5.0.2",
"@napi-rs/cli": "2.12.0",
"@napi-rs/triples": "1.1.0",
@@ -204... | true |
Other | vercel | next.js | ebae05eeedde21cced6dfb325a184da74e739e20.json | Update edge runtime to 1.1.0-beta.40 (#41513)
changes: https://github.com/vercel/edge-runtime/compare/edge-runtime@1.1.0-beta.39...edge-runtime@1.1.0-beta.40 | pnpm-lock.yaml | @@ -18,7 +18,7 @@ importers:
'@babel/plugin-proposal-object-rest-spread': 7.14.7
'@babel/preset-flow': 7.14.5
'@babel/preset-react': 7.14.5
- '@edge-runtime/jest-environment': 1.1.0-beta.35
+ '@edge-runtime/jest-environment': 1.1.0-beta.36
'@fullhuman/postcss-purgecss': 1.3.0
... | true |
Other | vercel | next.js | df0e61b023a0fd75b57fbd184be67e42048b991e.json | Fix app sc_client componet HMR server-side (#41510)
This ensures we properly clear the `sc_client` component cache from
`react-server-dom-webpack` in development so that HMR works properly
after a refresh.
## Bug
- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors hav... | packages/next/build/webpack/plugins/nextjs-require-cache-hot-reloader.ts | @@ -68,15 +68,33 @@ export class NextJsRequireCacheHotReloader implements WebpackPluginInstance {
)
deleteCache(runtimeChunkPath)
})
+ let hasAppPath = false
// we need to make sure to clear all server entries from cache
// since they can have a stale webpack-runtime cache
... | true |
Other | vercel | next.js | df0e61b023a0fd75b57fbd184be67e42048b991e.json | Fix app sc_client componet HMR server-side (#41510)
This ensures we properly clear the `sc_client` component cache from
`react-server-dom-webpack` in development so that HMR works properly
after a refresh.
## Bug
- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors hav... | packages/next/server/app-render.tsx | @@ -8,7 +8,6 @@ import type { FontLoaderManifest } from '../build/webpack/plugins/font-loader-ma
import React, { experimental_use as use } from 'react'
import { ParsedUrlQuery } from 'querystring'
-import { createFromReadableStream } from 'next/dist/compiled/react-server-dom-webpack'
import { NextParsedUrlQuery } ... | true |
Other | vercel | next.js | df0e61b023a0fd75b57fbd184be67e42048b991e.json | Fix app sc_client componet HMR server-side (#41510)
This ensures we properly clear the `sc_client` component cache from
`react-server-dom-webpack` in development so that HMR works properly
after a refresh.
## Bug
- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors hav... | test/e2e/app-dir/index.test.ts | @@ -1197,6 +1197,50 @@ describe('app dir', () => {
})
if (isDev) {
+ it('should HMR correctly for client component', async () => {
+ const filePath = 'app/client-component-route/page.js'
+ const origContent = await next.readFile(filePath)
+
+ try {
+ const br... | true |
Other | vercel | next.js | 366da263dfdcb546091de787ee7c238dbbfbce7d.json | Append the fragment in NextUrl.toString() (#41501)
<!--
Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change that you're making:
-->
Consider the... | packages/next/server/web/next-url.ts | @@ -181,7 +181,7 @@ export class NextURL {
get href() {
const pathname = this.formatPathname()
const search = this.formatSearch()
- return `${this.protocol}//${this.host}${pathname}${search}`
+ return `${this.protocol}//${this.host}${pathname}${search}${this.hash}`
}
set href(url: string) { | true |
Other | vercel | next.js | 366da263dfdcb546091de787ee7c238dbbfbce7d.json | Append the fragment in NextUrl.toString() (#41501)
<!--
Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change that you're making:
-->
Consider the... | test/e2e/middleware-redirects/app/middleware.js | @@ -75,4 +75,9 @@ export async function middleware(request) {
url.searchParams.delete('pathname')
return Response.redirect(url)
}
+
+ if (url.pathname === '/with-fragment') {
+ console.log(String(new URL('/new-home#fragment', url)))
+ return Response.redirect(new URL('/new-home#fragment', url))
+ }... | true |
Other | vercel | next.js | 366da263dfdcb546091de787ee7c238dbbfbce7d.json | Append the fragment in NextUrl.toString() (#41501)
<!--
Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change that you're making:
-->
Consider the... | test/e2e/middleware-redirects/test/index.test.ts | @@ -157,6 +157,20 @@ describe('Middleware Redirect', () => {
.join('\n')
expect(errors).not.toContain('Failed to lookup route')
})
+
+ // A regression test for https://github.com/vercel/next.js/pull/41501
+ it(`${label}should redirect with a fragment`, async () => {
+ const res = await f... | true |
Other | vercel | next.js | 366da263dfdcb546091de787ee7c238dbbfbce7d.json | Append the fragment in NextUrl.toString() (#41501)
<!--
Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change that you're making:
-->
Consider the... | test/unit/web-runtime/next-url.test.ts | @@ -39,6 +39,15 @@ it('does noop changing to an invalid hostname', () => {
expect(url.toString()).toEqual('https://foo.com/example')
})
+it('preserves the fragment', () => {
+ const url = new NextURL(
+ 'https://example.com/path/to?param1=value1#this-is-fragment'
+ )
+ expect(url.toString()).toEqual(
+ '... | true |
Other | vercel | next.js | ec94e68cc74bf1b0fd53c86ae2651484c0165854.json | examples(with-routes-graphql): update GraphQL Yoga to v3 (#41478)
Update the `with-routes-graphql` example to [GraphQL Yoga](https://www.the-guild.dev/graphql/yoga-server/) new major ([migration guide](https://www.the-guild.dev/graphql/yoga-server/v3/migration/migration-from-yoga-v2)). | examples/api-routes-graphql/package.json | @@ -6,7 +6,7 @@
"start": "next start"
},
"dependencies": {
- "@graphql-yoga/node": "^2.11.2",
+ "graphql-yoga": "three",
"graphql": "^16.5.0",
"next": "latest",
"react": "^18.2.0", | true |
Other | vercel | next.js | ec94e68cc74bf1b0fd53c86ae2651484c0165854.json | examples(with-routes-graphql): update GraphQL Yoga to v3 (#41478)
Update the `with-routes-graphql` example to [GraphQL Yoga](https://www.the-guild.dev/graphql/yoga-server/) new major ([migration guide](https://www.the-guild.dev/graphql/yoga-server/v3/migration/migration-from-yoga-v2)). | examples/api-routes-graphql/pages/api/graphql.ts | @@ -1,4 +1,4 @@
-import { createServer } from '@graphql-yoga/node'
+import { createYoga, createSchema } from 'graphql-yoga'
const typeDefs = /* GraphQL */ `
type Query {
@@ -17,13 +17,13 @@ const resolvers = {
},
}
-const server = createServer({
- schema: {
- typeDefs,
- resolvers,
- },
- endpoint:... | true |
Other | vercel | next.js | ce60157b1b1e7dd7dec72b7eadb67a96c2fb02b8.json | Fix useSearchParams comment (#41483)
Co-authored-by: Balázs Orbán <info@balazsorban.com> | packages/next/client/components/navigation.ts | @@ -69,7 +69,8 @@ class ReadonlyURLSearchParams {
}
/**
- * Get the current search params. For example useSearchParams() would return {"foo": "bar"} when ?foo=bar
+ * Get a read-only URLSearchParams object. For example searchParams.get('foo') would return 'bar' when ?foo=bar
+ * Learn more about URLSearchParams her... | false |
Other | vercel | next.js | 7a8c58fedd7c9aea5d8792ed2b30b9b05d8a8348.json | chore: Update swc_core to `v0.38.22` (#41477) | packages/next-swc/Cargo.lock | @@ -165,9 +165,9 @@ dependencies = [
[[package]]
name = "binding_macros"
-version = "0.20.20"
+version = "0.20.33"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "eab1d6bd87bf67f9852300862e3c8cb13be773bd4d4f36e3bba2a7f1bf143bcd"
+checksum = "5dd93110b899b44eaf4a68f6c1f0e2f9bdb7f6ce8b3... | true |
Other | vercel | next.js | 7a8c58fedd7c9aea5d8792ed2b30b9b05d8a8348.json | chore: Update swc_core to `v0.38.22` (#41477) | packages/next-swc/crates/core/Cargo.toml | @@ -42,9 +42,9 @@ swc_core = { features = [
"ecma_parser_typescript",
"cached",
"base"
-], version = "0.38.4" }
+], version = "0.38.22" }
[dev-dependencies]
-swc_core = { features = ["testing_transform"], version = "0.38.4" }
+swc_core = { features = ["testing_transform"], version = "0.38.22" }
testing = "... | true |
Other | vercel | next.js | 7a8c58fedd7c9aea5d8792ed2b30b9b05d8a8348.json | chore: Update swc_core to `v0.38.22` (#41477) | packages/next-swc/crates/emotion/Cargo.toml | @@ -19,9 +19,9 @@ regex = "1.5"
serde = "1"
sourcemap = "6.0.1"
tracing = { version = "0.1.32", features = ["release_max_level_info"] }
-swc_core = { features = ["common", "ecma_ast","ecma_codegen", "ecma_utils", "ecma_visit", "trace_macro"], version = "0.38.4" }
+swc_core = { features = ["common", "ecma_ast","ecma_... | true |
Other | vercel | next.js | 7a8c58fedd7c9aea5d8792ed2b30b9b05d8a8348.json | chore: Update swc_core to `v0.38.22` (#41477) | packages/next-swc/crates/modularize_imports/Cargo.toml | @@ -15,8 +15,8 @@ handlebars = "4.2.1"
once_cell = "1.13.0"
regex = "1.5"
serde = "1"
-swc_core = { features = ["cached", "ecma_ast", "ecma_visit"], version = "0.38.4" }
+swc_core = { features = ["cached", "ecma_ast", "ecma_visit"], version = "0.38.22" }
[dev-dependencies]
-swc_core = { features = ["testing_trans... | true |
Other | vercel | next.js | 7a8c58fedd7c9aea5d8792ed2b30b9b05d8a8348.json | chore: Update swc_core to `v0.38.22` (#41477) | packages/next-swc/crates/napi/Cargo.toml | @@ -50,7 +50,7 @@ swc_core = { features = [
"ecma_transforms_typescript",
"ecma_utils",
"ecma_visit",
-], version = "0.38.4" }
+], version = "0.38.22" }
tracing = { version = "0.1.32", features = ["release_max_level_info"] }
tracing-futures = "0.2.5"
tracing-subscriber = "0.3.9" | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.