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 | bc429f50c270a1da07c4833a5e64e5ddebe5a8c2.json | Remove future.strictPostcssConfiguration config (#32098) | packages/next/build/webpack/config/blocks/css/index.ts | @@ -42,7 +42,6 @@ let postcssInstancePromise: Promise<any>
export async function lazyPostCSS(
rootDirectory: string,
supportedBrowsers: string[] | undefined,
- strictPostcssConfiguration: boolean | undefined,
disablePostcssPresetEnv: boolean | undefined
) {
if (!postcssInstancePromise) {
@@ -117,7 +116,6... | true |
Other | vercel | next.js | bc429f50c270a1da07c4833a5e64e5ddebe5a8c2.json | Remove future.strictPostcssConfiguration config (#32098) | packages/next/build/webpack/config/blocks/css/plugins.ts | @@ -117,12 +117,12 @@ function getDefaultPlugins(
export async function getPostCssPlugins(
dir: string,
supportedBrowsers: string[] | undefined,
- defaults: boolean = false,
disablePostcssPresetEnv: boolean = false
): Promise<import('postcss').AcceptedPlugin[]> {
- let config = defaults
- ? null
- : ... | true |
Other | vercel | next.js | bc429f50c270a1da07c4833a5e64e5ddebe5a8c2.json | Remove future.strictPostcssConfiguration config (#32098) | packages/next/server/config-shared.ts | @@ -119,7 +119,6 @@ export type NextConfig = { [key: string]: any } & {
* @deprecated this options was moved to the top level
*/
webpack5?: false
- strictPostcssConfiguration?: boolean
}
outputFileTracing?: boolean
staticPageGenerationTimeout?: number
@@ -255,9 +254,6 @@ export const defaul... | true |
Other | vercel | next.js | 1c199a5e4a158685007c006820e6eaec94796528.json | Fix running server with Polyfilled fetch (#31935)
This PR fixes #30398
By default Next will polyfill some fetch APIs (Request, Response, Header and fetch) only if fetch is not found in the global scope in certain entry points. If we have a custom server which is adding a global fetch (and only fetch) at the very top ... | packages/next/server/next-server.ts | @@ -95,10 +95,10 @@ import { parseNextUrl } from '../shared/lib/router/utils/parse-next-url'
import isError from '../lib/is-error'
import { getMiddlewareInfo } from './require'
import { MIDDLEWARE_ROUTE } from '../lib/constants'
-import { NextResponse } from './web/spec-extension/response'
import { run } from './we... | true |
Other | vercel | next.js | 1c199a5e4a158685007c006820e6eaec94796528.json | Fix running server with Polyfilled fetch (#31935)
This PR fixes #30398
By default Next will polyfill some fetch APIs (Request, Response, Header and fetch) only if fetch is not found in the global scope in certain entry points. If we have a custom server which is adding a global fetch (and only fetch) at the very top ... | packages/next/server/web/adapter.ts | @@ -1,8 +1,9 @@
import type { NextMiddleware, RequestData, FetchEventResult } from './types'
+import type { RequestInit } from './spec-extension/request'
import { DeprecationError } from './error'
import { fromNodeHeaders } from './utils'
import { NextFetchEvent } from './spec-extension/fetch-event'
-import { NextR... | true |
Other | vercel | next.js | 1c199a5e4a158685007c006820e6eaec94796528.json | Fix running server with Polyfilled fetch (#31935)
This PR fixes #30398
By default Next will polyfill some fetch APIs (Request, Response, Header and fetch) only if fetch is not found in the global scope in certain entry points. If we have a custom server which is adding a global fetch (and only fetch) at the very top ... | packages/next/server/web/next-url.ts | @@ -1,66 +1,77 @@
import type { PathLocale } from '../../shared/lib/i18n/normalize-locale-path'
import type { DomainLocale, I18NConfig } from '../config-shared'
import { getLocaleMetadata } from '../../shared/lib/i18n/get-locale-metadata'
-import cookie from 'next/dist/compiled/cookie'
import { replaceBasePath } fr... | true |
Other | vercel | next.js | 1c199a5e4a158685007c006820e6eaec94796528.json | Fix running server with Polyfilled fetch (#31935)
This PR fixes #30398
By default Next will polyfill some fetch APIs (Request, Response, Header and fetch) only if fetch is not found in the global scope in certain entry points. If we have a custom server which is adding a global fetch (and only fetch) at the very top ... | packages/next/server/web/sandbox/sandbox.ts | @@ -18,6 +18,19 @@ export async function run(params: {
runInContext(paramPath)
}
+ const subreq = params.request.headers[`x-middleware-subrequest`]
+ const subrequests = typeof subreq === 'string' ? subreq.split(':') : []
+ if (subrequests.includes(params.name)) {
+ return {
+ waitUntil: Promise.re... | true |
Other | vercel | next.js | 1c199a5e4a158685007c006820e6eaec94796528.json | Fix running server with Polyfilled fetch (#31935)
This PR fixes #30398
By default Next will polyfill some fetch APIs (Request, Response, Header and fetch) only if fetch is not found in the global scope in certain entry points. If we have a custom server which is adding a global fetch (and only fetch) at the very top ... | packages/next/shared/lib/router/utils/relativize-url.ts | @@ -0,0 +1,13 @@
+/**
+ * Given a URL as a string and a base URL it will make the URL relative
+ * if the parsed protocol and host is the same as the one in the base
+ * URL. Otherwise it returns the same URL string.
+ */
+export function relativizeURL(url: string | string, base: string | URL) {
+ const baseURL = type... | true |
Other | vercel | next.js | 1c199a5e4a158685007c006820e6eaec94796528.json | Fix running server with Polyfilled fetch (#31935)
This PR fixes #30398
By default Next will polyfill some fetch APIs (Request, Response, Header and fetch) only if fetch is not found in the global scope in certain entry points. If we have a custom server which is adding a global fetch (and only fetch) at the very top ... | test/integration/custom-server/server.js | @@ -1,3 +1,7 @@
+if (process.env.POLYFILL_FETCH) {
+ global.fetch = require('node-fetch').default
+}
+
const http = require('http')
const next = require('next')
| true |
Other | vercel | next.js | 1c199a5e4a158685007c006820e6eaec94796528.json | Fix running server with Polyfilled fetch (#31935)
This PR fixes #30398
By default Next will polyfill some fetch APIs (Request, Response, Header and fetch) only if fetch is not found in the global scope in certain entry points. If we have a custom server which is adding a global fetch (and only fetch) at the very top ... | test/integration/custom-server/test/index.test.js | @@ -195,4 +195,14 @@ describe('Custom Server', () => {
}
)
})
+
+ describe('with a custom fetch polyfill', () => {
+ beforeAll(() => startServer({ POLYFILL_FETCH: 'true' }))
+ afterAll(() => killApp(server))
+
+ it('should serve internal file from render', async () => {
+ const data = awai... | true |
Other | vercel | next.js | 1c199a5e4a158685007c006820e6eaec94796528.json | Fix running server with Polyfilled fetch (#31935)
This PR fixes #30398
By default Next will polyfill some fetch APIs (Request, Response, Header and fetch) only if fetch is not found in the global scope in certain entry points. If we have a custom server which is adding a global fetch (and only fetch) at the very top ... | test/integration/middleware/core/pages/interface/[id]/_middleware.js | @@ -0,0 +1,7 @@
+import { NextResponse } from 'next/server'
+
+export function middleware() {
+ const response = NextResponse.next()
+ response.headers.set('x-dynamic-path', 'true')
+ return response
+} | true |
Other | vercel | next.js | 1c199a5e4a158685007c006820e6eaec94796528.json | Fix running server with Polyfilled fetch (#31935)
This PR fixes #30398
By default Next will polyfill some fetch APIs (Request, Response, Header and fetch) only if fetch is not found in the global scope in certain entry points. If we have a custom server which is adding a global fetch (and only fetch) at the very top ... | test/integration/middleware/core/pages/interface/_middleware.js | @@ -54,9 +54,7 @@ export async function middleware(request) {
}
if (url.pathname.endsWith('/root-subrequest')) {
- return fetch(
- `http://${request.headers.get('host')}/interface/root-subrequest`
- )
+ return fetch(url)
}
return new Response(null, { | true |
Other | vercel | next.js | 1c199a5e4a158685007c006820e6eaec94796528.json | Fix running server with Polyfilled fetch (#31935)
This PR fixes #30398
By default Next will polyfill some fetch APIs (Request, Response, Header and fetch) only if fetch is not found in the global scope in certain entry points. If we have a custom server which is adding a global fetch (and only fetch) at the very top ... | test/integration/middleware/core/pages/responses/_middleware.js | @@ -57,11 +57,11 @@ export async function middleware(request, ev) {
ev.waitUntil(
(async () => {
writer.write(encoder.encode('this is a streamed '.repeat(10)))
- await sleep(2000)
+ await sleep(200)
writer.write(encoder.encode('after 2 seconds '.repeat(10)))
- await sl... | true |
Other | vercel | next.js | 1c199a5e4a158685007c006820e6eaec94796528.json | Fix running server with Polyfilled fetch (#31935)
This PR fixes #30398
By default Next will polyfill some fetch APIs (Request, Response, Header and fetch) only if fetch is not found in the global scope in certain entry points. If we have a custom server which is adding a global fetch (and only fetch) at the very top ... | test/integration/middleware/core/test/index.test.js | @@ -447,6 +447,14 @@ function interfaceTests(locale = '') {
const element = await browser.elementByCss('.title')
expect(await element.text()).toEqual('Dynamic route')
})
+
+ it(`${locale} allows subrequests without infinite loops`, async () => {
+ const res = await fetchViaHTTP(
+ context.appPort,... | true |
Other | vercel | next.js | 1c199a5e4a158685007c006820e6eaec94796528.json | Fix running server with Polyfilled fetch (#31935)
This PR fixes #30398
By default Next will polyfill some fetch APIs (Request, Response, Header and fetch) only if fetch is not found in the global scope in certain entry points. If we have a custom server which is adding a global fetch (and only fetch) at the very top ... | test/unit/web-runtime/next-url.test.ts | @@ -1,74 +1,69 @@
/* eslint-env jest */
import { NextURL } from 'next/dist/server/web/next-url'
-it('has the right shape', () => {
- const parsed = new NextURL('/about?param1=value1')
+it('has the right shape and prototype', () => {
+ const parsed = new NextURL('/about?param1=value1', 'http://127.0.0.1')
expec... | true |
Other | vercel | next.js | 647c06b339ccabb5ee583cbdd32e12b8af6b0fd4.json | Improve exported root definitions (#32077)
Fixes https://github.com/vercel/next.js/issues/32045
doing `export { default } from 'module'` has some unexpected results for autocompletion in TypeScript, this PR changes root definitions to have a named default export where needed.
## Bug
- [x] Related issues linked usin... | packages/next/app.d.ts | @@ -1,2 +1,3 @@
+import App from './dist/pages/_app'
export * from './dist/pages/_app'
-export { default } from './dist/pages/_app'
+export default App | true |
Other | vercel | next.js | 647c06b339ccabb5ee583cbdd32e12b8af6b0fd4.json | Improve exported root definitions (#32077)
Fixes https://github.com/vercel/next.js/issues/32045
doing `export { default } from 'module'` has some unexpected results for autocompletion in TypeScript, this PR changes root definitions to have a named default export where needed.
## Bug
- [x] Related issues linked usin... | packages/next/client.d.ts | @@ -1,2 +1 @@
export * from './dist/client/index'
-export { default } from './dist/client/index' | true |
Other | vercel | next.js | 647c06b339ccabb5ee583cbdd32e12b8af6b0fd4.json | Improve exported root definitions (#32077)
Fixes https://github.com/vercel/next.js/issues/32045
doing `export { default } from 'module'` has some unexpected results for autocompletion in TypeScript, this PR changes root definitions to have a named default export where needed.
## Bug
- [x] Related issues linked usin... | packages/next/config.d.ts | @@ -1,2 +1,3 @@
+import getConfig from './dist/shared/lib/runtime-config'
export * from './dist/shared/lib/runtime-config'
-export { default } from './dist/shared/lib/runtime-config'
+export default getConfig | true |
Other | vercel | next.js | 647c06b339ccabb5ee583cbdd32e12b8af6b0fd4.json | Improve exported root definitions (#32077)
Fixes https://github.com/vercel/next.js/issues/32045
doing `export { default } from 'module'` has some unexpected results for autocompletion in TypeScript, this PR changes root definitions to have a named default export where needed.
## Bug
- [x] Related issues linked usin... | packages/next/document.d.ts | @@ -1,2 +1,3 @@
+import Document from './dist/shared/lib/runtime-config'
export * from './dist/pages/_document'
-export { default } from './dist/pages/_document'
+export default Document | true |
Other | vercel | next.js | 647c06b339ccabb5ee583cbdd32e12b8af6b0fd4.json | Improve exported root definitions (#32077)
Fixes https://github.com/vercel/next.js/issues/32045
doing `export { default } from 'module'` has some unexpected results for autocompletion in TypeScript, this PR changes root definitions to have a named default export where needed.
## Bug
- [x] Related issues linked usin... | packages/next/dynamic.d.ts | @@ -1,2 +1,3 @@
+import dynamic from './dist/shared/lib/dynamic'
export * from './dist/shared/lib/dynamic'
-export { default } from './dist/shared/lib/dynamic'
+export default dynamic | true |
Other | vercel | next.js | 647c06b339ccabb5ee583cbdd32e12b8af6b0fd4.json | Improve exported root definitions (#32077)
Fixes https://github.com/vercel/next.js/issues/32045
doing `export { default } from 'module'` has some unexpected results for autocompletion in TypeScript, this PR changes root definitions to have a named default export where needed.
## Bug
- [x] Related issues linked usin... | packages/next/error.d.ts | @@ -1,2 +1,3 @@
+import Error from './dist/pages/_error'
export * from './dist/pages/_error'
-export { default } from './dist/pages/_error'
+export default Error | true |
Other | vercel | next.js | 647c06b339ccabb5ee583cbdd32e12b8af6b0fd4.json | Improve exported root definitions (#32077)
Fixes https://github.com/vercel/next.js/issues/32045
doing `export { default } from 'module'` has some unexpected results for autocompletion in TypeScript, this PR changes root definitions to have a named default export where needed.
## Bug
- [x] Related issues linked usin... | packages/next/head.d.ts | @@ -1,2 +1,3 @@
+import Head from './dist/shared/lib/head'
export * from './dist/shared/lib/head'
-export { default } from './dist/shared/lib/head'
+export default Head | true |
Other | vercel | next.js | 647c06b339ccabb5ee583cbdd32e12b8af6b0fd4.json | Improve exported root definitions (#32077)
Fixes https://github.com/vercel/next.js/issues/32045
doing `export { default } from 'module'` has some unexpected results for autocompletion in TypeScript, this PR changes root definitions to have a named default export where needed.
## Bug
- [x] Related issues linked usin... | packages/next/image.d.ts | @@ -1,2 +1,3 @@
+import Image from './dist/client/image'
export * from './dist/client/image'
-export { default } from './dist/client/image'
+export default Image | true |
Other | vercel | next.js | 647c06b339ccabb5ee583cbdd32e12b8af6b0fd4.json | Improve exported root definitions (#32077)
Fixes https://github.com/vercel/next.js/issues/32045
doing `export { default } from 'module'` has some unexpected results for autocompletion in TypeScript, this PR changes root definitions to have a named default export where needed.
## Bug
- [x] Related issues linked usin... | packages/next/jest.d.ts | @@ -1,2 +1,3 @@
+import nextJest from './dist/build/jest/jest'
export * from './dist/build/jest/jest'
-export { default } from './dist/build/jest/jest'
+export default nextJest | true |
Other | vercel | next.js | 647c06b339ccabb5ee583cbdd32e12b8af6b0fd4.json | Improve exported root definitions (#32077)
Fixes https://github.com/vercel/next.js/issues/32045
doing `export { default } from 'module'` has some unexpected results for autocompletion in TypeScript, this PR changes root definitions to have a named default export where needed.
## Bug
- [x] Related issues linked usin... | packages/next/link.d.ts | @@ -1,2 +1,3 @@
+import Link from './dist/client/link'
export * from './dist/client/link'
-export { default } from './dist/client/link'
+export default Link | true |
Other | vercel | next.js | 647c06b339ccabb5ee583cbdd32e12b8af6b0fd4.json | Improve exported root definitions (#32077)
Fixes https://github.com/vercel/next.js/issues/32045
doing `export { default } from 'module'` has some unexpected results for autocompletion in TypeScript, this PR changes root definitions to have a named default export where needed.
## Bug
- [x] Related issues linked usin... | packages/next/router.d.ts | @@ -1,2 +1,3 @@
+import Router from './dist/client/router'
export * from './dist/client/router'
-export { default } from './dist/client/router'
+export default Router | true |
Other | vercel | next.js | 647c06b339ccabb5ee583cbdd32e12b8af6b0fd4.json | Improve exported root definitions (#32077)
Fixes https://github.com/vercel/next.js/issues/32045
doing `export { default } from 'module'` has some unexpected results for autocompletion in TypeScript, this PR changes root definitions to have a named default export where needed.
## Bug
- [x] Related issues linked usin... | packages/next/script.d.ts | @@ -1,2 +1,3 @@
+import Script from './dist/client/script'
export * from './dist/client/script'
-export { default } from './dist/client/script'
+export default Script | true |
Other | vercel | next.js | 80ec93d1bb20c4ccb9240c8633e19f9664029355.json | Skip warnings for Image not rendered to the dom (#32049)
Some libraries, like react-slick, render their content to a detached element before attaching it to the dom. If the content of such libraries is Image components, they will report warnings because the display/position properties are undefined. This PR squelch th... | packages/next/client/image.tsx | @@ -279,7 +279,9 @@ function handleLoading(
if (process.env.NODE_ENV !== 'production') {
if (img.parentElement?.parentElement) {
const parent = getComputedStyle(img.parentElement.parentElement)
- if (layout === 'responsive' && parent.display === 'flex') {
+ if (!pa... | false |
Other | vercel | next.js | 31d2184972097741cadcbee534b018fac1cf9de0.json | docs(Testing): Remove duplicate link (#32071)
There was two items `Use a development server`, both linking to the same URL. The last one was removed. | docs/testing.md | @@ -239,7 +239,6 @@ You can learn more about Playwright and Continuous Integration from these resour
- [Getting started with Playwright](https://playwright.dev/docs/intro)
- [Use a development server](https://playwright.dev/docs/test-advanced#launching-a-development-web-server-during-the-tests)
- [Playwright on your... | false |
Other | vercel | next.js | 25371dd1b06a4c0619e9878c4efeb0ea93df6d80.json | Lock node version for CI (#32057) | .github/workflows/build_test_deploy.yml | @@ -28,6 +28,12 @@ jobs:
docsChange: ${{ steps.docs-change.outputs.DOCS_CHANGE }}
isRelease: ${{ steps.check-release.outputs.IS_RELEASE }}
steps:
+ - name: Setup node
+ uses: actions/setup-node@v2
+ if: ${{ steps.docs-change.outputs.docsChange != 'docs only change' }}
+ with... | false |
Other | vercel | next.js | 61ca7369c61b3a084e31fdb84ee6cede4c87f9b2.json | Fix function syntax for API Routes documentation (#31414)
There is a non-valid mix of classic and arrow function notation in the documentation. I've fixed it to be a classical function notation because all the other examples are like that.
## Documentation / Examples
- [ ] Make sure the linting passes by running `ya... | docs/api-routes/response-helpers.md | @@ -89,7 +89,7 @@ type ResponseData {
message: string
}
-export default function handler(req: NextApiRequest, res: NextApiResponse<ResponseData>) => {
+export default function handler(req: NextApiRequest, res: NextApiResponse<ResponseData>) {
res.status(200).json({ message: 'Hello from Next.js!' })
}
``` | false |
Other | vercel | next.js | 6fd44383f3df859da6f1381b41c588919a29ca82.json | Update swc & fix `styled-jsx` (#31407) | packages/next/build/swc/Cargo.lock | @@ -105,6 +105,18 @@ dependencies = [
"syn",
]
+[[package]]
+name = "auto_impl"
+version = "0.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7862e21c893d65a1650125d157eaeec691439379a1cee17ee49031b79236ada4"
+dependencies = [
+ "proc-macro-error",
+ "proc-macro2",
+ "quote",
+ "... | true |
Other | vercel | next.js | 6fd44383f3df859da6f1381b41c588919a29ca82.json | Update swc & fix `styled-jsx` (#31407) | packages/next/build/swc/Cargo.toml | @@ -23,24 +23,24 @@ retain_mut = "0.1.3"
rustc-hash = "1.1.0"
serde = "1"
serde_json = "1"
-styled_components = "0.1.0"
-swc = "0.83.1"
+styled_components = "0.2.0"
+swc = "0.85.0"
swc_atoms = "0.2.7"
-swc_bundler = { version = "0.80.0", features = ["concurrent"] }
+swc_bundler = { version = "0.82.0", features = ["... | true |
Other | vercel | next.js | 6fd44383f3df859da6f1381b41c588919a29ca82.json | Update swc & fix `styled-jsx` (#31407) | packages/next/build/swc/src/bundle/mod.rs | @@ -18,7 +18,7 @@ use swc_common::{
};
use swc_ecma_loader::{
resolvers::{lru::CachingResolver, node::NodeModulesResolver},
- NODE_BUILTINS,
+ TargetEnv, NODE_BUILTINS,
};
use swc_ecmascript::{
ast::*, | true |
Other | vercel | next.js | 6fd44383f3df859da6f1381b41c588919a29ca82.json | Update swc & fix `styled-jsx` (#31407) | packages/next/build/swc/src/styled_jsx/transform_css.rs | @@ -52,7 +52,8 @@ pub fn transform_css(
}
};
// ? Do we need to support optionally prefixing?
- ss.visit_mut_with(&mut prefixer());
+ ss.visit_mut_with(&mut FixedPrefixer);
+ ss.visit_mut_with(&mut CssFixer);
ss.visit_mut_with(&mut Namespacer {
class_name: match class_name {
... | true |
Other | vercel | next.js | 6fd44383f3df859da6f1381b41c588919a29ca82.json | Update swc & fix `styled-jsx` (#31407) | packages/next/build/swc/tests/fixture/styled-jsx/issue-30480/input.js | @@ -0,0 +1,7 @@
+
+
+export default ({ breakPoint }) => (
+ <div>
+ <style jsx>{`@media (${breakPoint}) {}`}</style>
+ </div>
+) | true |
Other | vercel | next.js | 6fd44383f3df859da6f1381b41c588919a29ca82.json | Update swc & fix `styled-jsx` (#31407) | packages/next/build/swc/tests/fixture/styled-jsx/issue-30480/output.js | @@ -0,0 +1,16 @@
+import _JSXStyle from "styled-jsx/style";
+export default (({ breakPoint })=><div className={_JSXStyle.dynamic([
+ [
+ "6b843a9852a4be26",
+ [
+ breakPoint
+ ]
+ ]
+ ])}>
+
+ <_JSXStyle id={"6b843a9852a4be26"} dynamic={[
+ bre... | true |
Other | vercel | next.js | 6fd44383f3df859da6f1381b41c588919a29ca82.json | Update swc & fix `styled-jsx` (#31407) | packages/next/build/swc/tests/fixture/styled-jsx/issue-30570/input.js | @@ -0,0 +1,15 @@
+export default function IndexPage() {
+ return (
+ <div>
+ <h1>Hello World.</h1>
+
+ <style jsx global>{`
+ @supports (display: flex) {
+ h1 {
+ color: hotpink;
+ }
+ }
+ `}</style>
+ </div>
+ );
+ }
\ No newl... | true |
Other | vercel | next.js | 6fd44383f3df859da6f1381b41c588919a29ca82.json | Update swc & fix `styled-jsx` (#31407) | packages/next/build/swc/tests/fixture/styled-jsx/issue-30570/output.js | @@ -0,0 +1,12 @@
+import _JSXStyle from "styled-jsx/style";
+export default function IndexPage() {
+ return <div className={"jsx-bbdada4ef17d18ef"}>
+
+ <h1 className={"jsx-bbdada4ef17d18ef"}>Hello World.</h1>
+
+
+
+ <_JSXStyle id={"bbdada4ef17d18ef"}>{"@supports (display:flex) {h1 {color:hotpink}}"... | true |
Other | vercel | next.js | 6fd44383f3df859da6f1381b41c588919a29ca82.json | Update swc & fix `styled-jsx` (#31407) | packages/next/build/swc/tests/fixture/styled-jsx/tpl-placeholder-1-as-property/output.js | @@ -21,7 +21,8 @@ export default class {
<_JSXStyle id={"8c1103276226be14"} dynamic={[
inputSize ? "height: calc(2 * var(--a)) !important;" : ""
- ]}>{`@media only screen {a.__jsx-style-dynamic-selector {${inputSize ? "height: calc(2 * var(--a)) !important;" : ""} }}`}</_JSXStyle>
+ ... | true |
Other | vercel | next.js | 312572d02028fe980b4a81cdef5833c168bb4278.json | examples: fix README with google analytics (#31384) | examples/with-google-analytics/README.md | @@ -1,6 +1,6 @@
# Example app with analytics
-This example shows how to use [Next.js](https://github.com/vercel/next.js) along with [Google Analytics](https://developers.google.com/analytics/devguides/collection/gtagjs/). A custom [\_document](https://nextjs.org/docs/advanced-features/custom-document) is used to inj... | false |
Other | vercel | next.js | e55c42cef001b5f46c3a7c884557350be16ae0ed.json | Maintain co-authors when kodiak merges (#31316) | .github/.kodiak.toml | @@ -13,6 +13,7 @@ notify_on_conflict = false
[merge.message]
title = "pull_request_title"
body = "pull_request_body"
+include_coauthors= true
include_pr_number = true
body_type = "markdown"
strip_html_comments = true | false |
Other | vercel | next.js | 5e179e32b6104ca7b1586b8daa489ea7a699eef0.json | Testing Docs: Add links to jump to sections (#31311)
Added Playwright to the top of the page and links to help readers jump to sections.
## Feature
- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked... | docs/testing.md | @@ -13,7 +13,7 @@ description: Learn how to set up Next.js with three commonly used testing tools
</ul>
</details>
-Learn how to set up Next.js with three commonly used testing tools: [Cypress](https://www.cypress.io/blog/2021/04/06/cypress-component-testing-react/), [Jest](https://jestjs.io/docs/tutorial-react),... | false |
Other | vercel | next.js | 46e1cbc95ebae960d9228bfa6556a7a80fe66d00.json | Update swc for `jsc.paths` (#31290)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> | packages/next/build/swc/Cargo.lock | @@ -1643,9 +1643,9 @@ dependencies = [
[[package]]
name = "swc"
-version = "0.83.1"
+version = "0.83.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0c9dfd3fa9b1e3dc214afe20974a938b1d6c52db137bfe6645234dc6a725e2aa"
+checksum = "3b0ccb2669a3ed7f2db0b0bd7ae7cd10f6aed4ece385a031a1b078... | false |
Other | vercel | next.js | bd8003850baccf3713ee170f137cf4d1d8b7fdcd.json | Fix typo in `next build` log (#31295)
## 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 implementa... | packages/next/build/index.ts | @@ -779,7 +779,7 @@ export default async function build(
)
}
Log.warn(
- `Restarted static page genertion for ${pagePath} because it took more than ${timeout} seconds`
+ `Restarted static page generation for ${pagePath} because it took more than ${timeout} second... | false |
Other | vercel | next.js | 5014362a7a6359fac8fc1bb8a02eae6736805d7f.json | Fix Auth0 Example (#31284)
Fixes #31286
I was going through the [Auth0 example](https://github.com/vercel/next.js/tree/canary/examples/auth0) and hit the following issue (screencap):
<img width="964" alt="Screen Shot 2021-11-10 at 12 57 41 PM" src="https://user-images.githubusercontent.com/2515575/141226775-08e5e1... | examples/auth0/pages/advanced/ssr-profile.js | @@ -21,7 +21,7 @@ export async function getServerSideProps({ req, res }) {
// Here you can check authentication status directly before rendering the page,
// however the page would be a serverless function, which is more expensive and
// slower than a static page with client side authentication
- const sessio... | false |
Other | vercel | next.js | edb5060fc0adfb1bf7744f08f7cd1c0393ebb5ef.json | Fix process.env overriden in web runtime (#31261)
Fixes #31258
## Bug
- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md` | packages/next/build/webpack-config.ts | @@ -1337,8 +1337,10 @@ export default async function getBaseWebpackConfig(
// Makes sure `Buffer` and `process` are polyfilled in client and flight bundles (same behavior as webpack 4)
targetWeb &&
new webpack.ProvidePlugin({
+ // Buffer is used by getInlineScriptSource
Buffer... | true |
Other | vercel | next.js | edb5060fc0adfb1bf7744f08f7cd1c0393ebb5ef.json | Fix process.env overriden in web runtime (#31261)
Fixes #31258
## Bug
- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md` | test/integration/react-streaming-and-server-components/app/.env | @@ -0,0 +1 @@
+ENV_VAR_TEST="env_var_test"
\ No newline at end of file | true |
Other | vercel | next.js | edb5060fc0adfb1bf7744f08f7cd1c0393ebb5ef.json | Fix process.env overriden in web runtime (#31261)
Fixes #31258
## Bug
- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md` | test/integration/react-streaming-and-server-components/app/pages/index.server.js | @@ -1,10 +1,15 @@
import Foo from '../components/foo.client'
+const envVar = process.env.ENV_VAR_TEST
+
export default function Index() {
return (
<div>
<h1>{`thisistheindexpage.server`}</h1>
- <Foo />
+ <div>{envVar}</div>
+ <div>
+ <Foo />
+ </div>
</div>
)
} | true |
Other | vercel | next.js | edb5060fc0adfb1bf7744f08f7cd1c0393ebb5ef.json | Fix process.env overriden in web runtime (#31261)
Fixes #31258
## Bug
- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md` | test/integration/react-streaming-and-server-components/test/index.test.js | @@ -224,6 +224,7 @@ async function runBasicTests(context) {
)
expect(homeHTML).toContain('thisistheindexpage.server')
+ expect(homeHTML).toContain('env_var_test')
expect(homeHTML).toContain('foo.client')
expect(dynamicRouteHTML1).toContain('[pid]') | true |
Other | vercel | next.js | fd9593542a52f7cd3ef4dbb6371893ef14dea2fa.json | Update swc minifier (#31242)
Co-authored-by: JJ Kasper <jj@jjsweb.site> | packages/next/build/swc/Cargo.lock | @@ -1928,9 +1928,9 @@ dependencies = [
[[package]]
name = "swc_ecma_minifier"
-version = "0.49.0"
+version = "0.49.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cc808dc0e5d3e6c5319e02ddac25008ae2ae5dff2baeda1192ba6ede0b75b57f"
+checksum = "aa0c081b2196816e9589fcf1ef85047cbae49664... | false |
Other | vercel | next.js | 4299cc169c6552ffd54d02155a2efc0ebd355f68.json | docs: fix typo in css-in-js page (#31244)
## Purpose
fix minor typo in [css-in-js page](https://nextjs.org/docs/basic-features/built-in-css-support#sass-variables)
## Documentation / Examples
- [x] Make sure the linting passes by running `yarn lint` | docs/basic-features/built-in-css-support.md | @@ -198,7 +198,7 @@ $primary-color: #64FF00
```js
// pages/_app.js
-import variables from '../styles/variables.module.css'
+import variables from '../styles/variables.module.scss'
export default function MyApp({ Component, pageProps }) {
return ( | false |
Other | vercel | next.js | e3135ccde61c8bed2398962c1a24548a1f774757.json | Support assetPrefix specific protocol (#31213)
Co-authored-by: JJ Kasper <jj@jjsweb.site> | packages/next/client/dev/error-overlay/websocket.ts | @@ -2,6 +2,17 @@ let source: WebSocket
const eventCallbacks: ((event: any) => void)[] = []
let lastActivity = Date.now()
+function getSocketProtocol(assetPrefix: string): string {
+ let protocol = location.protocol
+
+ try {
+ // assetPrefix is a url
+ protocol = new URL(assetPrefix).protocol
+ } catch (_)... | false |
Other | vercel | next.js | 489ca73e436c54408b8769437d5fd51bb336d6f4.json | test: skip flaky dynamic import tests (#31221) | test/integration/react-streaming-and-server-components/test/index.test.js | @@ -162,7 +162,8 @@ describe('concurrentFeatures - dev', () => {
await killApp(context.server)
})
- it('should support React.lazy and dynamic imports', async () => {
+ // TODO: re-enabled test when update webpack with chunkLoading support
+ it.skip('should support React.lazy and dynamic imports', async () ... | false |
Other | vercel | next.js | 332cd06c7d67aa5681c01437dca60ab49e46f5d1.json | Allow pre-release React 18 as peer (#31991) | packages/next/package.json | @@ -120,8 +120,8 @@
"peerDependencies": {
"fibers": ">= 3.1.0",
"node-sass": "^4.0.0 || ^5.0.0 || ^6.0.0",
- "react": "^17.0.2 || ^18.0.0",
- "react-dom": "^17.0.2 || ^18.0.0",
+ "react": "^17.0.2 || ^18.0.0-0",
+ "react-dom": "^17.0.2 || ^18.0.0-0",
"sass": "^1.3.0"
},
"peerDependen... | false |
Other | vercel | next.js | 928c77958e8f8dbe22937c39d60b88624558a96a.json | Resolve streaming data for flight requests (#32010)
## Bug
- [ ] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md` | packages/next/server/render.tsx | @@ -1008,12 +1008,13 @@ export async function renderToHTML(
serverComponentManifest
)
const reader = stream.getReader()
- return new RenderResult((innerRes, next) => {
+ const piper: NodeWritablePiper = (innerRes, next) => {
bufferedReadFromReadableStream(reader, (val) => innerRes.write(va... | true |
Other | vercel | next.js | 928c77958e8f8dbe22937c39d60b88624558a96a.json | Resolve streaming data for flight requests (#32010)
## Bug
- [ ] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md` | test/integration/react-streaming-and-server-components/app/pages/index.server.js | @@ -19,7 +19,7 @@ export default function Index({ header, router }) {
export function getServerSideProps({ req }) {
const { headers } = req
- const header = headers[headerKey]
+ const header = headers[headerKey] || ''
return {
props: { | true |
Other | vercel | next.js | 928c77958e8f8dbe22937c39d60b88624558a96a.json | Resolve streaming data for flight requests (#32010)
## Bug
- [ ] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md` | test/integration/react-streaming-and-server-components/test/index.test.js | @@ -86,6 +86,20 @@ async function nextDev(dir, port) {
})
}
+async function resolveStreamResponse(response, onData) {
+ let result = ''
+ onData = onData || (() => {})
+ await new Promise((resolve) => {
+ response.body.on('data', (chunk) => {
+ result += chunk.toString()
+ onData(chunk.toString(),... | true |
Other | vercel | next.js | f8d6441e410903095776f2e3cc90fcfd4014e29c.json | Add next-swc to labeler | .github/labeler.json | @@ -10,7 +10,8 @@
"packages/next-codemod/**",
"packages/eslint-plugin-next/**",
"packages/eslint-config-next/**",
- "packages/next-env/**"
+ "packages/next-env/**",
+ "packages/next-swc/**"
],
"created-by: Chrome Aurora": [
{ "type": "user", "pattern": "spanicker" }, | false |
Other | vercel | next.js | 8784682a7497cda0e4131014dcb48c42c07ec5ad.json | Escape string when converting to regexp (#31791)
fixes #31411
## Bug
- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`
Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com> | packages/next/shared/lib/router/utils/prepare-destination.ts | @@ -4,6 +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 | 8784682a7497cda0e4131014dcb48c42c07ec5ad.json | Escape string when converting to regexp (#31791)
fixes #31411
## Bug
- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`
Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com> | test/integration/route-index/test/index.test.js | @@ -32,6 +32,19 @@ const runTests = () => {
expect(res.status).toBe(404)
expect(await res.text()).toContain('page could not be found')
})
+
+ it('should handle /index/?bar%60%3C%25%22%27%7B%24%2A%25%5C correctly', async () => {
+ const res = await fetchViaHTTP(
+ appPort,
+ '/index/?bar%60%3C... | true |
Other | vercel | next.js | c78930111df5cb7f75400fd4824a0764cf521be9.json | Removng prop writable checking in prod (#31929)
x-ref: #28498, #31784
I can repro the issue #24783 with `next-boost` 0.10.1 and it was fixed in 0.10.2 (ref: https://github.com/rjyo/next-boost/commit/eba6d10aabb2470ec5d7bd48ac8fec4ea08e26c5). The actual case is missing setting node env to `"production"`.
React freeze... | packages/next/pages/_document.tsx | @@ -458,11 +458,7 @@ export class Head extends Component<
newProps['data-href'] = newProps['href']
newProps['href'] = undefined
return React.cloneElement(c, newProps)
- } else if (
- c.props &&
- c.props['children'] &&
- Object.getOwnPropertyDescriptor(c.props, 'chil... | false |
Other | vercel | next.js | 6920c0201be8c7b42c82a32bd0622a77b7856660.json | Remove unpurpose test (#31898)
The test from #31784 can pass with or without the source code change in that PR.
I cannot repro it. The writable is true on build in the provided case | test/integration/repro-24783/next.config.js | @@ -1,3 +0,0 @@
-module.exports = {
- reactStrictMode: true,
-} | true |
Other | vercel | next.js | 6920c0201be8c7b42c82a32bd0622a77b7856660.json | Remove unpurpose test (#31898)
The test from #31784 can pass with or without the source code change in that PR.
I cannot repro it. The writable is true on build in the provided case | test/integration/repro-24783/pages/_app.js | @@ -1,4 +0,0 @@
-function MyApp({ Component, pageProps }) {
- return <Component {...pageProps} />
-}
-export default MyApp | true |
Other | vercel | next.js | 6920c0201be8c7b42c82a32bd0622a77b7856660.json | Remove unpurpose test (#31898)
The test from #31784 can pass with or without the source code change in that PR.
I cannot repro it. The writable is true on build in the provided case | test/integration/repro-24783/pages/_document.js | @@ -1,27 +0,0 @@
-import Document, { Head, Html, Main, NextScript } from 'next/document'
-
-export default class MyDocument extends Document {
- static async getInitialProps(ctx) {
- const initialProps = await Document.getInitialProps(ctx)
- return { ...initialProps }
- }
-
- render() {
- return (
- <H... | true |
Other | vercel | next.js | 6920c0201be8c7b42c82a32bd0622a77b7856660.json | Remove unpurpose test (#31898)
The test from #31784 can pass with or without the source code change in that PR.
I cannot repro it. The writable is true on build in the provided case | test/integration/repro-24783/pages/foo/[slug].js | @@ -1,17 +0,0 @@
-export const getStaticPaths = () => {
- return {
- // `true` also works, but `false` does not, since it causes a 404
- fallback: 'blocking',
- paths: [],
- }
-}
-
-export const getStaticProps = async () => {
- return {
- props: {},
- }
-}
-
-export default function Foo() {
- return <h... | true |
Other | vercel | next.js | 6920c0201be8c7b42c82a32bd0622a77b7856660.json | Remove unpurpose test (#31898)
The test from #31784 can pass with or without the source code change in that PR.
I cannot repro it. The writable is true on build in the provided case | test/integration/repro-24783/test/index.test.js | @@ -1,39 +0,0 @@
-/* eslint-env jest */
-
-import fs from 'fs-extra'
-import { join } from 'path'
-import {
- renderViaHTTP,
- nextBuild,
- startApp,
- stopApp,
- nextServer,
-} from 'next-test-utils'
-
-jest.setTimeout(1000 * 60 * 2)
-const appDir = join(__dirname, '..')
-
-let app
-let server
-
-describe('Cannot... | true |
Other | vercel | next.js | efd5d03a8c45324f5e716bcca775ac62ca047d8f.json | Docs(React 18): add missing `Suspense` import (#31897)
This PR adds a missing import in React 18 documentation's sample code, where `Suspense` is used without being imported.
_(edit: fix typo)_ | docs/advanced-features/react-18.md | @@ -33,7 +33,7 @@ Once enabled, you can use Suspense and SSR streaming for all pages. This also me
```jsx
import dynamic from 'next/dynamic'
-import { lazy } from 'react'
+import { lazy, Suspense } from 'react'
import Content from '../components/content'
| false |
Other | vercel | next.js | 127b92b102373535a81b28743af960691d90c63d.json | docs(examples): add secure flag explanation to with-iron-session (#31896)
Following comment on the project here: https://github.com/vvo/iron-session/issues/425 | examples/with-iron-session/lib/session.ts | @@ -5,6 +5,10 @@ import type { User } from 'pages/api/user'
export const sessionOptions: IronSessionOptions = {
password: process.env.SECRET_COOKIE_PASSWORD as string,
cookieName: 'iron-session/examples/next.js',
+ // secure: true should be used in production (HTTPS) but can't be used in development (HTTP)
+ c... | false |
Other | vercel | next.js | e9e8e8b423c9c59f1a54db35d282ff20c825a949.json | Move require.resolve into the module scope (#31799)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> | packages/next/build/swc/options.js | @@ -1,6 +1,8 @@
const nextDistPath =
/(next[\\/]dist[\\/]shared[\\/]lib)|(next[\\/]dist[\\/]client)|(next[\\/]dist[\\/]pages)/
+const regeneratorRuntimePath = require.resolve('regenerator-runtime')
+
function getBaseSWCOptions({
filename,
development,
@@ -57,7 +59,7 @@ function getBaseSWCOptions({
... | false |
Other | vercel | next.js | 466687e88e92369395229b5bb91746d98592735f.json | SWC: Add error checks and tests to next-dynamic (#31683)
fixes #31520
## Bug
- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [x] Errors have helpful link attached, see `contributing.md`
## Feature
- [ ] Implements an existing feature request or RFC. Make sure the feature request h... | errors/invalid-dynamic-options-type.md | @@ -0,0 +1,31 @@
+# Invalid options type in a `next/dynamic` call
+
+#### Why This Error Occurred
+
+You have an invalid options type in a `next/dynamic` call. The options must be an object literal.
+
+#### Possible Ways to Fix It
+
+**Before**
+
+```jsx
+import dynamic from 'next/dynamic'
+
+const options = { loading:... | true |
Other | vercel | next.js | 466687e88e92369395229b5bb91746d98592735f.json | SWC: Add error checks and tests to next-dynamic (#31683)
fixes #31520
## Bug
- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [x] Errors have helpful link attached, see `contributing.md`
## Feature
- [ ] Implements an existing feature request or RFC. Make sure the feature request h... | errors/manifest.json | @@ -518,6 +518,10 @@
{
"title": "experimental-jest-transformer",
"path": "/errors/experimental-jest-transformer.md"
+ },
+ {
+ "title": "invalid-dynamic-options-type",
+ "path": "/errors/invalid-dynamic-options-type.md"
}
]
} | true |
Other | vercel | next.js | 466687e88e92369395229b5bb91746d98592735f.json | SWC: Add error checks and tests to next-dynamic (#31683)
fixes #31520
## Bug
- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [x] Errors have helpful link attached, see `contributing.md`
## Feature
- [ ] Implements an existing feature request or RFC. Make sure the feature request h... | packages/next-swc/crates/core/src/next_dynamic.rs | @@ -86,11 +86,28 @@ impl Fold for NextDynamicPatcher {
});
return expr;
}
+ if expr.args.len() == 2 {
+ match &*expr.args[1].expr {
+ Expr::Object(_) => {},
+ _ => {
+ HANDLER.with(|handler| {
+ ... | true |
Other | vercel | next.js | 466687e88e92369395229b5bb91746d98592735f.json | SWC: Add error checks and tests to next-dynamic (#31683)
fixes #31520
## Bug
- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [x] Errors have helpful link attached, see `contributing.md`
## Feature
- [ ] Implements an existing feature request or RFC. Make sure the feature request h... | packages/next-swc/crates/core/tests/errors.rs | @@ -1,5 +1,8 @@
-use next_swc::disallow_re_export_all_in_page::disallow_re_export_all_in_page;
+use next_swc::{
+ disallow_re_export_all_in_page::disallow_re_export_all_in_page, next_dynamic::next_dynamic,
+};
use std::path::PathBuf;
+use swc_common::FileName;
use swc_ecma_transforms_testing::test_fixture_allowing... | true |
Other | vercel | next.js | 466687e88e92369395229b5bb91746d98592735f.json | SWC: Add error checks and tests to next-dynamic (#31683)
fixes #31520
## Bug
- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [x] Errors have helpful link attached, see `contributing.md`
## Feature
- [ ] Implements an existing feature request or RFC. Make sure the feature request h... | packages/next-swc/crates/core/tests/errors/next-dynamic/no-arguments/input.js | @@ -0,0 +1,3 @@
+import dynamic from 'next/dynamic'
+
+const DynamicComponent = dynamic() | true |
Other | vercel | next.js | 466687e88e92369395229b5bb91746d98592735f.json | SWC: Add error checks and tests to next-dynamic (#31683)
fixes #31520
## Bug
- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [x] Errors have helpful link attached, see `contributing.md`
## Feature
- [ ] Implements an existing feature request or RFC. Make sure the feature request h... | packages/next-swc/crates/core/tests/errors/next-dynamic/no-arguments/output.js | @@ -0,0 +1,3 @@
+import dynamic from 'next/dynamic'
+
+const DynamicComponent = dynamic() | true |
Other | vercel | next.js | 466687e88e92369395229b5bb91746d98592735f.json | SWC: Add error checks and tests to next-dynamic (#31683)
fixes #31520
## Bug
- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [x] Errors have helpful link attached, see `contributing.md`
## Feature
- [ ] Implements an existing feature request or RFC. Make sure the feature request h... | packages/next-swc/crates/core/tests/errors/next-dynamic/no-arguments/output.stderr | @@ -0,0 +1,6 @@
+error: next/dynamic requires at least one argument
+ --> input.js:3:26
+ |
+3 | const DynamicComponent = dynamic()
+ | ^^^^^^^
+ | true |
Other | vercel | next.js | 466687e88e92369395229b5bb91746d98592735f.json | SWC: Add error checks and tests to next-dynamic (#31683)
fixes #31520
## Bug
- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [x] Errors have helpful link attached, see `contributing.md`
## Feature
- [ ] Implements an existing feature request or RFC. Make sure the feature request h... | packages/next-swc/crates/core/tests/errors/next-dynamic/options-as-variable/input.js | @@ -0,0 +1,7 @@
+import dynamic from 'next/dynamic'
+
+const options = { loading: () => <p>...</p>, ssr: false }
+const DynamicComponentWithCustomLoading = dynamic(
+ () => import('../components/hello'),
+ options
+) | true |
Other | vercel | next.js | 466687e88e92369395229b5bb91746d98592735f.json | SWC: Add error checks and tests to next-dynamic (#31683)
fixes #31520
## Bug
- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [x] Errors have helpful link attached, see `contributing.md`
## Feature
- [ ] Implements an existing feature request or RFC. Make sure the feature request h... | packages/next-swc/crates/core/tests/errors/next-dynamic/options-as-variable/output.js | @@ -0,0 +1,7 @@
+import dynamic from 'next/dynamic';
+
+const options = { loading: () => <p>...</p>, ssr: false };
+const DynamicComponentWithCustomLoading = dynamic(
+ () => import('../components/hello'),
+ options
+); | true |
Other | vercel | next.js | 466687e88e92369395229b5bb91746d98592735f.json | SWC: Add error checks and tests to next-dynamic (#31683)
fixes #31520
## Bug
- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [x] Errors have helpful link attached, see `contributing.md`
## Feature
- [ ] Implements an existing feature request or RFC. Make sure the feature request h... | packages/next-swc/crates/core/tests/errors/next-dynamic/options-as-variable/output.stderr | @@ -0,0 +1,7 @@
+error: next/dynamic options must be an object literal.
+Read more: https://nextjs.org/docs/messages/invalid-dynamic-options-type
+ --> input.js:4:43
+ |
+4 | const DynamicComponentWithCustomLoading = dynamic(
+ | ^^^^^^^
+ | true |
Other | vercel | next.js | 466687e88e92369395229b5bb91746d98592735f.json | SWC: Add error checks and tests to next-dynamic (#31683)
fixes #31520
## Bug
- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [x] Errors have helpful link attached, see `contributing.md`
## Feature
- [ ] Implements an existing feature request or RFC. Make sure the feature request h... | packages/next-swc/crates/core/tests/errors/next-dynamic/too-many-arguments/input.js | @@ -0,0 +1,7 @@
+import dynamic from 'next/dynamic'
+
+const DynamicComponentWithCustomLoading = dynamic(
+ () => import('../components/hello'),
+ { loading: () => <p>...</p> },
+ "3rd"
+) | true |
Other | vercel | next.js | 466687e88e92369395229b5bb91746d98592735f.json | SWC: Add error checks and tests to next-dynamic (#31683)
fixes #31520
## Bug
- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [x] Errors have helpful link attached, see `contributing.md`
## Feature
- [ ] Implements an existing feature request or RFC. Make sure the feature request h... | packages/next-swc/crates/core/tests/errors/next-dynamic/too-many-arguments/output.js | @@ -0,0 +1,7 @@
+import dynamic from 'next/dynamic'
+
+const DynamicComponentWithCustomLoading = dynamic(
+ () => import('../components/hello'),
+ { loading: () => <p>...</p> },
+ "3rd"
+) | true |
Other | vercel | next.js | 466687e88e92369395229b5bb91746d98592735f.json | SWC: Add error checks and tests to next-dynamic (#31683)
fixes #31520
## Bug
- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [x] Errors have helpful link attached, see `contributing.md`
## Feature
- [ ] Implements an existing feature request or RFC. Make sure the feature request h... | packages/next-swc/crates/core/tests/errors/next-dynamic/too-many-arguments/output.stderr | @@ -0,0 +1,6 @@
+error: next/dynamic only accepts 2 arguments
+ --> input.js:3:43
+ |
+3 | const DynamicComponentWithCustomLoading = dynamic(
+ | ^^^^^^^
+ | true |
Other | vercel | next.js | 809d0155ffc98250d84ef2ddfbc729a13a551287.json | Add support for removing React properties. (#31606) | examples/react-remove-properties/.gitignore | @@ -0,0 +1,34 @@
+# 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 | 809d0155ffc98250d84ef2ddfbc729a13a551287.json | Add support for removing React properties. (#31606) | examples/react-remove-properties/README.md | @@ -0,0 +1,27 @@
+# React Remove Properties Example
+
+This example shows how to use the `reactRemoveProperties` config option to remove React properties.
+
+## Preview
+
+Preview the example live on [StackBlitz](http://stackblitz.com/):
+
+[ | examples/react-remove-properties/next.config.js | @@ -0,0 +1,9 @@
+module.exports = {
+ experimental: {
+ reactRemoveProperties: true,
+ // Or, specify a custom list of regular expressions to match properties to remove.
+ // The regexes defined here are processed in Rust so the syntax is different from
+ // JavaScript `RegExp`s. See https://docs.rs/regex.... | true |
Other | vercel | next.js | 809d0155ffc98250d84ef2ddfbc729a13a551287.json | Add support for removing React properties. (#31606) | examples/react-remove-properties/package.json | @@ -0,0 +1,13 @@
+{
+ "private": true,
+ "scripts": {
+ "dev": "next dev",
+ "build": "next build",
+ "start": "next start"
+ },
+ "dependencies": {
+ "next": "latest",
+ "react": "^17.0.2",
+ "react-dom": "^17.0.2"
+ }
+} | true |
Other | vercel | next.js | 809d0155ffc98250d84ef2ddfbc729a13a551287.json | Add support for removing React properties. (#31606) | examples/react-remove-properties/pages/index.js | @@ -0,0 +1,9 @@
+const Index = () => (
+ <div data-test-id="1" data-custom="1a">
+ <div data-custom="2">
+ <h1 data-testid="3">Hello World!</h1>
+ </div>
+ </div>
+)
+
+export default Index | true |
Other | vercel | next.js | 809d0155ffc98250d84ef2ddfbc729a13a551287.json | Add support for removing React properties. (#31606) | packages/next-swc/Cargo.lock | @@ -822,6 +822,7 @@ dependencies = [
"either",
"fxhash",
"pathdiff",
+ "regex",
"serde",
"serde_json",
"styled_components", | true |
Other | vercel | next.js | 809d0155ffc98250d84ef2ddfbc729a13a551287.json | Add support for removing React properties. (#31606) | packages/next-swc/crates/core/Cargo.toml | @@ -25,6 +25,7 @@ swc_ecmascript = { version = "0.88.1", features = ["codegen", "minifier", "optim
swc_node_base = "0.5.1"
swc_stylis = "0.28.0"
tracing = {version = "0.1.28", features = ["release_max_level_off"]}
+regex = "1.5"
[dev-dependencies]
swc_ecma_transforms_testing = "0.45.1" | true |
Other | vercel | next.js | 809d0155ffc98250d84ef2ddfbc729a13a551287.json | Add support for removing React properties. (#31606) | packages/next-swc/crates/core/src/lib.rs | @@ -52,6 +52,7 @@ pub mod hook_optimizer;
pub mod next_dynamic;
pub mod next_ssg;
pub mod page_config;
+pub mod react_remove_properties;
pub mod remove_console;
pub mod styled_jsx;
mod top_level_binding_collector;
@@ -82,6 +83,9 @@ pub struct TransformOptions {
#[serde(default)]
pub remove_console: Op... | true |
Other | vercel | next.js | 809d0155ffc98250d84ef2ddfbc729a13a551287.json | Add support for removing React properties. (#31606) | packages/next-swc/crates/core/src/react_remove_properties.rs | @@ -0,0 +1,72 @@
+use regex::Regex;
+use serde::Deserialize;
+use swc_ecmascript::ast::*;
+use swc_ecmascript::visit::{noop_fold_type, Fold, FoldWith};
+
+#[derive(Clone, Debug, Deserialize)]
+#[serde(untagged)]
+pub enum Config {
+ All(bool),
+ WithOptions(Options),
+}
+
+impl Config {
+ pub fn truthy(&self) ... | true |
Other | vercel | next.js | 809d0155ffc98250d84ef2ddfbc729a13a551287.json | Add support for removing React properties. (#31606) | packages/next-swc/crates/core/tests/fixture.rs | @@ -1,6 +1,7 @@
use next_swc::{
amp_attributes::amp_attributes, next_dynamic::next_dynamic, next_ssg::next_ssg,
- page_config::page_config_test, remove_console::remove_console, styled_jsx::styled_jsx,
+ page_config::page_config_test, react_remove_properties::remove_properties,
+ remove_console::remove_co... | true |
Other | vercel | next.js | 809d0155ffc98250d84ef2ddfbc729a13a551287.json | Add support for removing React properties. (#31606) | packages/next-swc/crates/core/tests/fixture/react-remove-properties/custom/simple/input.js | @@ -0,0 +1,7 @@
+export default function Home() {
+ return <div data-test-id="1" data-custom="1a">
+ <div data-custom="2">
+ <h1 data-testid="3">Hello World!</h1>
+ </div>
+ </div>
+} | true |
Other | vercel | next.js | 809d0155ffc98250d84ef2ddfbc729a13a551287.json | Add support for removing React properties. (#31606) | packages/next-swc/crates/core/tests/fixture/react-remove-properties/custom/simple/output.js | @@ -0,0 +1,11 @@
+export default function Home() {
+ return <div data-test-id="1">
+
+ <div >
+
+ <h1 data-testid="3">Hello World!</h1>
+
+ </div>
+
+ </div>;
+}; | true |
Other | vercel | next.js | 809d0155ffc98250d84ef2ddfbc729a13a551287.json | Add support for removing React properties. (#31606) | packages/next-swc/crates/core/tests/fixture/react-remove-properties/default/simple/input.js | @@ -0,0 +1,7 @@
+export default function Home() {
+ return <div data-test-id="1" data-custom="1a">
+ <div data-custom="2">
+ <h1 data-testid="3" nested={() => (<div data-testid="4">nested</div>)}>Hello World!</h1>
+ </div>
+ </div>
+} | true |
Other | vercel | next.js | 809d0155ffc98250d84ef2ddfbc729a13a551287.json | Add support for removing React properties. (#31606) | packages/next-swc/crates/core/tests/fixture/react-remove-properties/default/simple/output.js | @@ -0,0 +1,12 @@
+export default function Home() {
+ return <div data-custom="1a">
+
+ <div data-custom="2">
+
+ <h1 nested={()=><div >nested</div>
+ }>Hello World!</h1>
+
+ </div>
+
+ </div>;
+}; | true |
Other | vercel | next.js | 809d0155ffc98250d84ef2ddfbc729a13a551287.json | Add support for removing React properties. (#31606) | packages/next-swc/crates/core/tests/full.rs | @@ -58,6 +58,7 @@ fn test(input: &Path, minify: bool) {
is_development: true,
styled_components: Some(assert_json("{}")),
remove_console: None,
+ react_remove_properties: None,
};
let options = options.patch(&fm); | true |
Other | vercel | next.js | 809d0155ffc98250d84ef2ddfbc729a13a551287.json | Add support for removing React properties. (#31606) | packages/next/build/swc/options.js | @@ -67,6 +67,7 @@ function getBaseSWCOptions({
}
: null,
removeConsole: nextConfig?.experimental?.removeConsole,
+ reactRemoveProperties: nextConfig?.experimental?.reactRemoveProperties,
}
}
| true |
Other | vercel | next.js | 809d0155ffc98250d84ef2ddfbc729a13a551287.json | Add support for removing React properties. (#31606) | packages/next/server/config-shared.ts | @@ -132,6 +132,11 @@ export type NextConfig = { [key: string]: any } & {
| {
exclude?: string[]
}
+ reactRemoveProperties?:
+ | boolean
+ | {
+ properties?: string[]
+ }
styledComponents?: boolean
swcMinify?: boolean
cpus?: number | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.