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 | 3cece4d2adc80c0b3bdea26561adf5e9ab2dbae1.json | Update Azure config (#18931) | .github/workflows/build_test_deploy.yml | @@ -15,6 +15,7 @@ jobs:
- uses: actions/checkout@v2
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
- run: yarn install --frozen-lockfile --check-files
+ - run: node run-tests.js --timings --write-timings -g 1/4
- uses: actions/cache@v2
id: cache-build
with: | true |
Other | vercel | next.js | 3cece4d2adc80c0b3bdea26561adf5e9ab2dbae1.json | Update Azure config (#18931) | .gitignore | @@ -31,6 +31,7 @@ examples/**/out
examples/**/.env*.local
pr-stats.md
+test-timings.json
# Vercel
.vercel | true |
Other | vercel | next.js | 3cece4d2adc80c0b3bdea26561adf5e9ab2dbae1.json | Update Azure config (#18931) | .prettierignore | @@ -13,4 +13,5 @@ packages/next-codemod/transforms/__testfixtures__/**/*
packages/next-codemod/transforms/__tests__/**/*
packages/next-codemod/**/*.js
packages/next-codemod/**/*.d.ts
-packages/next-env/**/*.d.ts
\ No newline at end of file
+packages/next-env/**/*.d.ts
+test-timings.json
\ No newline at end of file | true |
Other | vercel | next.js | 3cece4d2adc80c0b3bdea26561adf5e9ab2dbae1.json | Update Azure config (#18931) | azure-pipelines.yml | @@ -3,64 +3,95 @@ variables:
NEXT_TELEMETRY_DISABLED: '1'
node_version: ^10.10.0
-jobs:
- - job: test_ie11
- pool:
- vmImage: 'windows-2019'
- steps:
- - task: NodeTool@0
- inputs:
- versionSpec: $(node_version)
- displayName: 'Install Node.js'
-
- - task: CacheBeta@... | true |
Other | vercel | next.js | 3cece4d2adc80c0b3bdea26561adf5e9ab2dbae1.json | Update Azure config (#18931) | run-tests.js | @@ -22,6 +22,7 @@ const TIMINGS_API = `https://next-timings.jjsweb.site/api/timings`
parseInt(process.argv[concurrencyIdx + 1], 10) || DEFAULT_CONCURRENCY
const outputTimings = process.argv.indexOf('--timings') !== -1
+ const writeTimings = process.argv.indexOf('--write-timings') !== -1
const isAzure = pr... | true |
Other | vercel | next.js | 3cece4d2adc80c0b3bdea26561adf5e9ab2dbae1.json | Update Azure config (#18931) | test/integration/build-output/test/index.test.js | @@ -91,37 +91,37 @@ describe('Build Output', () => {
}
// should be no bigger than 265 bytes
- expect(parseFloat(indexSize) - 265).toBeLessThanOrEqual(0)
+ expect(parseFloat(indexSize) - 266).toBeLessThanOrEqual(0)
expect(indexSize.endsWith('B')).toBe(true)
// should be no bigg... | true |
Other | vercel | next.js | 9e59a6b57a0566d0424d3008f80259f1fd829e64.json | Add type keyword to API Routes examples (#18234)
The other examples are using the typescript `import type` style, which gets stripped during the build, so I added it to the API Routes example too. | docs/basic-features/typescript.md | @@ -74,7 +74,7 @@ export const getServerSideProps: GetServerSideProps = async (context) => {
The following is an example of how to use the built-in types for API routes:
```ts
-import { NextApiRequest, NextApiResponse } from 'next'
+import type { NextApiRequest, NextApiResponse } from 'next'
export default (req:... | false |
Other | vercel | next.js | b2a8a2f99e769638b1bb647e7f9fdc6ba5f1467b.json | Fix html validation for Image component (#18903)
This PR fixes two bugs causing HTML validators to complain.
- Error: Bad value data:image/svg+xml;charset=utf-8, for attribute src on element img: Illegal character in scheme data: < is not allowed.
- Fixed by using base64 for svg during `layout=intrinsic` to avoid a... | packages/next/client/image.tsx | @@ -1,5 +1,6 @@
import React, { ReactElement } from 'react'
import Head from '../next-server/lib/head'
+import { toBase64 } from '../next-server/lib/to-base-64'
import { useIntersection } from './use-intersection'
const VALID_LOADING_VALUES = ['lazy', 'eager', undefined] as const
@@ -396,17 +397,14 @@ export defa... | true |
Other | vercel | next.js | b2a8a2f99e769638b1bb647e7f9fdc6ba5f1467b.json | Fix html validation for Image component (#18903)
This PR fixes two bugs causing HTML validators to complain.
- Error: Bad value data:image/svg+xml;charset=utf-8, for attribute src on element img: Illegal character in scheme data: < is not allowed.
- Fixed by using base64 for svg during `layout=intrinsic` to avoid a... | packages/next/next-server/lib/to-base-64.ts | @@ -0,0 +1,10 @@
+/**
+ * Isomorphic base64 that works on the server and client
+ */
+export function toBase64(str: string) {
+ if (typeof window === 'undefined') {
+ return Buffer.from(str).toString('base64')
+ } else {
+ return window.btoa(str)
+ }
+} | true |
Other | vercel | next.js | b2a8a2f99e769638b1bb647e7f9fdc6ba5f1467b.json | Fix html validation for Image component (#18903)
This PR fixes two bugs causing HTML validators to complain.
- Error: Bad value data:image/svg+xml;charset=utf-8, for attribute src on element img: Illegal character in scheme data: < is not allowed.
- Fixed by using base64 for svg during `layout=intrinsic` to avoid a... | test/integration/image-component/basic/test/index.test.js | @@ -17,6 +17,8 @@ const appDir = join(__dirname, '../')
let appPort
let app
let browser
+const emptyImage =
+ 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7'
function runTests() {
it('should render an image tag', async () => {
@@ -97,9 +99,9 @@ function lazyLoadingTests() {
... | true |
Other | vercel | next.js | 266c7ed74c52cfe73c304a1adac7b986f4b723a5.json | Add additional tests (#18597)
This PR adds additional security tests. | test/integration/basic/test/security.js | @@ -1,5 +1,6 @@
/* eslint-env jest */
import { fetchViaHTTP } from 'next-test-utils'
+import url from 'url'
module.exports = (context) => {
describe('With Security Related Issues', () => {
@@ -19,5 +20,21 @@ module.exports = (context) => {
}
}
})
+
+ it('should handle encoded / value for... | true |
Other | vercel | next.js | 266c7ed74c52cfe73c304a1adac7b986f4b723a5.json | Add additional tests (#18597)
This PR adds additional security tests. | test/integration/production/next.config.js | @@ -29,6 +29,11 @@ module.exports = {
destination: '/about',
permanent: false,
},
+ {
+ source: '/redirect-query-test/:path',
+ destination: '/about?foo=:path',
+ permanent: false,
+ },
]
},
} | true |
Other | vercel | next.js | 266c7ed74c52cfe73c304a1adac7b986f4b723a5.json | Add additional tests (#18597)
This PR adds additional security tests. | test/integration/production/test/security.js | @@ -234,5 +234,113 @@ module.exports = (context) => {
'url=https%3A%2F%2Fgoogle.com%2Fimage%3Fcrop%3Dfocalpoint%26w%3D24&w=1200&q=100'
)
})
+
+ it('should handle encoded value in the pathname correctly /', async () => {
+ const res = await fetchViaHTTP(
+ context.appPort,
+ '/... | true |
Other | vercel | next.js | 37fb0ad220116181a059a38560dc95667830557e.json | Update image example with link back to source code (#18909)
Fixes #18908 | examples/image-component/components/view-source.js | @@ -0,0 +1,26 @@
+import { svg, arm } from './view-source.module.css'
+
+const ViewSource = ({ pathname }) => (
+ <a
+ title="View Source"
+ href={`https://github.com/vercel/next.js/tree/canary/examples/image-component/${pathname}`}
+ >
+ <svg
+ xmlns="http://www.w3.org/2000/svg"
+ width="80"
+ ... | true |
Other | vercel | next.js | 37fb0ad220116181a059a38560dc95667830557e.json | Update image example with link back to source code (#18909)
Fixes #18908 | examples/image-component/components/view-source.module.css | @@ -0,0 +1,48 @@
+.svg {
+ position: absolute;
+ top: 0;
+ right: 0;
+}
+.arm {
+ transform-origin: 130px 106px;
+}
+
+.svg:hover .arm {
+ animation: wave 560ms ease-in-out;
+}
+
+@keyframes wave {
+ 0% {
+ transform: rotate(0deg);
+ }
+
+ 20% {
+ transform: rotate(-25deg);
+ }
+
+ 40% {
+ transform:... | true |
Other | vercel | next.js | 37fb0ad220116181a059a38560dc95667830557e.json | Update image example with link back to source code (#18909)
Fixes #18908 | examples/image-component/package.json | @@ -1,13 +1,13 @@
{
- "name": "rewrites",
+ "name": "image-component",
"version": "1.0.0",
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start"
},
"dependencies": {
- "next": "latest",
+ "next": "canary",
"react": "^16.13.1",
"react-dom": "^16.13.1"
... | true |
Other | vercel | next.js | 37fb0ad220116181a059a38560dc95667830557e.json | Update image example with link back to source code (#18909)
Fixes #18908 | examples/image-component/pages/background.js | @@ -1,8 +1,10 @@
import Image from 'next/image'
+import ViewSource from '../components/view-source'
import { bgWrap, bgText } from '../styles.module.css'
const Background = () => (
<div>
+ <ViewSource pathname="pages/background.js" />
<div className={bgWrap}>
<Image
alt="Mountains" | true |
Other | vercel | next.js | 37fb0ad220116181a059a38560dc95667830557e.json | Update image example with link back to source code (#18909)
Fixes #18908 | examples/image-component/pages/index.js | @@ -1,11 +1,13 @@
import styles from '../styles.module.css'
import Image from 'next/image'
import Link from 'next/link'
+import ViewSource from '../components/view-source'
const Code = (p) => <code className={styles.inlineCode} {...p} />
const Index = () => (
<div className={styles.container}>
+ <ViewSou... | true |
Other | vercel | next.js | 37fb0ad220116181a059a38560dc95667830557e.json | Update image example with link back to source code (#18909)
Fixes #18908 | examples/image-component/pages/layout-fill.js | @@ -1,7 +1,9 @@
import Image from 'next/image'
+import ViewSource from '../components/view-source'
const Fill = () => (
<div>
+ <ViewSource pathname="pages/layout-fill.js" />
<h1>Image Component With Layout Fill</h1>
<div style={{ position: 'relative', width: '300px', height: '500px' }}>
<Ima... | true |
Other | vercel | next.js | 37fb0ad220116181a059a38560dc95667830557e.json | Update image example with link back to source code (#18909)
Fixes #18908 | examples/image-component/pages/layout-fixed.js | @@ -1,7 +1,9 @@
import Image from 'next/image'
+import ViewSource from '../components/view-source'
const Fixed = () => (
<div>
+ <ViewSource pathname="pages/layout-fixed.js" />
<h1>Image Component With Layout Fixed</h1>
<Image
alt="Mountains" | true |
Other | vercel | next.js | 37fb0ad220116181a059a38560dc95667830557e.json | Update image example with link back to source code (#18909)
Fixes #18908 | examples/image-component/pages/layout-intrinsic.js | @@ -1,7 +1,9 @@
import Image from 'next/image'
+import ViewSource from '../components/view-source'
const Intrinsic = () => (
<div>
+ <ViewSource pathname="pages/layout-intrinsic.js" />
<h1>Image Component With Layout Intrinsic</h1>
<Image
alt="Mountains" | true |
Other | vercel | next.js | 37fb0ad220116181a059a38560dc95667830557e.json | Update image example with link back to source code (#18909)
Fixes #18908 | examples/image-component/pages/layout-responsive.js | @@ -1,7 +1,9 @@
import Image from 'next/image'
+import ViewSource from '../components/view-source'
const Responsive = () => (
<div>
+ <ViewSource pathname="pages/layout-responsive.js" />
<h1>Image Component With Layout Responsive</h1>
<Image
alt="Mountains" | true |
Other | vercel | next.js | d23d25f4b7770ac713de41e97e6d3e3937adea46.json | Fix production test compatibility for ie11 (#18874)
This corrects this test failing from an arrow function being used in ie11 which isn't supported natively
```
● Production Usage › Dynamic import › default behavior › should not remove css styles for same css file between page transitions
JavascriptError: Error... | test/integration/production/test/dynamic.js | @@ -48,9 +48,9 @@ export default (context, render) => {
const firstElement = await browser.elementById('with-css')
const css1 = await firstElement.getComputedCss('display')
expect(css1).toBe('flex')
- await browser.eval(() =>
+ await browser.eval(function () {
... | false |
Other | vercel | next.js | 6fbe5b439dc9725af8cd4889b9bb662a53c07e82.json | Add note about domain locales (#18845) | docs/advanced-features/i18n-routing.md | @@ -91,7 +91,7 @@ By using domain routing you can configure locales to be served from different do
// next.config.js
module.exports = {
i18n: {
- locales: ['en-US', 'fr', 'nl-NL'],
+ locales: ['en-US', 'fr', 'nl-NL', 'nl-BE'],
defaultLocale: 'en-US',
domains: [
@@ -106,6 +106,9 @@ module.exports ... | false |
Other | vercel | next.js | 596ee9c19b076239dd281dfb7739b428c22b425d.json | tests(create-next-app): remove extraneous helper (#18833)
The helper `runStarter()` is extraneous. | test/integration/create-next-app/index.test.js | @@ -12,19 +12,6 @@ const run = (cwd, args, input) => {
const options = input ? { cwd, input } : { cwd }
return execa('node', [cli].concat(args), options)
}
-const runStarter = (cwd, ...args) => {
- const res = run(cwd, args)
-
- res.stdout.on('data', (data) => {
- const stdout = data.toString()
-
- if (/... | false |
Other | vercel | next.js | b3d9fd2a0d7be9070242c4534059dea1c1b0c55a.json | Make getInlineScriptSource arg Readonly (#17281)
The rule [total-functions/no-unsafe-readonly-mutable-assignment](https://github.com/danielnixon/eslint-plugin-total-functions#total-functionsno-unsafe-readonly-mutable-assignment) triggers with this error message:
> Assigning a readonly type to a mutable type can lead t... | packages/next/pages/_document.tsx | @@ -648,7 +648,7 @@ export class NextScript extends Component<OriginProps> {
))
}
- static getInlineScriptSource(documentProps: DocumentProps): string {
+ static getInlineScriptSource(documentProps: Readonly<DocumentProps>): string {
const { __NEXT_DATA__ } = documentProps
try {
const dat... | false |
Other | vercel | next.js | afe475d3d4f339f2e327fe332cdaebbff2f483a9.json | Fix typo on `api-reference/image` (#18818) | docs/api-reference/next/image.md | @@ -129,7 +129,7 @@ When true, the source image will be served as-is instead of changing quality, si
## Other Props
-All other properties on the `Image` component will be passed to the underlying `img` element, except for `style`. Use `className` isntead.
+All other properties on the `Image` component will be pass... | false |
Other | vercel | next.js | 35f8f521a2be959c4a1144923a80e5af98d02873.json | Update Image docs with links to examples (#18770)
This revises the docs to add headings and also links to layout examples.
Fixes #18554 | docs/api-reference/next/image.md | @@ -15,6 +15,8 @@ description: Enable Image Optimization with the built-in Image component.
Image Optimization can be enabled via the `Image` component exported by `next/image`.
+## Usage
+
For an example, consider a project with the following files:
- `pages/index.js`
@@ -43,17 +45,99 @@ function Home() {
ex... | true |
Other | vercel | next.js | 35f8f521a2be959c4a1144923a80e5af98d02873.json | Update Image docs with links to examples (#18770)
This revises the docs to add headings and also links to layout examples.
Fixes #18554 | docs/basic-features/image-optimization.md | @@ -56,48 +56,6 @@ export default Home
In addition to [using properties](/docs/api-reference/next/image.md) available to the `next/image` component, you can optionally configure Image Optimization for more advanced use cases via `next.config.js`.
-If no configuration is provided, the following default configuratio... | true |
Other | vercel | next.js | 35f8f521a2be959c4a1144923a80e5af98d02873.json | Update Image docs with links to examples (#18770)
This revises the docs to add headings and also links to layout examples.
Fixes #18554 | examples/image-component/app.css | @@ -0,0 +1,19 @@
+body {
+ font-family: -apple-system, BlinkMacSystemFont, sans-serif;
+ margin: 0;
+ padding: 0;
+ background: black;
+ color: white;
+}
+
+a {
+ cursor: pointer;
+ color: #0076ff;
+ text-decoration: none;
+ transition: all 0.2s ease;
+ border-bottom: 1px solid black;
+}
+
+a:hover {
+ borde... | true |
Other | vercel | next.js | 35f8f521a2be959c4a1144923a80e5af98d02873.json | Update Image docs with links to examples (#18770)
This revises the docs to add headings and also links to layout examples.
Fixes #18554 | examples/image-component/pages/_app.js | @@ -0,0 +1,5 @@
+import '../app.css'
+
+export default function MyApp({ Component, pageProps }) {
+ return <Component {...pageProps} />
+} | true |
Other | vercel | next.js | 35f8f521a2be959c4a1144923a80e5af98d02873.json | Update Image docs with links to examples (#18770)
This revises the docs to add headings and also links to layout examples.
Fixes #18554 | examples/image-component/pages/background.js | @@ -1,46 +1,22 @@
import Image from 'next/image'
+import { bgWrap, bgText, objectFitCover } from '../styles.module.css'
const Background = () => (
<div>
- <div className="container">
+ <div className={bgWrap}>
<Image
alt="Mountains"
src="/mountains.jpg"
layout="fill"
... | true |
Other | vercel | next.js | 35f8f521a2be959c4a1144923a80e5af98d02873.json | Update Image docs with links to examples (#18770)
This revises the docs to add headings and also links to layout examples.
Fixes #18554 | examples/image-component/pages/index.js | @@ -11,7 +11,7 @@ const Index = () => (
<p>
The images below use the{' '}
<a href="https://nextjs.org/docs/api-reference/next/image">
- <Image>
+ next/image
</a>{' '}
component to ensure optimal format and size for this browser.
</p>
@@ -37,34 +3... | true |
Other | vercel | next.js | 35f8f521a2be959c4a1144923a80e5af98d02873.json | Update Image docs with links to examples (#18770)
This revises the docs to add headings and also links to layout examples.
Fixes #18554 | examples/image-component/pages/layout-fill.js | @@ -1,4 +1,9 @@
import Image from 'next/image'
+import {
+ objectFitContain,
+ objectFitCover,
+ objectFitNone,
+} from '../styles.module.css'
const Fill = () => (
<div>
@@ -8,43 +13,26 @@ const Fill = () => (
alt="Mountains"
src="/mountains.jpg"
layout="fill"
- className="co... | true |
Other | vercel | next.js | 35f8f521a2be959c4a1144923a80e5af98d02873.json | Update Image docs with links to examples (#18770)
This revises the docs to add headings and also links to layout examples.
Fixes #18554 | examples/image-component/pages/layout-fixed.js | @@ -10,14 +10,6 @@ const Fixed = () => (
width={700}
height={475}
/>
- <style jsx global>{`
- body {
- margin: 0;
- padding: 0;
- background: black;
- color: white;
- }
- `}</style>
</div>
)
| true |
Other | vercel | next.js | 35f8f521a2be959c4a1144923a80e5af98d02873.json | Update Image docs with links to examples (#18770)
This revises the docs to add headings and also links to layout examples.
Fixes #18554 | examples/image-component/pages/layout-intrinsic.js | @@ -10,14 +10,6 @@ const Intrinsic = () => (
width={700}
height={475}
/>
- <style jsx global>{`
- body {
- margin: 0;
- padding: 0;
- background: black;
- color: white;
- }
- `}</style>
</div>
)
| true |
Other | vercel | next.js | 35f8f521a2be959c4a1144923a80e5af98d02873.json | Update Image docs with links to examples (#18770)
This revises the docs to add headings and also links to layout examples.
Fixes #18554 | examples/image-component/pages/layout-responsive.js | @@ -10,14 +10,6 @@ const Responsive = () => (
width={700}
height={475}
/>
- <style jsx global>{`
- body {
- margin: 0;
- padding: 0;
- background: black;
- color: white;
- }
- `}</style>
</div>
)
| true |
Other | vercel | next.js | 35f8f521a2be959c4a1144923a80e5af98d02873.json | Update Image docs with links to examples (#18770)
This revises the docs to add headings and also links to layout examples.
Fixes #18554 | examples/image-component/styles.module.css | @@ -1,16 +1,15 @@
.container {
padding: 4rem 1rem;
- font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}
.container p {
margin: 1.5rem 0;
}
.card {
- max-width: 50rem;
- box-shadow: -10px 10px 80px rgba(0, 0, 0, 0.12);
- border: 1px solid #eee;
+ max-width: 60rem;
+ box-shadow: -10px 10px... | true |
Other | vercel | next.js | 1be87040b071320e7a617be80ebbdc46817a5564.json | fix(examples): add missing dependencies wo (#32977)
The `with-jest` example has been converted to TypeScript (#32705) , but `typescript` and `@types/react` were missing from `devDependencies`
## Bug
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attache... | examples/with-jest/package.json | @@ -17,10 +17,12 @@
"@testing-library/jest-dom": "5.16.1",
"@testing-library/react": "12.1.2",
"@testing-library/user-event": "13.5.0",
+ "@types/react": "17.0.38",
"babel-jest": "27.4.5",
"eslint": "8.5.0",
"eslint-config-next": "latest",
"eslint-plugin-testing-library": "5.0.1",
... | false |
Other | vercel | next.js | a5fab84840d0bb384b7cf24d4825a350f0037811.json | Reduce install size for linux glibc/musl (#32850)
In Next.js [12.0.1](
https://packagephobia.com/result?p=next@12.0.1), musl support was added which caused linux to install both glibc and musl binaries.
This PR adds the `install` script to prevent installing unused binaries, reducing the install size by 47MB.
We ori... | packages/next-swc/crates/napi/npm/linux-arm64-gnu/install.js | @@ -0,0 +1,2 @@
+const { glibcVersionRuntime } = process.report.getReport().header;
+process.exit(glibcVersionRuntime ? 0 : 1);
\ No newline at end of file | true |
Other | vercel | next.js | a5fab84840d0bb384b7cf24d4825a350f0037811.json | Reduce install size for linux glibc/musl (#32850)
In Next.js [12.0.1](
https://packagephobia.com/result?p=next@12.0.1), musl support was added which caused linux to install both glibc and musl binaries.
This PR adds the `install` script to prevent installing unused binaries, reducing the install size by 47MB.
We ori... | packages/next-swc/crates/napi/npm/linux-arm64-gnu/package.json | @@ -9,8 +9,12 @@
],
"main": "next-swc.linux-arm64-gnu.node",
"files": [
- "next-swc.linux-arm64-gnu.node"
+ "next-swc.linux-arm64-gnu.node",
+ "install.js"
],
+ "scripts": {
+ "install": "node install.js"
+ },
"license": "MIT",
"engines": {
"node": ">= 10" | true |
Other | vercel | next.js | a5fab84840d0bb384b7cf24d4825a350f0037811.json | Reduce install size for linux glibc/musl (#32850)
In Next.js [12.0.1](
https://packagephobia.com/result?p=next@12.0.1), musl support was added which caused linux to install both glibc and musl binaries.
This PR adds the `install` script to prevent installing unused binaries, reducing the install size by 47MB.
We ori... | packages/next-swc/crates/napi/npm/linux-arm64-musl/install.js | @@ -0,0 +1,2 @@
+const { glibcVersionRuntime } = process.report.getReport().header;
+process.exit(glibcVersionRuntime ? 1 : 0);
\ No newline at end of file | true |
Other | vercel | next.js | a5fab84840d0bb384b7cf24d4825a350f0037811.json | Reduce install size for linux glibc/musl (#32850)
In Next.js [12.0.1](
https://packagephobia.com/result?p=next@12.0.1), musl support was added which caused linux to install both glibc and musl binaries.
This PR adds the `install` script to prevent installing unused binaries, reducing the install size by 47MB.
We ori... | packages/next-swc/crates/napi/npm/linux-arm64-musl/package.json | @@ -9,8 +9,12 @@
],
"main": "next-swc.linux-arm64-musl.node",
"files": [
- "next-swc.linux-arm64-musl.node"
+ "next-swc.linux-arm64-musl.node",
+ "install.js"
],
+ "scripts": {
+ "install": "node install.js"
+ },
"license": "MIT",
"engines": {
"node": ">= 10" | true |
Other | vercel | next.js | a5fab84840d0bb384b7cf24d4825a350f0037811.json | Reduce install size for linux glibc/musl (#32850)
In Next.js [12.0.1](
https://packagephobia.com/result?p=next@12.0.1), musl support was added which caused linux to install both glibc and musl binaries.
This PR adds the `install` script to prevent installing unused binaries, reducing the install size by 47MB.
We ori... | packages/next-swc/crates/napi/npm/linux-x64-gnu/install.js | @@ -0,0 +1,2 @@
+const { glibcVersionRuntime } = process.report.getReport().header;
+process.exit(glibcVersionRuntime ? 0 : 1);
\ No newline at end of file | true |
Other | vercel | next.js | a5fab84840d0bb384b7cf24d4825a350f0037811.json | Reduce install size for linux glibc/musl (#32850)
In Next.js [12.0.1](
https://packagephobia.com/result?p=next@12.0.1), musl support was added which caused linux to install both glibc and musl binaries.
This PR adds the `install` script to prevent installing unused binaries, reducing the install size by 47MB.
We ori... | packages/next-swc/crates/napi/npm/linux-x64-gnu/package.json | @@ -9,8 +9,12 @@
],
"main": "next-swc.linux-x64-gnu.node",
"files": [
- "next-swc.linux-x64-gnu.node"
+ "next-swc.linux-x64-gnu.node",
+ "install.js"
],
+ "scripts": {
+ "install": "node install.js"
+ },
"license": "MIT",
"engines": {
"node": ">= 10" | true |
Other | vercel | next.js | a5fab84840d0bb384b7cf24d4825a350f0037811.json | Reduce install size for linux glibc/musl (#32850)
In Next.js [12.0.1](
https://packagephobia.com/result?p=next@12.0.1), musl support was added which caused linux to install both glibc and musl binaries.
This PR adds the `install` script to prevent installing unused binaries, reducing the install size by 47MB.
We ori... | packages/next-swc/crates/napi/npm/linux-x64-musl/install.js | @@ -0,0 +1,2 @@
+const { glibcVersionRuntime } = process.report.getReport().header;
+process.exit(glibcVersionRuntime ? 1 : 0);
\ No newline at end of file | true |
Other | vercel | next.js | a5fab84840d0bb384b7cf24d4825a350f0037811.json | Reduce install size for linux glibc/musl (#32850)
In Next.js [12.0.1](
https://packagephobia.com/result?p=next@12.0.1), musl support was added which caused linux to install both glibc and musl binaries.
This PR adds the `install` script to prevent installing unused binaries, reducing the install size by 47MB.
We ori... | packages/next-swc/crates/napi/npm/linux-x64-musl/package.json | @@ -9,8 +9,12 @@
],
"main": "next-swc.linux-x64-musl.node",
"files": [
- "next-swc.linux-x64-musl.node"
+ "next-swc.linux-x64-musl.node",
+ "install.js"
],
+ "scripts": {
+ "install": "node install.js"
+ },
"license": "MIT",
"engines": {
"node": ">= 10" | true |
Other | vercel | next.js | 82adaee0cd6d71d8b8307c92115bf032cb6330de.json | Allow to opt-out from preflight cache (#32767)
Fixes #32727
With this PR we introduce a new header that can be used to respond from Middleware `x-middleware-cache`. When the value of this header is set to `no-cache`, the client will **not** store the effects read from a preflight response to be used in an upcoming ch... | packages/next/shared/lib/router/router.ts | @@ -63,6 +63,7 @@ interface NextHistoryState {
}
interface PreflightData {
+ cache?: string | null
redirect?: string | null
refresh?: boolean
rewrite?: string | null
@@ -1950,14 +1951,15 @@ export default class Router implements BaseRouter {
}
return {
+ cache: res.headers.get... | true |
Other | vercel | next.js | 82adaee0cd6d71d8b8307c92115bf032cb6330de.json | Allow to opt-out from preflight cache (#32767)
Fixes #32727
With this PR we introduce a new header that can be used to respond from Middleware `x-middleware-cache`. When the value of this header is set to `no-cache`, the client will **not** store the effects read from a preflight response to be used in an upcoming ch... | test/integration/middleware/core/pages/rewrites/_middleware.js | @@ -30,8 +30,14 @@ export async function middleware(request) {
}
if (url.pathname === '/rewrites/rewrite-me-without-hard-navigation') {
- url.pathname = '/rewrites/about'
url.searchParams.set('middleware', 'foo')
- return NextResponse.rewrite(url)
+ url.pathname =
+ request.cookies['about-byp... | true |
Other | vercel | next.js | 82adaee0cd6d71d8b8307c92115bf032cb6330de.json | Allow to opt-out from preflight cache (#32767)
Fixes #32727
With this PR we introduce a new header that can be used to respond from Middleware `x-middleware-cache`. When the value of this header is set to `no-cache`, the client will **not** store the effects read from a preflight response to be used in an upcoming ch... | test/integration/middleware/core/pages/rewrites/about-bypass.js | @@ -0,0 +1,12 @@
+export default function AboutBypass({ message }) {
+ return (
+ <div>
+ <h1 className="title">About Bypassed Page</h1>
+ <p className={message}>{message}</p>
+ </div>
+ )
+}
+
+export const getServerSideProps = ({ query }) => ({
+ props: { message: query.message || '' },
+}) | true |
Other | vercel | next.js | 82adaee0cd6d71d8b8307c92115bf032cb6330de.json | Allow to opt-out from preflight cache (#32767)
Fixes #32727
With this PR we introduce a new header that can be used to respond from Middleware `x-middleware-cache`. When the value of this header is set to `no-cache`, the client will **not** store the effects read from a preflight response to be used in an upcoming ch... | test/integration/middleware/core/test/index.test.js | @@ -213,6 +213,18 @@ function rewriteTests(locale = '') {
const element = await browser.elementByCss('.middleware')
expect(await element.text()).toEqual('foo')
})
+
+ it('should allow to opt-out preflight caching', async () => {
+ const browser = await webdriver(context.appPort, '/rewrites/')
+ awai... | true |
Other | vercel | next.js | 4d307716f712e0d4376b203bbbeb5c2054d4fe30.json | Fix issue with escape-string-regexp in IE11 (#32708)
* Fix issue with escape-string-regexp in IE11
* remove escape-string-regexp dep
* Update compiled
* Link to original repo | packages/next/build/index.ts | @@ -5,7 +5,7 @@ import { isMatch } from 'next/dist/compiled/micromatch'
import { promises, writeFileSync } from 'fs'
import { Worker } from '../lib/worker'
import devalue from 'next/dist/compiled/devalue'
-import escapeStringRegexp from 'next/dist/compiled/escape-string-regexp'
+import { escapeStringRegexp } from '.... | true |
Other | vercel | next.js | 4d307716f712e0d4376b203bbbeb5c2054d4fe30.json | Fix issue with escape-string-regexp in IE11 (#32708)
* Fix issue with escape-string-regexp in IE11
* remove escape-string-regexp dep
* Update compiled
* Link to original repo | packages/next/build/webpack-config.ts | @@ -6,7 +6,7 @@ import semver from 'next/dist/compiled/semver'
import { webpack } from 'next/dist/compiled/webpack/webpack'
import type { webpack5 } from 'next/dist/compiled/webpack/webpack'
import path, { join as pathJoin, relative as relativePath } from 'path'
-import escapeRegExp from 'next/dist/compiled/escape-s... | true |
Other | vercel | next.js | 4d307716f712e0d4376b203bbbeb5c2054d4fe30.json | Fix issue with escape-string-regexp in IE11 (#32708)
* Fix issue with escape-string-regexp in IE11
* remove escape-string-regexp dep
* Update compiled
* Link to original repo | packages/next/build/webpack/loaders/next-serverless-loader/index.ts | @@ -1,10 +1,10 @@
import devalue from 'next/dist/compiled/devalue'
-import escapeRegexp from 'next/dist/compiled/escape-string-regexp'
import { join } from 'path'
import { parse } from 'querystring'
import { webpack } from 'next/dist/compiled/webpack/webpack'
import { API_ROUTE } from '../../../../lib/constants'
... | true |
Other | vercel | next.js | 4d307716f712e0d4376b203bbbeb5c2054d4fe30.json | Fix issue with escape-string-regexp in IE11 (#32708)
* Fix issue with escape-string-regexp in IE11
* remove escape-string-regexp dep
* Update compiled
* Link to original repo | packages/next/compiled/chalk/index.js | @@ -1 +1 @@
-(()=>{var r={598:(r,e,n)=>{var t=n(120);var a={};for(var o in t){if(t.hasOwnProperty(o)){a[t[o]]=o}}var s=r.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{cha... | true |
Other | vercel | next.js | 4d307716f712e0d4376b203bbbeb5c2054d4fe30.json | Fix issue with escape-string-regexp in IE11 (#32708)
* Fix issue with escape-string-regexp in IE11
* remove escape-string-regexp dep
* Update compiled
* Link to original repo | packages/next/compiled/escape-string-regexp/LICENSE | @@ -1,9 +0,0 @@
-MIT License
-
-Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without lim... | true |
Other | vercel | next.js | 4d307716f712e0d4376b203bbbeb5c2054d4fe30.json | Fix issue with escape-string-regexp in IE11 (#32708)
* Fix issue with escape-string-regexp in IE11
* remove escape-string-regexp dep
* Update compiled
* Link to original repo | packages/next/compiled/escape-string-regexp/index.js | @@ -1 +0,0 @@
-(function(){"use strict";var e={3:function(e){const r=/[|\\{}()[\]^$+*?.-]/g;e.exports=e=>{if(typeof e!=="string"){throw new TypeError("Expected a string")}return e.replace(r,"\\$&")}}};var r={};function __nccwpck_require__(_){var t=r[_];if(t!==undefined){return t.exports}var i=r[_]={exports:{}};var n=tr... | true |
Other | vercel | next.js | 4d307716f712e0d4376b203bbbeb5c2054d4fe30.json | Fix issue with escape-string-regexp in IE11 (#32708)
* Fix issue with escape-string-regexp in IE11
* remove escape-string-regexp dep
* Update compiled
* Link to original repo | packages/next/compiled/escape-string-regexp/package.json | @@ -1 +0,0 @@
-{"name":"escape-string-regexp","main":"index.js","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"license":"MIT"} | true |
Other | vercel | next.js | 4d307716f712e0d4376b203bbbeb5c2054d4fe30.json | Fix issue with escape-string-regexp in IE11 (#32708)
* Fix issue with escape-string-regexp in IE11
* remove escape-string-regexp dep
* Update compiled
* Link to original repo | packages/next/lib/load-custom-routes.ts | @@ -2,7 +2,7 @@ import chalk from 'next/dist/compiled/chalk'
import { parse as parseUrl } from 'url'
import { NextConfig } from '../server/config'
import * as pathToRegexp from 'next/dist/compiled/path-to-regexp'
-import escapeStringRegexp from 'next/dist/compiled/escape-string-regexp'
+import { escapeStringRegexp }... | true |
Other | vercel | next.js | 4d307716f712e0d4376b203bbbeb5c2054d4fe30.json | Fix issue with escape-string-regexp in IE11 (#32708)
* Fix issue with escape-string-regexp in IE11
* remove escape-string-regexp dep
* Update compiled
* Link to original repo | packages/next/package.json | @@ -194,7 +194,6 @@
"debug": "4.1.1",
"devalue": "2.0.1",
"domain-browser": "4.19.0",
- "escape-string-regexp": "2.0.0",
"etag": "1.8.1",
"events": "3.3.0",
"find-cache-dir": "3.3.1", | true |
Other | vercel | next.js | 4d307716f712e0d4376b203bbbeb5c2054d4fe30.json | Fix issue with escape-string-regexp in IE11 (#32708)
* Fix issue with escape-string-regexp in IE11
* remove escape-string-regexp dep
* Update compiled
* Link to original repo | packages/next/shared/lib/escape-regexp.ts | @@ -0,0 +1,4 @@
+// regexp from https://github.com/sindresorhus/escape-string-regexp
+export function escapeStringRegexp(str: string) {
+ return str.replace(/[|\\{}()[\]^$+*?.-]/g, '\\$&')
+} | true |
Other | vercel | next.js | 4d307716f712e0d4376b203bbbeb5c2054d4fe30.json | Fix issue with escape-string-regexp in IE11 (#32708)
* Fix issue with escape-string-regexp in IE11
* remove escape-string-regexp dep
* Update compiled
* Link to original repo | packages/next/shared/lib/post-process.ts | @@ -1,4 +1,4 @@
-import escapeRegexp from 'next/dist/compiled/escape-string-regexp'
+import { escapeStringRegexp } from './escape-regexp'
import { parse, HTMLElement } from 'next/dist/compiled/node-html-parser'
import { OPTIMIZED_FONT_PROVIDERS } from './constants'
@@ -216,7 +216,7 @@ function isImgEligible(imgElem... | true |
Other | vercel | next.js | 4d307716f712e0d4376b203bbbeb5c2054d4fe30.json | Fix issue with escape-string-regexp in IE11 (#32708)
* Fix issue with escape-string-regexp in IE11
* remove escape-string-regexp dep
* Update compiled
* Link to original repo | packages/next/shared/lib/router/utils/prepare-destination.ts | @@ -4,7 +4,7 @@ import type { NextParsedUrlQuery } from '../../../../server/request-meta'
import type { Params } from '../../../../server/router'
import type { RouteHas } from '../../../../lib/load-custom-routes'
import { compile, pathToRegexp } from 'next/dist/compiled/path-to-regexp'
-import escapeStringRegexp fro... | true |
Other | vercel | next.js | 4d307716f712e0d4376b203bbbeb5c2054d4fe30.json | Fix issue with escape-string-regexp in IE11 (#32708)
* Fix issue with escape-string-regexp in IE11
* remove escape-string-regexp dep
* Update compiled
* Link to original repo | packages/next/taskfile.js | @@ -741,16 +741,6 @@ export async function ncc_devalue(task, opts) {
.ncc({ packageName: 'devalue', externals })
.target('compiled/devalue')
}
-externals['escape-string-regexp'] = 'next/dist/compiled/escape-string-regexp'
-// eslint-disable-next-line camelcase
-export async function ncc_escape_string_regexp(... | true |
Other | vercel | next.js | 4d307716f712e0d4376b203bbbeb5c2054d4fe30.json | Fix issue with escape-string-regexp in IE11 (#32708)
* Fix issue with escape-string-regexp in IE11
* remove escape-string-regexp dep
* Update compiled
* Link to original repo | packages/next/types/misc.d.ts | @@ -164,10 +164,6 @@ declare module 'next/dist/compiled/devalue' {
import m from 'devalue'
export = m
}
-declare module 'next/dist/compiled/escape-string-regexp' {
- import m from 'escape-string-regexp'
- export = m
-}
declare module 'next/dist/compiled/find-up' {
import m from 'find-up'
export = m | true |
Other | vercel | next.js | c9c3183292b454e042a39085ec719f95f9c50532.json | Remove un-needed test dependency (#32616)
* Remove un-needed test dependency
* update test
* update compiled | package.json | @@ -87,7 +87,6 @@
"async-sema": "3.0.1",
"browserslist": "4.18.1",
"cheerio": "0.22.0",
- "clone": "2.1.2",
"cookie": "0.4.1",
"cors": "2.8.5",
"coveralls": "3.0.3", | true |
Other | vercel | next.js | c9c3183292b454e042a39085ec719f95f9c50532.json | Remove un-needed test dependency (#32616)
* Remove un-needed test dependency
* update test
* update compiled | packages/next/compiled/ora/index.js | @@ -1 +1 @@
-(()=>{var e={420:(e,t,r)=>{var s=r(321);e.exports=function(e,t){e=e||{};Object.keys(t).forEach((function(r){if(typeof e[r]==="undefined"){e[r]=s(t[r])}}));return e}},321:e=>{var t=function(){"use strict";function clone(e,t,r,s){var i;if(typeof t==="object"){r=t.depth;s=t.prototype;i=t.filter;t=t.circular}v... | true |
Other | vercel | next.js | c9c3183292b454e042a39085ec719f95f9c50532.json | Remove un-needed test dependency (#32616)
* Remove un-needed test dependency
* update test
* update compiled | test/integration/api-body-parser/test/index.test.js | @@ -8,7 +8,6 @@ import {
fetchViaHTTP,
initNextServerScript,
} from 'next-test-utils'
-import clone from 'clone'
import getPort from 'get-port'
const appDir = join(__dirname, '../')
@@ -70,12 +69,7 @@ async function makeRequestWithInvalidContentType() {
const startServer = async (optEnv = {}, opts) => {
... | true |
Other | vercel | next.js | c9c3183292b454e042a39085ec719f95f9c50532.json | Remove un-needed test dependency (#32616)
* Remove un-needed test dependency
* update test
* update compiled | test/integration/custom-server/test/index.test.js | @@ -4,7 +4,6 @@ import webdriver from 'next-webdriver'
import { join } from 'path'
import getPort from 'get-port'
import cheerio from 'cheerio'
-import clone from 'clone'
import {
initNextServerScript,
killApp,
@@ -27,8 +26,7 @@ const startServer = async (optEnv = {}, opts) => {
const scriptPath = join(app... | true |
Other | vercel | next.js | c9c3183292b454e042a39085ec719f95f9c50532.json | Remove un-needed test dependency (#32616)
* Remove un-needed test dependency
* update test
* update compiled | test/integration/fetch-polyfill-ky-universal/test/index.test.js | @@ -11,7 +11,6 @@ import {
nextBuild,
nextStart,
} from 'next-test-utils'
-import clone from 'clone'
const appDir = join(__dirname, '../')
const nextConfig = join(appDir, 'next.config.js')
@@ -24,8 +23,7 @@ const startApiServer = async (optEnv = {}, opts) => {
const scriptPath = join(appDir, 'api-server.j... | true |
Other | vercel | next.js | c9c3183292b454e042a39085ec719f95f9c50532.json | Remove un-needed test dependency (#32616)
* Remove un-needed test dependency
* update test
* update compiled | test/integration/fetch-polyfill/test/index.test.js | @@ -12,7 +12,6 @@ import {
nextBuild,
nextStart,
} from 'next-test-utils'
-import clone from 'clone'
import cheerio from 'cheerio'
const appDir = join(__dirname, '../')
@@ -26,8 +25,7 @@ const startApiServer = async (optEnv = {}, opts) => {
const scriptPath = join(appDir, 'api-server.js')
apiServerPort... | true |
Other | vercel | next.js | c9c3183292b454e042a39085ec719f95f9c50532.json | Remove un-needed test dependency (#32616)
* Remove un-needed test dependency
* update test
* update compiled | test/integration/filesystempublicroutes/test/index.test.js | @@ -8,7 +8,6 @@ import {
killApp,
getPageFileFromBuildManifest,
} from 'next-test-utils'
-import clone from 'clone'
const appDir = join(__dirname, '../')
let appPort
@@ -19,12 +18,7 @@ const context = {}
const startServer = async (optEnv = {}) => {
const scriptPath = join(appDir, 'server.js')
context.... | true |
Other | vercel | next.js | c9c3183292b454e042a39085ec719f95f9c50532.json | Remove un-needed test dependency (#32616)
* Remove un-needed test dependency
* update test
* update compiled | test/integration/ondemand/test/index.test.js | @@ -3,7 +3,6 @@ import WebSocket from 'ws'
import { join } from 'path'
import webdriver from 'next-webdriver'
import getPort from 'get-port'
-import clone from 'clone'
import {
renderViaHTTP,
fetchViaHTTP,
@@ -24,8 +23,7 @@ const startServer = async (optEnv = {}, opts) => {
const scriptPath = join(appDir, ... | true |
Other | vercel | next.js | c9c3183292b454e042a39085ec719f95f9c50532.json | Remove un-needed test dependency (#32616)
* Remove un-needed test dependency
* update test
* update compiled | yarn.lock | @@ -7100,10 +7100,6 @@ clone-response@^1.0.2:
dependencies:
mimic-response "^1.0.0"
-clone@2.1.2:
- version "2.1.2"
- resolved "https://registry.yarnpkg.com/clone/-/clone-2.1.2.tgz#1b7f4b9f591f1e8f83670401600345a02887435f"
-
clone@^1.0.2:
version "1.0.4"
resolved "https://registry.yarnpkg.com/clone/-... | true |
Other | vercel | next.js | a5bfc1eecc34e176f9f27955fde7b16e17de3c5e.json | Simplify trace span id generation (#32946)
Uses a simple counter for span ids, previously these required to be randomly generated but I've changed the importer script to ensure it gets prepended `0`s to make sure it gets to 16 characters which Jaeger requires.
## Bug
- [ ] Related issues linked using `fixes #numbe... | packages/next/trace/report/to-json.ts | @@ -12,9 +12,9 @@ const localEndpoint = {
type Event = {
traceId: string
- parentId?: string
+ parentId?: number
name: string
- id: string
+ id: number
timestamp: number
duration: number
localEndpoint?: typeof localEndpoint
@@ -119,8 +119,8 @@ const reportToLocalHost = (
name: string,
durati... | true |
Other | vercel | next.js | a5bfc1eecc34e176f9f27955fde7b16e17de3c5e.json | Simplify trace span id generation (#32946)
Uses a simple counter for span ids, previously these required to be randomly generated but I've changed the importer script to ensure it gets prepended `0`s to make sure it gets to 16 characters which Jaeger requires.
## Bug
- [ ] Related issues linked using `fixes #numbe... | packages/next/trace/shared.ts | @@ -1,6 +1,4 @@
-// eslint typescript has a bug with TS enums
-
-export type SpanId = string
+export type SpanId = number
export const traceGlobals: Map<any, any> = new Map()
export const setGlobal = (key: any, val: any) => { | true |
Other | vercel | next.js | a5bfc1eecc34e176f9f27955fde7b16e17de3c5e.json | Simplify trace span id generation (#32946)
Uses a simple counter for span ids, previously these required to be randomly generated but I've changed the importer script to ensure it gets prepended `0`s to make sure it gets to 16 characters which Jaeger requires.
## Bug
- [ ] Related issues linked using `fixes #numbe... | packages/next/trace/trace.ts | @@ -1,10 +1,12 @@
-import { customAlphabet } from 'next/dist/compiled/nanoid/index.cjs'
import { SpanId } from './shared'
import { reporter } from './report'
const NUM_OF_MICROSEC_IN_SEC = BigInt('1000')
-const nanoid = customAlphabet('0123456789abcdefghijklmnopqrstuvwxyz', 8)
-const getId = () => Buffer.from(nano... | true |
Other | vercel | next.js | a5bfc1eecc34e176f9f27955fde7b16e17de3c5e.json | Simplify trace span id generation (#32946)
Uses a simple counter for span ids, previously these required to be randomly generated but I've changed the importer script to ensure it gets prepended `0`s to make sure it gets to 16 characters which Jaeger requires.
## Bug
- [ ] Related issues linked using `fixes #numbe... | scripts/send-trace-to-jaeger.mjs | @@ -1,68 +0,0 @@
-import fs from 'fs'
-import eventStream from 'event-stream'
-import retry from 'async-retry'
-import fetch from 'node-fetch'
-
-const file = fs.createReadStream(process.argv[2])
-
-const localEndpoint = {
- serviceName: 'nextjs',
- ipv4: '127.0.0.1',
- port: 9411,
-}
-
-// Jaeger supports Zipkin's ... | true |
Other | vercel | next.js | a5bfc1eecc34e176f9f27955fde7b16e17de3c5e.json | Simplify trace span id generation (#32946)
Uses a simple counter for span ids, previously these required to be randomly generated but I've changed the importer script to ensure it gets prepended `0`s to make sure it gets to 16 characters which Jaeger requires.
## Bug
- [ ] Related issues linked using `fixes #numbe... | scripts/send-trace-to-jaeger/src/main.rs | @@ -37,6 +37,15 @@ fn send_json_to_zipkin(zipkin_api: &str, value: String) {
println!("body = {:?}", res.text());
}
+// function to append zero to a number until 16 characters
+fn pad_zeros(num: u64) -> String {
+ let mut num_str = num.to_string();
+ while num_str.len() < 16 {
+ num_str = format!("... | true |
Other | vercel | next.js | 9d1fbbca7baa9a36d6bfc7b2fae3a519f3165794.json | ignore .d.ts files inside pages folder (#30728)
Fixes https://github.com/vercel/next.js/issues/30698 and https://github.com/vercel/next.js/discussions/30618
## Bug
- [x] Related issues linked using `fixes #number`
- [x] Integration tests added | packages/next/build/entries.ts | @@ -36,6 +36,12 @@ export function createPagesMapping(
}
): PagesMapping {
const previousPages: PagesMapping = {}
+
+ // Do not process .d.ts files inside the `pages` folder
+ pagePaths = extensions.includes('ts')
+ ? pagePaths.filter((pagePath) => !pagePath.endsWith('.d.ts'))
+ : pagePaths
+
const pa... | true |
Other | vercel | next.js | 9d1fbbca7baa9a36d6bfc7b2fae3a519f3165794.json | ignore .d.ts files inside pages folder (#30728)
Fixes https://github.com/vercel/next.js/issues/30698 and https://github.com/vercel/next.js/discussions/30618
## Bug
- [x] Related issues linked using `fixes #number`
- [x] Integration tests added | test/integration/404-page/pages/invalidExtension.d.ts | @@ -0,0 +1 @@
+export const container: string | true |
Other | vercel | next.js | 9d1fbbca7baa9a36d6bfc7b2fae3a519f3165794.json | ignore .d.ts files inside pages folder (#30728)
Fixes https://github.com/vercel/next.js/issues/30698 and https://github.com/vercel/next.js/discussions/30618
## Bug
- [x] Related issues linked using `fixes #number`
- [x] Integration tests added | test/integration/404-page/test/index.test.js | @@ -38,6 +38,11 @@ const runTests = (mode = 'server') => {
expect(res.status).toBe(404)
})
+ it('should use pages/404 for .d.ts file', async () => {
+ const html = await renderViaHTTP(appPort, '/invalidExtension')
+ expect(html).toContain('custom 404 page')
+ })
+
it('should not error when visited ... | true |
Other | vercel | next.js | 9d1fbbca7baa9a36d6bfc7b2fae3a519f3165794.json | ignore .d.ts files inside pages folder (#30728)
Fixes https://github.com/vercel/next.js/issues/30698 and https://github.com/vercel/next.js/discussions/30618
## Bug
- [x] Related issues linked using `fixes #number`
- [x] Integration tests added | test/integration/page-extensions/pages/invalidExtension.d.ts | @@ -0,0 +1 @@
+export const container: string | true |
Other | vercel | next.js | 9d1fbbca7baa9a36d6bfc7b2fae3a519f3165794.json | ignore .d.ts files inside pages folder (#30728)
Fixes https://github.com/vercel/next.js/issues/30698 and https://github.com/vercel/next.js/discussions/30618
## Bug
- [x] Related issues linked using `fixes #number`
- [x] Integration tests added | test/integration/page-extensions/test/index.test.js | @@ -64,4 +64,17 @@ describe('Page Extensions', () => {
'@zeit/next-typescript is no longer needed since Next.js has built-in support for TypeScript now'
)
})
+
+ it('should not throw if .d.ts file inside the pages folder', async () => {
+ await fs.writeFile(
+ nextConfig,
+ `module.exports ... | true |
Other | vercel | next.js | 636d3aeda753301657cf9f2e9faa8e947392bfe2.json | doc: add quotes to api (#32898)
x-ref: #32896 | docs/advanced-features/react-18.md | @@ -12,7 +12,7 @@ Ensure you have the `rc` npm tag of React installed:
npm install next@latest react@rc react-dom@rc
```
-That's all! You can now start using React 18's new APIs like `startTransition` and Suspense in Next.js.
+That's all! You can now start using React 18's new APIs like `startTransition` and `Suspe... | false |
Other | vercel | next.js | ec2e107f7fefb5d13402c2888ffea33bfe78bebe.json | Update the React 18 documentation (#32896)
Currently you don't need to enable `concurrentFeatures` to start using React 18, this PR makes the docs more clear on that.
## Bug
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`
... | docs/advanced-features/react-18.md | @@ -12,6 +12,8 @@ Ensure you have the `rc` npm tag of React installed:
npm install next@latest react@rc react-dom@rc
```
+That's all! You can now start using React 18's new APIs like `startTransition` and Suspense in Next.js.
+
### Enable SSR Streaming (Alpha)
Concurrent features in React 18 include built-in su... | false |
Other | vercel | next.js | 3ca8ce07a6c4f456cc70fe5c23b6f9f253c4d027.json | Add id to inline Segment script (#32878)
When I don't include an `id`, I see the console error "VM1624:1 Segment snippet included twice."
According to https://nextjs.org/docs/basic-features/script#inline-scripts, an id should be added for inline scripts.
## Documentation / Examples
- [ ] Make sure the linting pass... | examples/with-segment-analytics/pages/_app.js | @@ -24,7 +24,10 @@ function MyApp({ Component, pageProps }) {
return (
<Page>
{/* Inject the Segment snippet into the <head> of the document */}
- <Script dangerouslySetInnerHTML={{ __html: renderSnippet() }} />
+ <Script
+ id="segment-script"
+ dangerouslySetInnerHTML={{ __html:... | false |
Other | vercel | next.js | 6b866533cd7276e00ceed0710a152a36c1a86f63.json | chore(examples): remove duplicate examples (#32779)
`with-webpack-bundle-analyzer` and `with-webpack-bundle-size-analyzer` are a duplicate/outdated versions of the `analyze-bundles` example and thus should be removed to avoid confusion.
Related: #26715
## Bug
- [ ] Related issues linked using `fixes #number`
- [ ] I... | examples/with-webpack-bundle-analyzer/.gitignore | @@ -1,34 +0,0 @@
-# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
-
-# dependencies
-/node_modules
-/.pnp
-.pnp.js
-
-# testing
-/coverage
-
-# next.js
-/.next/
-/out/
-
-# production
-/build
-
-# misc
-.DS_Store
-*.pem
-
-# debug
-npm-debug.log*
-yarn-debug.log*
-yarn-error.log*
-... | true |
Other | vercel | next.js | 6b866533cd7276e00ceed0710a152a36c1a86f63.json | chore(examples): remove duplicate examples (#32779)
`with-webpack-bundle-analyzer` and `with-webpack-bundle-size-analyzer` are a duplicate/outdated versions of the `analyze-bundles` example and thus should be removed to avoid confusion.
Related: #26715
## Bug
- [ ] Related issues linked using `fixes #number`
- [ ] I... | examples/with-webpack-bundle-analyzer/README.md | @@ -1,3 +0,0 @@
-# Webpack Bundle Analyzer example
-
-This example have been moved here: [analyze-bundles](https://github.com/vercel/next.js/tree/canary/examples/analyze-bundles) | true |
Other | vercel | next.js | 6b866533cd7276e00ceed0710a152a36c1a86f63.json | chore(examples): remove duplicate examples (#32779)
`with-webpack-bundle-analyzer` and `with-webpack-bundle-size-analyzer` are a duplicate/outdated versions of the `analyze-bundles` example and thus should be removed to avoid confusion.
Related: #26715
## Bug
- [ ] Related issues linked using `fixes #number`
- [ ] I... | examples/with-webpack-bundle-size-analyzer/.gitignore | @@ -1,34 +0,0 @@
-# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
-
-# dependencies
-/node_modules
-/.pnp
-.pnp.js
-
-# testing
-/coverage
-
-# next.js
-/.next/
-/out/
-
-# production
-/build
-
-# misc
-.DS_Store
-*.pem
-
-# debug
-npm-debug.log*
-yarn-debug.log*
-yarn-error.log*
-... | true |
Other | vercel | next.js | 6b866533cd7276e00ceed0710a152a36c1a86f63.json | chore(examples): remove duplicate examples (#32779)
`with-webpack-bundle-analyzer` and `with-webpack-bundle-size-analyzer` are a duplicate/outdated versions of the `analyze-bundles` example and thus should be removed to avoid confusion.
Related: #26715
## Bug
- [ ] Related issues linked using `fixes #number`
- [ ] I... | examples/with-webpack-bundle-size-analyzer/README.md | @@ -1,29 +0,0 @@
-# Webpack Bundle Size Analyzer
-
-This example shows how to analyze the output bundles using [webpack-bundle-size-analyzer](https://www.npmjs.com/package/webpack-bundle-size-analyzer)
-
-## Preview
-
-Preview the example live on [StackBlitz](http://stackblitz.com/):
-
-[: remove duplicate examples (#32779)
`with-webpack-bundle-analyzer` and `with-webpack-bundle-size-analyzer` are a duplicate/outdated versions of the `analyze-bundles` example and thus should be removed to avoid confusion.
Related: #26715
## Bug
- [ ] Related issues linked using `fixes #number`
- [ ] I... | examples/with-webpack-bundle-size-analyzer/next.config.js | @@ -1,14 +0,0 @@
-const {
- WebpackBundleSizeAnalyzerPlugin,
-} = require('webpack-bundle-size-analyzer')
-const { ANALYZE } = process.env
-
-module.exports = {
- webpack: function (config) {
- if (ANALYZE) {
- config.plugins.push(new WebpackBundleSizeAnalyzerPlugin('stats.txt'))
- }
-
- return config
-... | true |
Other | vercel | next.js | 6b866533cd7276e00ceed0710a152a36c1a86f63.json | chore(examples): remove duplicate examples (#32779)
`with-webpack-bundle-analyzer` and `with-webpack-bundle-size-analyzer` are a duplicate/outdated versions of the `analyze-bundles` example and thus should be removed to avoid confusion.
Related: #26715
## Bug
- [ ] Related issues linked using `fixes #number`
- [ ] I... | examples/with-webpack-bundle-size-analyzer/package.json | @@ -1,17 +0,0 @@
-{
- "private": true,
- "scripts": {
- "dev": "next",
- "build": "next build",
- "start": "next start",
- "analyze": "cross-env ANALYZE=1 next build && cat .next/stats.txt"
- },
- "dependencies": {
- "cross-env": "^5.0.1",
- "faker": "^4.1.0",
- "next": "latest",
- "react": ... | true |
Other | vercel | next.js | 6b866533cd7276e00ceed0710a152a36c1a86f63.json | chore(examples): remove duplicate examples (#32779)
`with-webpack-bundle-analyzer` and `with-webpack-bundle-size-analyzer` are a duplicate/outdated versions of the `analyze-bundles` example and thus should be removed to avoid confusion.
Related: #26715
## Bug
- [ ] Related issues linked using `fixes #number`
- [ ] I... | examples/with-webpack-bundle-size-analyzer/pages/about.js | @@ -1,31 +0,0 @@
-import Link from 'next/link'
-import faker from 'faker'
-
-const About = ({ name }) => {
- return (
- <div>
- <h1>About Page</h1>
- <p>Welcome, {name}.</p>
- <p>
- This page is using getStaticProps, so the name will always be {name}{' '}
- even if you reload the page.
... | true |
Other | vercel | next.js | 6b866533cd7276e00ceed0710a152a36c1a86f63.json | chore(examples): remove duplicate examples (#32779)
`with-webpack-bundle-analyzer` and `with-webpack-bundle-size-analyzer` are a duplicate/outdated versions of the `analyze-bundles` example and thus should be removed to avoid confusion.
Related: #26715
## Bug
- [ ] Related issues linked using `fixes #number`
- [ ] I... | examples/with-webpack-bundle-size-analyzer/pages/contact.js | @@ -1,3 +0,0 @@
-export default function Contact() {
- return <div>This is the contact page.</div>
-} | true |
Other | vercel | next.js | 6b866533cd7276e00ceed0710a152a36c1a86f63.json | chore(examples): remove duplicate examples (#32779)
`with-webpack-bundle-analyzer` and `with-webpack-bundle-size-analyzer` are a duplicate/outdated versions of the `analyze-bundles` example and thus should be removed to avoid confusion.
Related: #26715
## Bug
- [ ] Related issues linked using `fixes #number`
- [ ] I... | examples/with-webpack-bundle-size-analyzer/pages/index.js | @@ -1,31 +0,0 @@
-import Link from 'next/link'
-import faker from 'faker'
-
-const Index = ({ name }) => {
- return (
- <div>
- <h1>Home Page</h1>
- <p>Welcome, {name}.</p>
- <p>
- This page is using getServerSideProps, so the name will be different
- every time the page is rendered.
- ... | true |
Other | vercel | next.js | e3776989bf26e9a236c6156c8078ab36ad8412ac.json | Remove anonymous default export rule from Babel (#32763)
We didn't port this plugin to next-swc given that the eslint setup warns for this automatically. Given that we still get issues opened for this particular warning coming from the plugin it'd be good to remove it.
## Bug
- [ ] Related issues linked using `fix... | packages/next/build/babel/loader/get-config.ts | @@ -81,13 +81,6 @@ function getPlugins(
{ type: 'plugin' }
)
: null
- const noAnonymousDefaultExportItem =
- hasReactRefresh && !isServer
- ? createConfigItem(
- [require('../plugins/no-anonymous-default-export'), {}],
- { type: 'plugin' }
- )
- : null
cons... | true |
Other | vercel | next.js | e3776989bf26e9a236c6156c8078ab36ad8412ac.json | Remove anonymous default export rule from Babel (#32763)
We didn't port this plugin to next-swc given that the eslint setup warns for this automatically. Given that we still get issues opened for this particular warning coming from the plugin it'd be good to remove it.
## Bug
- [ ] Related issues linked using `fix... | packages/next/build/babel/plugins/no-anonymous-default-export.ts | @@ -1,93 +0,0 @@
-import { PluginObj, types as BabelTypes } from 'next/dist/compiled/babel/core'
-import chalk from 'next/dist/compiled/chalk'
-
-export default function NoAnonymousDefaultExport({
- types: t,
- ...babel
-}: {
- types: typeof BabelTypes
- caller: (callerCallback: (caller: any) => any) => any
-}): Pl... | true |
Other | vercel | next.js | e3776989bf26e9a236c6156c8078ab36ad8412ac.json | Remove anonymous default export rule from Babel (#32763)
We didn't port this plugin to next-swc given that the eslint setup warns for this automatically. Given that we still get issues opened for this particular warning coming from the plugin it'd be good to remove it.
## Bug
- [ ] Related issues linked using `fix... | test/integration/no-anon-default-export/.babelrc | @@ -1,3 +0,0 @@
-{
- "presets": ["next/babel"]
-} | true |
Other | vercel | next.js | e3776989bf26e9a236c6156c8078ab36ad8412ac.json | Remove anonymous default export rule from Babel (#32763)
We didn't port this plugin to next-swc given that the eslint setup warns for this automatically. Given that we still get issues opened for this particular warning coming from the plugin it'd be good to remove it.
## Bug
- [ ] Related issues linked using `fix... | test/integration/no-anon-default-export/components/Child.js | @@ -1,3 +0,0 @@
-export default () => {
- return <div />
-} | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.