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 | 24df675c32daf34e02fc8ce0254cd811cbc23561.json | Authenticate npm before publishing native packages (#28041) | .github/workflows/build_test_deploy.yml | @@ -265,6 +265,7 @@ jobs:
with:
name: next-swc-binaries
path: packages/next/build/swc/dist
+ - run: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
- run: ./scripts/publish-native.js $GITHUB_REF
- run: ./scripts/publish-release.sh
| true |
Other | vercel | next.js | 24df675c32daf34e02fc8ce0254cd811cbc23561.json | Authenticate npm before publishing native packages (#28041) | scripts/publish-release.sh | @@ -12,8 +12,6 @@ if [[ -z "$NPM_TOKEN" ]];then
exit 0;
fi
-echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
-
if [[ $(git describe --exact-match 2> /dev/null || :) =~ -canary ]];
then
echo "Publishing canary" | true |
Other | vercel | next.js | 9bf322503b3c1fdd94e28a399e72e7147e1d0c4d.json | Add missing fields to `NextConfig` type (#27974)
This PR adds the `poweredByHeader` and `webpack` fields to the public `NextConfig` type.
## Bug
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`
## Feature
- [ ] Implements... | packages/next/build/entries.ts | @@ -91,7 +91,7 @@ export function createEntrypoints(
buildId,
assetPrefix: config.assetPrefix,
generateEtags: config.generateEtags ? 'true' : '',
- poweredByHeader: config.poweredByHeader,
+ poweredByHeader: config.poweredByHeader ? 'true' : '',
canonicalBase: config.amp.canonicalBase || '',
... | true |
Other | vercel | next.js | 9bf322503b3c1fdd94e28a399e72e7147e1d0c4d.json | Add missing fields to `NextConfig` type (#27974)
This PR adds the `poweredByHeader` and `webpack` fields to the public `NextConfig` type.
## Bug
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`
## Feature
- [ ] Implements... | packages/next/server/config-shared.ts | @@ -48,6 +48,22 @@ export type NextConfig = { [key: string]: any } & {
webpack5?: false
excludeDefaultMomentLocales?: boolean
+ webpack?:
+ | ((
+ config: any,
+ context: {
+ dir: string
+ dev: boolean
+ isServer: boolean
+ buildId: string
+ config:... | true |
Other | vercel | next.js | e61ea6f27b7bf34b00ffd3f59f2326b3bbbdfa48.json | Add manifest check step and add missing items (#27934) | .github/workflows/build_test_deploy.yml | @@ -41,6 +41,7 @@ jobs:
with:
path: ./*
key: ${{ github.sha }}
+ - run: ./scripts/check-manifests.js
- run: yarn lint
checkPrecompiled: | true |
Other | vercel | next.js | e61ea6f27b7bf34b00ffd3f59f2326b3bbbdfa48.json | Add manifest check step and add missing items (#27934) | errors/manifest.json | @@ -430,6 +430,14 @@
{
"title": "sharp-missing-in-production",
"path": "/errors/sharp-missing-in-production.md"
+ },
+ {
+ "title": "max-custom-routes-reached",
+ "path": "/errors/max-custom-routes-reached.md"
+ },
+ {
+ "title": "mod... | true |
Other | vercel | next.js | e61ea6f27b7bf34b00ffd3f59f2326b3bbbdfa48.json | Add manifest check step and add missing items (#27934) | scripts/check-manifests.js | @@ -0,0 +1,55 @@
+#!/usr/bin/env node
+
+const fs = require('fs')
+const path = require('path')
+const globOrig = require('glob')
+const { promisify } = require('util')
+const glob = promisify(globOrig)
+
+function collectPaths(routes, paths = []) {
+ for (const route of routes) {
+ if (route.path) {
+ paths.p... | true |
Other | vercel | next.js | 3c837ed1759a8009daec19327b8f02ada891822a.json | test(next): add tests for Node-like hashbang support (#27906)
* update to webpack 5.50.0
* feat: use shebang loader shim for now
* chore: snapshot formatting change
* chore: remove unneeded SSR test
* chore: test all file extensions
* chore: remove shebang loader from Webpack config
* chore: revert u... | test/integration/hashbang/src/cases/cjs.cjs | @@ -0,0 +1,3 @@
+#!/usr/env node
+
+module.exports = 789 | true |
Other | vercel | next.js | 3c837ed1759a8009daec19327b8f02ada891822a.json | test(next): add tests for Node-like hashbang support (#27906)
* update to webpack 5.50.0
* feat: use shebang loader shim for now
* chore: snapshot formatting change
* chore: remove unneeded SSR test
* chore: test all file extensions
* chore: remove shebang loader from Webpack config
* chore: revert u... | test/integration/hashbang/src/cases/js.js | @@ -0,0 +1,3 @@
+#!/usr/env node
+
+module.exports = 123 | true |
Other | vercel | next.js | 3c837ed1759a8009daec19327b8f02ada891822a.json | test(next): add tests for Node-like hashbang support (#27906)
* update to webpack 5.50.0
* feat: use shebang loader shim for now
* chore: snapshot formatting change
* chore: remove unneeded SSR test
* chore: test all file extensions
* chore: remove shebang loader from Webpack config
* chore: revert u... | test/integration/hashbang/src/cases/mjs.mjs | @@ -0,0 +1,3 @@
+#!/usr/env node
+
+export default 456 | true |
Other | vercel | next.js | 3c837ed1759a8009daec19327b8f02ada891822a.json | test(next): add tests for Node-like hashbang support (#27906)
* update to webpack 5.50.0
* feat: use shebang loader shim for now
* chore: snapshot formatting change
* chore: remove unneeded SSR test
* chore: test all file extensions
* chore: remove shebang loader from Webpack config
* chore: revert u... | test/integration/hashbang/src/pages/index.js | @@ -0,0 +1,20 @@
+/**
+ * Import hashbang modules.
+ */
+import js from '../cases/js.js'
+import cjs from '../cases/cjs.cjs'
+import mjs from '../cases/mjs.mjs'
+
+const jsMsg = `JS: ${js}`
+const mjsMsg = `MJS: ${mjs}`
+const cjsMsg = `CJS: ${cjs}`
+
+const Page = () => (
+ <div>
+ <h3>{jsMsg}</h3>
+ <h3>{mjsMs... | true |
Other | vercel | next.js | 3c837ed1759a8009daec19327b8f02ada891822a.json | test(next): add tests for Node-like hashbang support (#27906)
* update to webpack 5.50.0
* feat: use shebang loader shim for now
* chore: snapshot formatting change
* chore: remove unneeded SSR test
* chore: test all file extensions
* chore: remove shebang loader from Webpack config
* chore: revert u... | test/integration/hashbang/test/index.test.js | @@ -0,0 +1,63 @@
+/* eslint-env jest */
+
+import { join } from 'path'
+import fs from 'fs-extra'
+import {
+ renderViaHTTP,
+ findPort,
+ launchApp,
+ killApp,
+ nextBuild,
+ nextStart,
+} from 'next-test-utils'
+
+jest.setTimeout(1000 * 60 * 2)
+
+let app
+let appPort
+const appDir = join(__dirname, '../')
+
+f... | true |
Other | vercel | next.js | 2fa96822e70b80867b64b38af522601d9c0af38b.json | Fix warning `next/future/image` semicolon (#38454)
## Bug
- [x] Fixes #38404
- [x] Fixes #38431
- [x] Integration tests updated | packages/next/client/future/image.tsx | @@ -507,7 +507,7 @@ export default function Image({
}
}
const imgStyle = Object.assign({}, style)
- const svgBlurPlaceholder = `url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http%3A//www.w3.org/2000/svg' viewBox='0 0 ${widthInt} ${heightInt}'%3E%3Cfilter id='b' color-interpolation-filters='sRGB'%3E%3C... | true |
Other | vercel | next.js | 2fa96822e70b80867b64b38af522601d9c0af38b.json | Fix warning `next/future/image` semicolon (#38454)
## Bug
- [x] Fixes #38404
- [x] Fixes #38431
- [x] Integration tests updated | test/integration/image-future/base-path/test/static.test.js | @@ -65,7 +65,7 @@ const runTests = () => {
})
it('Should add a blur to a statically imported image', async () => {
expect(html).toContain(
- `style="background-size:cover;background-position:0% 0%;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http%3A//www.w3.org/2000/svg... | true |
Other | vercel | next.js | 2fa96822e70b80867b64b38af522601d9c0af38b.json | Fix warning `next/future/image` semicolon (#38454)
## Bug
- [x] Fixes #38404
- [x] Fixes #38431
- [x] Integration tests updated | test/integration/image-future/default/test/static.test.js | @@ -65,7 +65,7 @@ const runTests = () => {
})
it('Should add a blur to a statically imported image in "raw" mode', async () => {
expect(html).toContain(
- `style="background-size:cover;background-position:0% 0%;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http%3A//www.w... | true |
Other | vercel | next.js | 65ea43f6d5bf6b1245835de02ad9974efa040a07.json | docs: add trpc to examples (#38272)
## Documentation / Examples
- [x] Make sure the linting passes by running `pnpm lint`
- [x] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)
Nice to have nextjs up to date always!
Co-... | examples/with-trpc/README.md | @@ -0,0 +1,13 @@
+# Next.js + tRPC
+
+## Next.js + tRPC + Prisma starter
+
+- https://github.com/trpc/examples-next-prisma-starter
+
+## Next.js + tRPC + Prisma starter with websockets
+
+- https://github.com/trpc/examples-next-prisma-starter-websockets
+
+## Next.js + tRPC minimal implementation
+
+- https://github.co... | false |
Other | vercel | next.js | 34e296be2d905d521d25338b7c4838b49a824458.json | fix(examples/with-playwritght): use PORT env variable and fall back to 3000 (#38107)
## Documentation / Examples
- [x] Related issues linked using `fixes #37952`
- [x] Make sure the linting passes by running `pnpm lint`
- [x] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/n... | examples/with-playwright/playwright.config.ts | @@ -1,6 +1,12 @@
import { PlaywrightTestConfig, devices } from '@playwright/test'
import path from 'path'
+// Use process.env.PORT by default and fallback to port 3000
+const PORT = process.env.PORT || 3000
+
+// Set webServer.url and use.baseURL with the location of the WebServer respecting the correct set port
+c... | false |
Other | vercel | next.js | b421fa27fb95f0fed763f9af7b7edab26cf37d85.json | Add support for optional catchall with new router (#38444)
Follow-up of #38439.
Found a small issue with booting `next start` that is now resolved.
Also added optional catchall routes support.
## Bug
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link att... | packages/next/build/webpack/plugins/pages-manifest-plugin.ts | @@ -10,8 +10,8 @@ export type PagesManifest = { [page: string]: string }
let edgeServerPages = {}
let nodeServerPages = {}
-let edgeServerRootPaths = {}
-let nodeServerRootPaths = {}
+let edgeServerAppPaths = {}
+let nodeServerAppPaths = {}
// This plugin creates a pages-manifest.json from page entrypoints.
// ... | true |
Other | vercel | next.js | b421fa27fb95f0fed763f9af7b7edab26cf37d85.json | Add support for optional catchall with new router (#38444)
Follow-up of #38439.
Found a small issue with booting `next start` that is now resolved.
Also added optional catchall routes support.
## Bug
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link att... | packages/next/server/app-render.tsx | @@ -299,6 +299,34 @@ export type ChildProp = {
segment: Segment
}
+function getSegmentParam(segment: string): {
+ param: string
+ type: 'catchall' | 'optional-catchall' | 'dynamic'
+} | null {
+ if (segment.startsWith('[[...') && segment.endsWith(']]')) {
+ return {
+ type: 'optional-catchall',
+ ... | true |
Other | vercel | next.js | b421fa27fb95f0fed763f9af7b7edab26cf37d85.json | Add support for optional catchall with new router (#38444)
Follow-up of #38439.
Found a small issue with booting `next start` that is now resolved.
Also added optional catchall routes support.
## Bug
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link att... | packages/next/server/base-server.ts | @@ -36,6 +36,7 @@ import { format as formatUrl, parse as parseUrl } from 'url'
import { getRedirectStatus } from '../lib/load-custom-routes'
import {
NEXT_BUILTIN_DOCUMENT,
+ NEXT_CLIENT_SSR_ENTRY_SUFFIX,
SERVERLESS_DIRECTORY,
SERVER_DIRECTORY,
STATIC_STATUS_PAGES,
@@ -1026,33 +1027,14 @@ export default ... | true |
Other | vercel | next.js | b421fa27fb95f0fed763f9af7b7edab26cf37d85.json | Add support for optional catchall with new router (#38444)
Follow-up of #38439.
Found a small issue with booting `next start` that is now resolved.
Also added optional catchall routes support.
## Bug
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link att... | packages/next/server/require.ts | @@ -28,9 +28,6 @@ export function getPagePath(
let rootPathsManifest: undefined | PagesManifest
if (appDirEnabled) {
- if (page === '/_root') {
- return join(serverBuildPath, 'root.js')
- }
rootPathsManifest = require(join(serverBuildPath, APP_PATHS_MANIFEST))
}
const pagesManifest = requi... | true |
Other | vercel | next.js | 41bedf67db7338f09960bb4283ce4d3e1dfb0a7f.json | Add support for catchall with new router (#38439)
Adds support for `[...slug]` dynamic segments.
I found there's an inconsistency in query/params providing and added a quick fix for it now. Will update the handling in a follow-up PR to ensure it's consistently providing dynamic params outside of `query`.
Follow-up o... | packages/next/server/app-render.tsx | @@ -385,15 +385,24 @@ export async function renderToHTML(
// TODO: use correct matching for dynamic routes to get segment param
const segmentParam =
segment.startsWith('[') && segment.endsWith(']')
- ? segment.slice(1, -1)
+ ? segment.slice(segment.startsWith('[...') ? 4 : 1, -1)
... | false |
Other | vercel | next.js | 93cb635e9e15e0e9cac2b82b899b4da8c6614be0.json | Add note about casing to getStaticPaths docs (#38426)
x-ref: [slack thread](https://vercel.slack.com/archives/CGU8HUTUH/p1656942759965239)
## Documentation / Examples
- [x] Make sure the linting passes by running `pnpm lint`
- [x] The examples guidelines are followed from [our contributing doc](https://github.com/ve... | docs/api-reference/data-fetching/get-static-paths.md | @@ -59,6 +59,8 @@ The value for each `params` object must match the parameters used in the page na
- If the page name uses [catch-all routes](/docs/routing/dynamic-routes.md#catch-all-routes) like `pages/[...slug]`, then `params` should contain `slug` (which is an array). If this array is `['hello', 'world']`, then Ne... | false |
Other | vercel | next.js | 0299f14a7e127e658f53df89ff7d069586d49822.json | Add param names into the tree (#38415)
- Remove cache value that was incorrectly nested deeper
- Remove extra useEffect (already applied during hydration based on the `useReducer` input)
- Add dynamic parameter name into the tree
Follow-up to #37551, cleans up some code and prepares for catch-all and optional catch-a... | packages/next/client/components/app-router.client.tsx | @@ -161,13 +161,6 @@ export default function AppRouter({
}, [])
useEffect(() => {
- console.log(
- 'UPDATE URL',
- pushRef.pendingPush ? 'push' : 'replace',
- pushRef.mpaNavigation ? 'MPA' : '',
- tree
- )
-
if (pushRef.mpaNavigation) {
window.location.href = canonicalUrl
... | true |
Other | vercel | next.js | 0299f14a7e127e658f53df89ff7d069586d49822.json | Add param names into the tree (#38415)
- Remove cache value that was incorrectly nested deeper
- Remove extra useEffect (already applied during hydration based on the `useReducer` input)
- Add dynamic parameter name into the tree
Follow-up to #37551, cleans up some code and prepares for catch-all and optional catch-a... | packages/next/client/components/layout-router.client.tsx | @@ -11,11 +11,12 @@ import {
FullAppTreeContext,
} from '../../shared/lib/app-router-context'
import { fetchServerResponse } from './app-router.client'
+import { matchSegment } from './match-segments'
let infinitePromise: Promise<void> | Error
function equalArray(a: any[], b: any[]) {
- return a.length === ... | true |
Other | vercel | next.js | 0299f14a7e127e658f53df89ff7d069586d49822.json | Add param names into the tree (#38415)
- Remove cache value that was incorrectly nested deeper
- Remove extra useEffect (already applied during hydration based on the `useReducer` input)
- Add dynamic parameter name into the tree
Follow-up to #37551, cleans up some code and prepares for catch-all and optional catch-a... | packages/next/client/components/match-segments.ts | @@ -0,0 +1,20 @@
+import { Segment } from '../../server/app-render'
+
+export const matchSegment = (
+ existingSegment: Segment,
+ segment: Segment
+): boolean => {
+ // Common case: segment is just a string
+ if (typeof existingSegment === 'string' && typeof segment === 'string') {
+ return existingSegment === ... | true |
Other | vercel | next.js | 0299f14a7e127e658f53df89ff7d069586d49822.json | Add param names into the tree (#38415)
- Remove cache value that was incorrectly nested deeper
- Remove extra useEffect (already applied during hydration based on the `useReducer` input)
- Add dynamic parameter name into the tree
Follow-up to #37551, cleans up some code and prepares for catch-all and optional catch-a... | packages/next/client/components/reducer.ts | @@ -4,6 +4,7 @@ import type {
FlightData,
FlightDataPath,
} from '../../server/app-render'
+import { matchSegment } from './match-segments'
import { fetchServerResponse } from './app-router.client'
const fillCacheWithNewSubTreeData = (
@@ -15,6 +16,8 @@ const fillCacheWithNewSubTreeData = (
const isLastEn... | true |
Other | vercel | next.js | 0299f14a7e127e658f53df89ff7d069586d49822.json | Add param names into the tree (#38415)
- Remove cache value that was incorrectly nested deeper
- Remove extra useEffect (already applied during hydration based on the `useReducer` input)
- Add dynamic parameter name into the tree
Follow-up to #37551, cleans up some code and prepares for catch-all and optional catch-a... | packages/next/server/app-render.tsx | @@ -22,6 +22,7 @@ import { tryGetPreviewData } from './api-utils/node'
import { htmlEscapeJsonString } from './htmlescape'
import { stripInternalQueries } from './utils'
import { NextApiRequestCookies } from './api-utils'
+import { matchSegment } from '../client/components/match-segments'
const ReactDOMServer = p... | true |
Other | vercel | next.js | 0f4333a5a307526e429dfc5898ae98096de40469.json | chore(examples): Convert `blog` example to TypeScript (#38095)
Converted Blog example over to TypeScript to match the Contribution guidelines.
I also simplified the example by removing `_document.js` and prettier from `package.json`.
## Documentation / Examples
- [X] Make sure the linting passes by running `pnpm li... | examples/blog/.gitignore | @@ -33,4 +33,8 @@ yarn-error.log*
# vercel
.vercel
-public/feed.xml
\ No newline at end of file
+# nextra
+public/feed.xml
+
+# typescript
+*.tsbuildinfo | true |
Other | vercel | next.js | 0f4333a5a307526e429dfc5898ae98096de40469.json | chore(examples): Convert `blog` example to TypeScript (#38095)
Converted Blog example over to TypeScript to match the Contribution guidelines.
I also simplified the example by removing `_document.js` and prettier from `package.json`.
## Documentation / Examples
- [X] Make sure the linting passes by running `pnpm li... | examples/blog/README.md | @@ -14,7 +14,7 @@ https://demo.vercel.blog
1. Update your name in `theme.config.js` or change the footer.
1. Update your name and site URL for the RSS feed in `scripts/gen-rss.js`.
-1. Update the meta tags in `pages/_document.js`.
+1. Update the meta tags in `pages/_document.tsx`.
1. Update the posts inside `pages... | true |
Other | vercel | next.js | 0f4333a5a307526e429dfc5898ae98096de40469.json | chore(examples): Convert `blog` example to TypeScript (#38095)
Converted Blog example over to TypeScript to match the Contribution guidelines.
I also simplified the example by removing `_document.js` and prettier from `package.json`.
## Documentation / Examples
- [X] Make sure the linting passes by running `pnpm li... | examples/blog/next-env.d.ts | @@ -0,0 +1,5 @@
+/// <reference types="next" />
+/// <reference types="next/image-types/global" />
+
+// NOTE: This file should not be edited
+// see https://nextjs.org/docs/basic-features/typescript for more information. | true |
Other | vercel | next.js | 0f4333a5a307526e429dfc5898ae98096de40469.json | chore(examples): Convert `blog` example to TypeScript (#38095)
Converted Blog example over to TypeScript to match the Contribution guidelines.
I also simplified the example by removing `_document.js` and prettier from `package.json`.
## Documentation / Examples
- [X] Make sure the linting passes by running `pnpm li... | examples/blog/next.config.js | @@ -1,2 +1,12 @@
-const withNextra = require('nextra')('nextra-theme-blog', './theme.config.js')
-module.exports = withNextra()
+/** @type {import('next').NextConfig} */
+const withNextra = require('nextra')({
+ theme: 'nextra-theme-blog',
+ themeConfig: './theme.config.js',
+ // optional: add `unstable_staticImage:... | true |
Other | vercel | next.js | 0f4333a5a307526e429dfc5898ae98096de40469.json | chore(examples): Convert `blog` example to TypeScript (#38095)
Converted Blog example over to TypeScript to match the Contribution guidelines.
I also simplified the example by removing `_document.js` and prettier from `package.json`.
## Documentation / Examples
- [X] Make sure the linting passes by running `pnpm li... | examples/blog/package.json | @@ -6,19 +6,18 @@
"start": "next start"
},
"dependencies": {
- "gray-matter": "^4.0.2",
+ "gray-matter": "^4.0.3",
"next": "latest",
"nextra": "^2.0.0-beta.5",
- "nextra-theme-blog": "^0.1.5",
- "react": "^17.0.2",
- "react-dom": "^17.0.2",
+ "nextra-theme-blog": "^2.0.0-beta.5",
... | true |
Other | vercel | next.js | 0f4333a5a307526e429dfc5898ae98096de40469.json | chore(examples): Convert `blog` example to TypeScript (#38095)
Converted Blog example over to TypeScript to match the Contribution guidelines.
I also simplified the example by removing `_document.js` and prettier from `package.json`.
## Documentation / Examples
- [X] Make sure the linting passes by running `pnpm li... | examples/blog/pages/_app.tsx | @@ -1,9 +1,9 @@
import 'nextra-theme-blog/style.css'
+import type { AppProps } from 'next/app'
import Head from 'next/head'
-
import '../styles/main.css'
-export default function Nextra({ Component, pageProps }) {
+export default function App({ Component, pageProps }: AppProps) {
return (
<>
<Head> | true |
Other | vercel | next.js | 0f4333a5a307526e429dfc5898ae98096de40469.json | chore(examples): Convert `blog` example to TypeScript (#38095)
Converted Blog example over to TypeScript to match the Contribution guidelines.
I also simplified the example by removing `_document.js` and prettier from `package.json`.
## Documentation / Examples
- [X] Make sure the linting passes by running `pnpm li... | examples/blog/pages/_document.tsx | @@ -1,7 +1,13 @@
-import Document, { Html, Head, Main, NextScript } from 'next/document'
+import Document, {
+ Html,
+ Head,
+ Main,
+ NextScript,
+ DocumentContext,
+} from 'next/document'
class MyDocument extends Document {
- static async getInitialProps(ctx) {
+ static async getInitialProps(ctx: DocumentCo... | true |
Other | vercel | next.js | 0f4333a5a307526e429dfc5898ae98096de40469.json | chore(examples): Convert `blog` example to TypeScript (#38095)
Converted Blog example over to TypeScript to match the Contribution guidelines.
I also simplified the example by removing `_document.js` and prettier from `package.json`.
## Documentation / Examples
- [X] Make sure the linting passes by running `pnpm li... | examples/blog/scripts/gen-rss.js | @@ -7,7 +7,7 @@ async function generate() {
const feed = new RSS({
title: 'Your Name',
site_url: 'https://yoursite.com',
- feed_url: 'https://yoursite.com/feed.xml'
+ feed_url: 'https://yoursite.com/feed.xml',
})
const posts = await fs.readdir(path.join(__dirname, '..', 'pages', 'posts'))
@@ ... | true |
Other | vercel | next.js | 0f4333a5a307526e429dfc5898ae98096de40469.json | chore(examples): Convert `blog` example to TypeScript (#38095)
Converted Blog example over to TypeScript to match the Contribution guidelines.
I also simplified the example by removing `_document.js` and prettier from `package.json`.
## Documentation / Examples
- [X] Make sure the linting passes by running `pnpm li... | examples/blog/theme.config.js | @@ -16,5 +16,5 @@ export default {
}
`}</style>
</footer>
- )
+ ),
} | true |
Other | vercel | next.js | 0f4333a5a307526e429dfc5898ae98096de40469.json | chore(examples): Convert `blog` example to TypeScript (#38095)
Converted Blog example over to TypeScript to match the Contribution guidelines.
I also simplified the example by removing `_document.js` and prettier from `package.json`.
## Documentation / Examples
- [X] Make sure the linting passes by running `pnpm li... | examples/blog/tsconfig.json | @@ -0,0 +1,20 @@
+{
+ "compilerOptions": {
+ "target": "es5",
+ "lib": ["dom", "dom.iterable", "esnext"],
+ "allowJs": true,
+ "skipLibCheck": true,
+ "strict": false,
+ "forceConsistentCasingInFileNames": true,
+ "noEmit": true,
+ "esModuleInterop": true,
+ "module": "esnext",
+ "moduleR... | true |
Other | vercel | next.js | 69f8024aa1cdef3125113c0e6e3cb4ec7c44fe8a.json | Call Error.getInitialProps for the top level error (#21240)
* fix: Call Error.getInitialProps to pass `err`
* test: Call Error.getInitialPropsfoe the top level error
* test: Update build output limit
* test: Add tests for top level error
* Revert "test: Call Error.getInitialPropsfoe the top level error"
... | packages/next/client/index.tsx | @@ -521,7 +521,7 @@ function renderError(renderErrorProps: RenderErrorProps): Promise<any> {
},
}
return Promise.resolve(
- renderErrorProps.props
+ renderErrorProps.props?.err
? renderErrorProps.props
: loadGetInitialProps(App, appCtx)
).then((initProps... | true |
Other | vercel | next.js | 69f8024aa1cdef3125113c0e6e3cb4ec7c44fe8a.json | Call Error.getInitialProps for the top level error (#21240)
* fix: Call Error.getInitialProps to pass `err`
* test: Call Error.getInitialPropsfoe the top level error
* test: Update build output limit
* test: Add tests for top level error
* Revert "test: Call Error.getInitialPropsfoe the top level error"
... | test/integration/render-error-on-top-level-error/with-get-initial-props/pages/_error.js | @@ -0,0 +1,11 @@
+const Error = ({ message }) => {
+ return <p id="error-p">Error Rendered with: {message}</p>
+}
+
+Error.getInitialProps = ({ err }) => {
+ return {
+ message: err && err.message,
+ }
+}
+
+export default Error | true |
Other | vercel | next.js | 69f8024aa1cdef3125113c0e6e3cb4ec7c44fe8a.json | Call Error.getInitialProps for the top level error (#21240)
* fix: Call Error.getInitialProps to pass `err`
* test: Call Error.getInitialPropsfoe the top level error
* test: Update build output limit
* test: Add tests for top level error
* Revert "test: Call Error.getInitialPropsfoe the top level error"
... | test/integration/render-error-on-top-level-error/with-get-initial-props/pages/index.js | @@ -0,0 +1,7 @@
+if (typeof window !== 'undefined') {
+ throw new Error('top level error')
+}
+
+const Page = () => 'page'
+
+export default Page | true |
Other | vercel | next.js | 69f8024aa1cdef3125113c0e6e3cb4ec7c44fe8a.json | Call Error.getInitialProps for the top level error (#21240)
* fix: Call Error.getInitialProps to pass `err`
* test: Call Error.getInitialPropsfoe the top level error
* test: Update build output limit
* test: Add tests for top level error
* Revert "test: Call Error.getInitialPropsfoe the top level error"
... | test/integration/render-error-on-top-level-error/with-get-initial-props/test/index.test.js | @@ -0,0 +1,37 @@
+/* eslint-env jest */
+
+import { nextBuild, nextServer, startApp, stopApp } from 'next-test-utils'
+import webdriver from 'next-webdriver'
+import { join } from 'path'
+
+jest.setTimeout(1000 * 60 * 2)
+
+let appPort
+let app
+let server
+
+describe('Top Level Error', () => {
+ beforeAll(async () =>... | true |
Other | vercel | next.js | 69f8024aa1cdef3125113c0e6e3cb4ec7c44fe8a.json | Call Error.getInitialProps for the top level error (#21240)
* fix: Call Error.getInitialProps to pass `err`
* test: Call Error.getInitialPropsfoe the top level error
* test: Update build output limit
* test: Add tests for top level error
* Revert "test: Call Error.getInitialPropsfoe the top level error"
... | test/integration/render-error-on-top-level-error/without-get-initial-props/pages/_error.js | @@ -0,0 +1,5 @@
+const Error = () => {
+ return <p id="error-p">Error Rendered</p>
+}
+
+export default Error | true |
Other | vercel | next.js | 69f8024aa1cdef3125113c0e6e3cb4ec7c44fe8a.json | Call Error.getInitialProps for the top level error (#21240)
* fix: Call Error.getInitialProps to pass `err`
* test: Call Error.getInitialPropsfoe the top level error
* test: Update build output limit
* test: Add tests for top level error
* Revert "test: Call Error.getInitialPropsfoe the top level error"
... | test/integration/render-error-on-top-level-error/without-get-initial-props/pages/index.js | @@ -0,0 +1,7 @@
+if (typeof window !== 'undefined') {
+ throw new Error('top level error')
+}
+
+const Page = () => 'page'
+
+export default Page | true |
Other | vercel | next.js | 69f8024aa1cdef3125113c0e6e3cb4ec7c44fe8a.json | Call Error.getInitialProps for the top level error (#21240)
* fix: Call Error.getInitialProps to pass `err`
* test: Call Error.getInitialPropsfoe the top level error
* test: Update build output limit
* test: Add tests for top level error
* Revert "test: Call Error.getInitialPropsfoe the top level error"
... | test/integration/render-error-on-top-level-error/without-get-initial-props/test/index.test.js | @@ -0,0 +1,37 @@
+/* eslint-env jest */
+
+import { nextBuild, nextServer, startApp, stopApp } from 'next-test-utils'
+import webdriver from 'next-webdriver'
+import { join } from 'path'
+
+jest.setTimeout(1000 * 60 * 2)
+
+let appPort
+let app
+let server
+
+describe('Top Level Error', () => {
+ beforeAll(async () =>... | true |
Other | vercel | next.js | f2b8a6b60f4a70c29a81ef963d5f75cee7e4d184.json | Enable swc minifier in create next apps (#38215)
## Bug
- [ ] Related issues linked using `fixes #number`
- [ ] 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 accepted for... | packages/create-next-app/templates/default/next.config.js | @@ -1,6 +1,7 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
+ swcMinify: true,
}
module.exports = nextConfig | true |
Other | vercel | next.js | f2b8a6b60f4a70c29a81ef963d5f75cee7e4d184.json | Enable swc minifier in create next apps (#38215)
## Bug
- [ ] Related issues linked using `fixes #number`
- [ ] 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 accepted for... | packages/create-next-app/templates/typescript/next.config.js | @@ -1,6 +1,7 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
+ swcMinify: true,
}
module.exports = nextConfig | true |
Other | vercel | next.js | f2b8a6b60f4a70c29a81ef963d5f75cee7e4d184.json | Enable swc minifier in create next apps (#38215)
## Bug
- [ ] Related issues linked using `fixes #number`
- [ ] 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 accepted for... | packages/next/server/config.ts | @@ -523,9 +523,7 @@ function assignDefaults(userConfig: { [key: string]: any }) {
}
if (result.swcMinify) {
- Log.warn(
- 'SWC minify release candidate enabled. https://nextjs.org/docs/messages/swc-minify-enabled'
- )
+ Log.info('SWC minify release candidate enabled. https://nextjs.link/swcmin')
... | true |
Other | vercel | next.js | fa1261cbfbc79fa3f6c491a186b18204d6b71847.json | Fix typo in SWC plugin destructuring example (#38367)
## Bug
- [ ] Related issues linked using `fixes #number`
- [ ] 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 accepte... | docs/advanced-features/compiler.md | @@ -385,11 +385,14 @@ You can configure swc's transform to use SWC's experimental plugin support writt
module.exports = {
experimental: {
swcPlugins: [
- ['plugin', {
- ..pluginOptions
- }]
- ]
- }
+ [
+ 'plugin',
+ {
+ ...pluginOptions,
+ },
+ ],
+ ... | false |
Other | vercel | next.js | 616e0d7ee88dd33d3fda793b790adee92468fee0.json | chore(examples): fix experiments loading npm wasm (#38348)
* enables default config that handles npm wasm bundles
## Bug
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`
## Feature
- [ ] Implements an existing feature r... | examples/with-webassembly/next.config.js | @@ -3,7 +3,7 @@ module.exports = {
config.output.webassemblyModuleFilename = 'static/wasm/[modulehash].wasm'
// Since Webpack 5 doesn't enable WebAssembly by default, we should do it manually
- config.experiments = { asyncWebAssembly: true }
+ config.experiments = { ...config.experiments, asyncWebAsse... | false |
Other | vercel | next.js | 329f6cb9ac4dd4d939bbc70d2fdd81156e005cba.json | Handle Client Rewrites Correctly (#38340)
When an API route is detected for the `getRouteInfo` method (a route with a `/api` prefix), we should redirect the user to the original destination instead of the rewritten destination. This makes the behaviour consistent with how rewrites have been documented thus far.
The r... | packages/next/shared/lib/router/router.ts | @@ -1751,7 +1751,7 @@ export default class Router implements BaseRouter {
}
if (route === '/api' || route.startsWith('/api/')) {
- handleHardNavigation({ url: resolvedAs, router: this })
+ handleHardNavigation({ url: as, router: this })
return new Promise<never>(() => {})
}... | true |
Other | vercel | next.js | 329f6cb9ac4dd4d939bbc70d2fdd81156e005cba.json | Handle Client Rewrites Correctly (#38340)
When an API route is detected for the `getRouteInfo` method (a route with a `/api` prefix), we should redirect the user to the original destination instead of the rewritten destination. This makes the behaviour consistent with how rewrites have been documented thus far.
The r... | test/e2e/link-with-api-rewrite/app/next.config.js | @@ -0,0 +1,17 @@
+/** @type {import('next').NextConfig} */
+const nextConfig = {
+ reactStrictMode: true,
+ async rewrites() {
+ return {
+ beforeFiles: [
+ {
+ source: '/:path(.*)',
+ has: [{ type: 'query', key: 'json', value: 'true' }],
+ destination: '/api/json?from=/:path... | true |
Other | vercel | next.js | 329f6cb9ac4dd4d939bbc70d2fdd81156e005cba.json | Handle Client Rewrites Correctly (#38340)
When an API route is detected for the `getRouteInfo` method (a route with a `/api` prefix), we should redirect the user to the original destination instead of the rewritten destination. This makes the behaviour consistent with how rewrites have been documented thus far.
The r... | test/e2e/link-with-api-rewrite/app/pages/api/json.js | @@ -0,0 +1,5 @@
+export default async function handler(req, res) {
+ const from = req.query.from || ''
+
+ return res.json({ from })
+} | true |
Other | vercel | next.js | 329f6cb9ac4dd4d939bbc70d2fdd81156e005cba.json | Handle Client Rewrites Correctly (#38340)
When an API route is detected for the `getRouteInfo` method (a route with a `/api` prefix), we should redirect the user to the original destination instead of the rewritten destination. This makes the behaviour consistent with how rewrites have been documented thus far.
The r... | test/e2e/link-with-api-rewrite/app/pages/index.js | @@ -0,0 +1,14 @@
+import Link from 'next/link'
+
+export default function Page() {
+ return (
+ <div>
+ <Link href="/some/route/for?json=true">
+ <a id="rewrite">to /some/route/for?json=true</a>
+ </Link>
+ <Link href="/api/json">
+ <a id="direct">to /api/json</a>
+ </Link>
+ </... | true |
Other | vercel | next.js | 329f6cb9ac4dd4d939bbc70d2fdd81156e005cba.json | Handle Client Rewrites Correctly (#38340)
When an API route is detected for the `getRouteInfo` method (a route with a `/api` prefix), we should redirect the user to the original destination instead of the rewritten destination. This makes the behaviour consistent with how rewrites have been documented thus far.
The r... | test/e2e/link-with-api-rewrite/index.test.ts | @@ -0,0 +1,74 @@
+import { createNext, FileRef } from 'e2e-utils'
+import { NextInstance } from 'test/lib/next-modes/base'
+import { check } from 'next-test-utils'
+import { join } from 'path'
+import webdriver from 'next-webdriver'
+
+describe('link-with-api-rewrite', () => {
+ let next: NextInstance
+
+ beforeAll(a... | true |
Other | vercel | next.js | 469c5030bae41c18654d4342d5e736ab0bc2c9f1.json | Display stack trace when error occurs in API route (#38289)
## Bug
- [ ] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md` | packages/next/server/dev/next-dev-server.ts | @@ -831,17 +831,23 @@ export default class DevServer extends Server {
const { originalCodeFrame, originalStackFrame } = originalFrame
const { file, lineNumber, column, methodName } = originalStackFrame
- console.error(
- (type === 'warning' ? chalk.yellow('warn') : ch... | true |
Other | vercel | next.js | 469c5030bae41c18654d4342d5e736ab0bc2c9f1.json | Display stack trace when error occurs in API route (#38289)
## Bug
- [ ] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md` | packages/next/server/web/sandbox/context.ts | @@ -115,13 +115,16 @@ async function createModuleContext(options: ModuleContextOptions) {
context.__next_eval__ = function __next_eval__(fn: Function) {
const key = fn.toString()
if (!warnedEvals.has(key)) {
- const warning = new Error(
- `Dynamic Code Evaluation (e. g. 'eva... | true |
Other | vercel | next.js | 469c5030bae41c18654d4342d5e736ab0bc2c9f1.json | Display stack trace when error occurs in API route (#38289)
## Bug
- [ ] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md` | test/development/api-route-errors/app/pages/api/error.js | @@ -0,0 +1,3 @@
+export default function error(req, res) {
+ throw new Error()
+} | true |
Other | vercel | next.js | 469c5030bae41c18654d4342d5e736ab0bc2c9f1.json | Display stack trace when error occurs in API route (#38289)
## Bug
- [ ] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md` | test/development/api-route-errors/app/pages/api/uncaught-exception.js | @@ -0,0 +1,6 @@
+export default function uncaughtException(req, res) {
+ setTimeout(() => {
+ throw new Error('uncaught exception')
+ }, 0)
+ res.send('hello')
+} | true |
Other | vercel | next.js | 469c5030bae41c18654d4342d5e736ab0bc2c9f1.json | Display stack trace when error occurs in API route (#38289)
## Bug
- [ ] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md` | test/development/api-route-errors/app/pages/api/unhandled-rejection.js | @@ -0,0 +1,4 @@
+export default function unhandledRejection(req, res) {
+ Promise.reject(new Error('unhandled rejection'))
+ res.send('hello')
+} | true |
Other | vercel | next.js | 469c5030bae41c18654d4342d5e736ab0bc2c9f1.json | Display stack trace when error occurs in API route (#38289)
## Bug
- [ ] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md` | test/development/api-route-errors/index.test.ts | @@ -0,0 +1,69 @@
+import stripAnsi from 'next/dist/compiled/strip-ansi'
+import { createNext, FileRef } from 'e2e-utils'
+import { NextInstance } from 'test/lib/next-modes/base'
+import { check, renderViaHTTP } from 'next-test-utils'
+import { join } from 'path'
+
+describe('api-route-errors cli output', () => {
+ let... | true |
Other | vercel | next.js | 9f162cc812ee7a227136e9c159e4e3bd1c59d831.json | Update analysis scripts (#38201) | examples/with-ant-design/package.json | @@ -3,7 +3,8 @@
"scripts": {
"dev": "next",
"build": "next build",
- "start": "next start"
+ "start": "next start",
+ "analyze": "cross-env ANALYZE=true next build"
},
"dependencies": {
"@ant-design/icons": "4.2.1",
@@ -20,5 +21,8 @@
"browser": {
"fs": false,
"path": false
... | false |
Other | vercel | next.js | 7e9f801b47225c692b6dc3d69c26dd2cfa0a760b.json | Fix typo `currentFeatures` to `concurrentFeatures` (#30356)
* Fix `currentFeatures` to `concurrentFeatures`
Small typo fix in docs
* Apply suggestions from code review
Co-authored-by: Shu Ding <g@shud.in>
Co-authored-by: JJ Kasper <jj@jjsweb.site>
Co-authored-by: Shu Ding <g@shud.in> | docs/advanced-features/react-18.md | @@ -65,7 +65,7 @@ React Server Components allow us to render everything, including the components
### Enable React Server Components (Alpha)
-To use React Server Components, ensure you have React 18 installed. Then, turn on the `currentFeatures` and `serverComponents` options in `next.config.js`:
+To use React Ser... | false |
Other | vercel | next.js | c7e4c85436394eed0580d01cc029ba9be1a75f3e.json | Fix lint on react-18 docs (#30354) | docs/advanced-features/react-18.md | @@ -121,7 +121,7 @@ export default function Home() {
<Suspense fallback={'Loading...'}>
<Profile />
</Suspense>
- <Content/>
+ <Content />
</div>
)
} | false |
Other | vercel | next.js | c2541e2fd99b74180809a6fed012adea13b6cbbf.json | Fix flight loader parsing (#30345) | packages/next/build/webpack/loaders/next-flight-client-loader.ts | @@ -122,7 +122,7 @@ async function parseExportNamesInto(
}
continue
default:
- return
+ break
}
}
} | true |
Other | vercel | next.js | c2541e2fd99b74180809a6fed012adea13b6cbbf.json | Fix flight loader parsing (#30345) | test/integration/react-rsc-basic/app/components/foo.client.js | @@ -0,0 +1,3 @@
+export default function foo() {
+ return 'foo.client'
+} | true |
Other | vercel | next.js | c2541e2fd99b74180809a6fed012adea13b6cbbf.json | Fix flight loader parsing (#30345) | test/integration/react-rsc-basic/app/pages/index.server.js | @@ -1,3 +1,10 @@
+import Foo from '../components/foo.client'
+
export default function Index() {
- return 'thisistheindexpage'
+ return (
+ <div>
+ <h1>{`thisistheindexpage.server`}</h1>
+ <Foo />
+ </div>
+ )
} | true |
Other | vercel | next.js | c2541e2fd99b74180809a6fed012adea13b6cbbf.json | Fix flight loader parsing (#30345) | test/integration/react-rsc-basic/test/index.test.js | @@ -98,7 +98,8 @@ async function runTests(context) {
it('should render the correct html', async () => {
const homeHTML = await renderViaHTTP(context.appPort, '/')
const linkHTML = await renderViaHTTP(context.appPort, '/next-api/link')
- expect(homeHTML).toContain('thisistheindexpage')
+ expect(homeHT... | true |
Other | vercel | next.js | 4c83292a846ed65dad4209ba033c4bbb153c22d8.json | Update SWC OS and CPU fields (#30341)
* Update SWC OS and CPU fields
* co-authored-by: CanKolay5677 <80613396+CanKolay5677@users.noreply.github.com> | packages/next/build/swc/npm/android-arm64/package.json | @@ -2,7 +2,7 @@
"name": "@next/swc-android-arm64",
"version": "0.0.0",
"os": [
- "darwin"
+ "android"
],
"cpu": [
"arm64" | true |
Other | vercel | next.js | 4c83292a846ed65dad4209ba033c4bbb153c22d8.json | Update SWC OS and CPU fields (#30341)
* Update SWC OS and CPU fields
* co-authored-by: CanKolay5677 <80613396+CanKolay5677@users.noreply.github.com> | packages/next/build/swc/npm/linux-arm-gnueabihf/package.json | @@ -2,10 +2,10 @@
"name": "@next/swc-linux-arm-gnueabihf",
"version": "0.0.0",
"os": [
- "darwin"
+ "linux"
],
"cpu": [
- "arm64"
+ "arm"
],
"main": "next-swc.linux-arm-gnueabihf.node",
"files": [ | true |
Other | vercel | next.js | 4c83292a846ed65dad4209ba033c4bbb153c22d8.json | Update SWC OS and CPU fields (#30341)
* Update SWC OS and CPU fields
* co-authored-by: CanKolay5677 <80613396+CanKolay5677@users.noreply.github.com> | packages/next/build/swc/npm/linux-arm64-gnu/package.json | @@ -2,7 +2,7 @@
"name": "@next/swc-linux-arm64-gnu",
"version": "0.0.0",
"os": [
- "darwin"
+ "linux"
],
"cpu": [
"arm64" | true |
Other | vercel | next.js | 4c83292a846ed65dad4209ba033c4bbb153c22d8.json | Update SWC OS and CPU fields (#30341)
* Update SWC OS and CPU fields
* co-authored-by: CanKolay5677 <80613396+CanKolay5677@users.noreply.github.com> | packages/next/build/swc/npm/linux-arm64-musl/package.json | @@ -2,7 +2,7 @@
"name": "@next/swc-linux-arm64-musl",
"version": "0.0.0",
"os": [
- "darwin"
+ "linux"
],
"cpu": [
"arm64" | true |
Other | vercel | next.js | 4c83292a846ed65dad4209ba033c4bbb153c22d8.json | Update SWC OS and CPU fields (#30341)
* Update SWC OS and CPU fields
* co-authored-by: CanKolay5677 <80613396+CanKolay5677@users.noreply.github.com> | packages/next/build/swc/npm/linux-x64-musl/package.json | @@ -2,10 +2,10 @@
"name": "@next/swc-linux-x64-musl",
"version": "0.0.0",
"os": [
- "darwin"
+ "linux"
],
"cpu": [
- "arm64"
+ "x64"
],
"main": "next-swc.linux-x64-musl.node",
"files": [ | true |
Other | vercel | next.js | 4c83292a846ed65dad4209ba033c4bbb153c22d8.json | Update SWC OS and CPU fields (#30341)
* Update SWC OS and CPU fields
* co-authored-by: CanKolay5677 <80613396+CanKolay5677@users.noreply.github.com> | packages/next/build/swc/npm/win32-arm64-msvc/package.json | @@ -2,7 +2,7 @@
"name": "@next/swc-win32-arm64-msvc",
"version": "0.0.0",
"os": [
- "darwin"
+ "win32"
],
"cpu": [
"arm64" | true |
Other | vercel | next.js | 4c83292a846ed65dad4209ba033c4bbb153c22d8.json | Update SWC OS and CPU fields (#30341)
* Update SWC OS and CPU fields
* co-authored-by: CanKolay5677 <80613396+CanKolay5677@users.noreply.github.com> | packages/next/build/swc/npm/win32-ia32-msvc/package.json | @@ -2,10 +2,10 @@
"name": "@next/swc-win32-ia32-msvc",
"version": "0.0.0",
"os": [
- "darwin"
+ "win32"
],
"cpu": [
- "arm64"
+ "ia32"
],
"main": "next-swc.win32-ia32-msvc.node",
"files": [ | true |
Other | vercel | next.js | 520c5a408332c4269bc6251f437c40fd2a1d4954.json | fix missed hmr events (#30309)
When an compilation happens in the timespan between "page loaded client bundle" and "web socket got initial sync event" it didn't apply the hmr update. | packages/next/client/dev/error-overlay/hot-dev-client.js | @@ -35,6 +35,7 @@ import {
import stripAnsi from 'next/dist/compiled/strip-ansi'
import { addMessageListener } from './websocket'
import formatWebpackMessages from './format-webpack-messages'
+import Router from 'next/router'
// This alternative WebpackDevServer combines the functionality of:
// https://github.c... | false |
Other | vercel | next.js | d92e75cb30cc1f31a7ba8132e94686d6aca58d24.json | Add missing closing quote (#30336) | docs/advanced-features/react-18.md | @@ -109,7 +109,7 @@ You can then import other server or client components from any server component.
```jsx
// pages/home.server.js
-import React, { Suspense } from 'react
+import React, { Suspense } from 'react'
import Profile from '../components/profile.server'
import Content from '../components/content.clien... | false |
Other | vercel | next.js | 4edc874ee54770376d3761aa5c11b31e63cbb049.json | Add React 18 docs (#30325)
This re-adds https://github.com/vercel/next.js/pull/30324
## Documentation / Examples
- [x] Make sure the linting passes by running `yarn lint` | docs/advanced-features/react-18.md | @@ -0,0 +1,151 @@
+# React 18
+
+[React 18](https://reactjs.org/blog/2021/06/08/the-plan-for-react-18.html) adds new features including, Suspense, automatic batching of updates, APIs like `startTransition`, and a new streaming API for server rendering with support for `React.lazy`.
+
+React 18 is still in alpha. Read m... | true |
Other | vercel | next.js | 4edc874ee54770376d3761aa5c11b31e63cbb049.json | Add React 18 docs (#30325)
This re-adds https://github.com/vercel/next.js/pull/30324
## Documentation / Examples
- [x] Make sure the linting passes by running `yarn lint` | docs/manifest.json | @@ -232,6 +232,10 @@
{
"title": "Security Headers",
"path": "/docs/advanced-features/security-headers.md"
+ },
+ {
+ "title": "React 18",
+ "path": "/docs/advanced-features/react-18.md"
}
]
}, | true |
Other | vercel | next.js | 3466b740aeaa5296848fdc0fd0b4d26ff08471e1.json | Add more docs (#30320)
Co-authored-by: Steven <steven@ceriously.com> | docs/api-reference/edge-runtime.md | @@ -0,0 +1,103 @@
+---
+description: The Next.js Edge Runtime is based on standard Web APIs. Learn more about the supported APIs available.
+---
+
+# Edge Runtime
+
+The Next.js Edge Runtime is based on standard Web APIs, which is used by [Middleware](/docs/middleware.md).
+
+## Runtime APIs
+
+### Globals
+
+- [`Reque... | true |
Other | vercel | next.js | 3466b740aeaa5296848fdc0fd0b4d26ff08471e1.json | Add more docs (#30320)
Co-authored-by: Steven <steven@ceriously.com> | docs/api-reference/next/server.md | @@ -0,0 +1,106 @@
+---
+description: Use Middleware to run code before a request is completed.
+---
+
+# next/server
+
+Middleware is created by using a `middleware` function that lives inside a `_middleware` file. The Middleware API is based upon the native [`FetchEvent`](https://developer.mozilla.org/en-US/docs/Web/A... | true |
Other | vercel | next.js | 3466b740aeaa5296848fdc0fd0b4d26ff08471e1.json | Add more docs (#30320)
Co-authored-by: Steven <steven@ceriously.com> | docs/manifest.json | @@ -105,6 +105,10 @@
}
]
},
+ {
+ "title": "Middleware",
+ "path": "/docs/middleware.md"
+ },
{
"title": "Going to Production",
"path": "/docs/going-to-production.md"
@@ -288,6 +292,14 @@
"title": "next/amp",
... | true |
Other | vercel | next.js | 3466b740aeaa5296848fdc0fd0b4d26ff08471e1.json | Add more docs (#30320)
Co-authored-by: Steven <steven@ceriously.com> | docs/middleware.md | @@ -0,0 +1,93 @@
+---
+description: Learn how to use Middleware in Next.js to run code before a request is completed.
+---
+
+# Middleware
+
+Middleware enables you to use code over configuration. This gives you full flexibility in Next.js, because you can run code before a request is completed. Based on the user's inc... | true |
Other | vercel | next.js | c497b3a5ff3199967f476323b9d2287f97ecbdea.json | Improve deprecation errors for new middleware API (#30316)
Co-authored-by: JJ Kasper <jj@jjsweb.site>
Co-authored-by: Steven <steven@ceriously.com> | errors/manifest.json | @@ -502,6 +502,10 @@
{
"title": "swc-minify-enabled",
"path": "/errors/swc-minify-enabled.md"
+ },
+ {
+ "title": "middleware-new-signature",
+ "path": "/errors/middleware-new-signature.md"
}
]
} | true |
Other | vercel | next.js | c497b3a5ff3199967f476323b9d2287f97ecbdea.json | Improve deprecation errors for new middleware API (#30316)
Co-authored-by: JJ Kasper <jj@jjsweb.site>
Co-authored-by: Steven <steven@ceriously.com> | errors/middleware-new-signature.md | @@ -0,0 +1,37 @@
+# Deprecated Middleware API Signature
+
+#### Why This Error Occurred
+
+Your application is using a Middleware function that is using parameters from the deprecated API.
+
+```typescript
+// _middleware.js
+import { NextResponse } from 'next/server'
+
+export function middleware(event) {
+ if (event... | true |
Other | vercel | next.js | c497b3a5ff3199967f476323b9d2287f97ecbdea.json | Improve deprecation errors for new middleware API (#30316)
Co-authored-by: JJ Kasper <jj@jjsweb.site>
Co-authored-by: Steven <steven@ceriously.com> | packages/next/build/webpack/loaders/next-middleware-loader.ts | @@ -26,7 +26,8 @@ export default function middlewareLoader(this: any) {
export default function (opts) {
return adapter({
...opts,
- handler
+ page: ${JSON.stringify(page)},
+ handler,
})
}
` | true |
Other | vercel | next.js | c497b3a5ff3199967f476323b9d2287f97ecbdea.json | Improve deprecation errors for new middleware API (#30316)
Co-authored-by: JJ Kasper <jj@jjsweb.site>
Co-authored-by: Steven <steven@ceriously.com> | packages/next/server/web/adapter.ts | @@ -8,22 +8,27 @@ import { waitUntilSymbol } from './spec-compliant/fetch-event'
export async function adapter(params: {
handler: (request: NextRequest, event: NextFetchEvent) => Promise<Response>
+ page: string
request: RequestData
}): Promise<FetchEventResult> {
const url = params.request.url.startsWith... | true |
Other | vercel | next.js | c497b3a5ff3199967f476323b9d2287f97ecbdea.json | Improve deprecation errors for new middleware API (#30316)
Co-authored-by: JJ Kasper <jj@jjsweb.site>
Co-authored-by: Steven <steven@ceriously.com> | packages/next/server/web/error.ts | @@ -1,10 +1,12 @@
export class DeprecationError extends Error {
- constructor() {
- super(`Middleware now accepts an async API directly with the form:
+ constructor({ page }: { page: string }) {
+ super(`The middleware "${page}" accepts an async API directly with the form:
export function middleware(req... | true |
Other | vercel | next.js | c497b3a5ff3199967f476323b9d2287f97ecbdea.json | Improve deprecation errors for new middleware API (#30316)
Co-authored-by: JJ Kasper <jj@jjsweb.site>
Co-authored-by: Steven <steven@ceriously.com> | packages/next/server/web/spec-compliant/fetch-event.ts | @@ -3,15 +3,10 @@ export const passThroughSymbol = Symbol('passThrough')
export const waitUntilSymbol = Symbol('waitUntil')
export class FetchEvent {
- readonly request: Request;
readonly [waitUntilSymbol]: Promise<any>[] = [];
[responseSymbol]?: Promise<Response>;
[passThroughSymbol] = false
- constru... | true |
Other | vercel | next.js | c497b3a5ff3199967f476323b9d2287f97ecbdea.json | Improve deprecation errors for new middleware API (#30316)
Co-authored-by: JJ Kasper <jj@jjsweb.site>
Co-authored-by: Steven <steven@ceriously.com> | packages/next/server/web/spec-extension/fetch-event.ts | @@ -3,13 +3,23 @@ import { FetchEvent } from '../spec-compliant/fetch-event'
import { NextRequest } from './request'
export class NextFetchEvent extends FetchEvent {
- readonly request: NextRequest
- constructor(request: NextRequest) {
- super(request)
- this.request = request
+ sourcePage: string
+
+ con... | true |
Other | vercel | next.js | 25716a249d6e6778b2eb9b9fc0e3bf7154619945.json | Fix typo of upgrading (#30276)
## Bug
- [ ] Related issues linked using `fixes #number`
- [ ] 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 accepted for implementation be... | docs/upgrading.md | @@ -44,7 +44,7 @@ Minification using SWC is an opt-in flag to ensure it can be tested against more
If your application has specific CSS targeting span, for example `.container span`, upgrading to Next.js 12 might incorrectly match the wrapping element inside the `<Image>` component. You can avoid this by restricting... | false |
Other | vercel | next.js | dfb280b4a9591df345fe1927d3b6510ce5648d06.json | Add minimum Node.js version to upgrading guide (#30274)
## Bug
- [ ] Related issues linked using `fixes #number`
- [ ] 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 accep... | docs/upgrading.md | @@ -6,6 +6,10 @@ description: Learn how to upgrade Next.js.
## Upgrading from 11 to 12
+### Minimum Node.js version
+
+The minimum Node.js version has been bumped from 12.0.0 to 12.22.0 which is the first version of Node.js with native ES Modules support.
+
### SWC replacing Babel
Next.js now uses Rust-based c... | false |
Other | vercel | next.js | 3f22451545704a27388eb9d352d4e467c684e228.json | Update upgrade docs (#30265)
Co-authored-by: Lee Robinson <me@leerob.io>
Co-authored-by: Steven <steven@ceriously.com> | docs/upgrading.md | @@ -4,6 +4,66 @@ description: Learn how to upgrade Next.js.
# Upgrade Guide
+## Upgrading from 11 to 12
+
+### SWC replacing Babel
+
+Next.js now uses Rust-based compiler [SWC](https://swc.rs/) to compile JavaScript/TypeScript. This new compiler is up to 17x faster than Babel when compiling individual files and up... | false |
Other | vercel | next.js | 1a10ab8c39dcbb9272f549fb7d17f3761568455d.json | Update error for failing to load SWC bindings (#30269) | .github/workflows/build_native.yml | @@ -95,10 +95,10 @@ jobs:
runs-on: windows-latest
env:
CARGO_PROFILE_RELEASE_CODEGEN_UNITS: 32
- CARGO_PROFILE_RELEASE_LTO: "false"
+ CARGO_PROFILE_RELEASE_LTO: 'false'
steps:
- uses: actions/checkout@v2
-
+
- name: Install node x86
run: |
choco in... | true |
Other | vercel | next.js | 1a10ab8c39dcbb9272f549fb7d17f3761568455d.json | Update error for failing to load SWC bindings (#30269) | errors/failed-loading-swc.md | @@ -0,0 +1,31 @@
+# SWC Failed to Load
+
+#### Why This Message Occurred
+
+Next.js now uses Rust-based compiler [SWC](https://swc.rs/) to compile JavaScript/TypeScript. This new compiler is up to 17x faster than Babel when compiling individual files and up to 5x faster Fast Refresh.
+
+SWC requires a binary be downloa... | true |
Other | vercel | next.js | 1a10ab8c39dcbb9272f549fb7d17f3761568455d.json | Update error for failing to load SWC bindings (#30269) | errors/manifest.json | @@ -8,6 +8,10 @@
"title": "beta-middleware",
"path": "/errors/beta-middleware.md"
},
+ {
+ "title": "failed-loading-swc",
+ "path": "/errors/failed-loading-swc.md"
+ },
{
"title": "deprecated-target-config",
"path": "/errors/d... | true |
Other | vercel | next.js | 1a10ab8c39dcbb9272f549fb7d17f3761568455d.json | Update error for failing to load SWC bindings (#30269) | packages/next/build/swc/index.js | @@ -1,5 +1,6 @@
const { loadBinding } = require('@node-rs/helper')
const path = require('path')
+const Log = require('../output/log')
/**
* __dirname means load native addon from current dir
@@ -9,11 +10,24 @@ const path = require('path')
* `loadBinding` helper will load `next-swc.[PLATFORM].node` from `__dirn... | true |
Other | vercel | next.js | 467bf08a8a7f14ddf043c7c0141889edfbb9f970.json | Add events polyfill (#30256) | packages/next/build/webpack-config.ts | @@ -543,6 +543,7 @@ export default async function getBaseWebpackConfig(
util: require.resolve('util/'),
vm: require.resolve('vm-browserify'),
zlib: require.resolve('browserify-zlib'),
+ events: require.resolve('events'),
},
}
: undefined), | true |
Other | vercel | next.js | 467bf08a8a7f14ddf043c7c0141889edfbb9f970.json | Add events polyfill (#30256) | packages/next/compiled/node-libs-browser/events.js | @@ -1 +1 @@
-module.exports=(()=>{"use strict";var e={505:e=>{var t=typeof Reflect==="object"?Reflect:null;var n=t&&typeof t.apply==="function"?t.apply:function ReflectApply(e,t,n){return Function.prototype.apply.call(e,t,n)};var r;if(t&&typeof t.ownKeys==="function"){r=t.ownKeys}else if(Object.getOwnPropertySymbols){r... | true |
Other | vercel | next.js | 467bf08a8a7f14ddf043c7c0141889edfbb9f970.json | Add events polyfill (#30256) | packages/next/package.json | @@ -85,6 +85,7 @@
"domain-browser": "4.19.0",
"encoding": "0.1.13",
"etag": "1.8.1",
+ "events": "3.3.0",
"find-cache-dir": "3.3.1",
"get-orientation": "1.1.2",
"https-browserify": "1.0.0", | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.