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 | b5080f10106c0d7d7f577e4f3b699e706349f50e.json | Update css examples to use built-in CSS support (#10029)
* Update tailwind example
* Update blog-starter example
* Update with-next-css example
* Update with-quill-js
* Update with-rbx-bulma-pro
* Remove incompatible example
* Update with-react-multi-carousel
* Update-with-semantic-ui
* Update with-videojs exa... | examples/with-zones/home/next.config.js | @@ -1,3 +0,0 @@
-module.exports = {
- target: 'serverless',
-} | true |
Other | vercel | next.js | 3c04111c9c48065890fcf08cdc4890093ef9d996.json | Adjust overlay modal padding on mobile (#15915)
This PR reduces padding on all [iPhone models](https://developer.apple.com/library/archive/documentation/DeviceInformation/Reference/iOSDeviceCompatibility/Displays/Displays.html) to make the error easier to see when you have the debugger open.
Before
 {
+ [data-nextjs-dialog-overlay] {
+ max-height: calc(100% - 15px);
+ }
+ }
+
@media (min-width: 576px) {
[data-nextjs-dialog] {
max-width: 540px; | true |
Other | vercel | next.js | 3c04111c9c48065890fcf08cdc4890093ef9d996.json | Adjust overlay modal padding on mobile (#15915)
This PR reduces padding on all [iPhone models](https://developer.apple.com/library/archive/documentation/DeviceInformation/Reference/iOSDeviceCompatibility/Displays/Displays.html) to make the error easier to see when you have the debugger open.
Before
 {
+ [data-nextjs-dialog-overlay] {
+ padding: 15px 15px 0;
+ }
+ }
+
[data-nextjs-dialog-backdrop] {
position: fixed;
top: 0; | true |
Other | vercel | next.js | 7d7a8fc3000bb830a24225bc362a73a65bda3936.json | Normalize serverless asPath value (#15914)
Since we now use query parameters to pass dynamic route params while routing on Vercel, this makes sure we normalize the request URL before populating the `asPath`
Fixes: https://github.com/vercel/next.js/issues/15879 | packages/next/build/webpack/loaders/next-serverless-loader.ts | @@ -66,12 +66,16 @@ const nextServerlessLoader: loader.Loader = function () {
JSON.parse(previewProps) as __ApiPreviewProps
)
+ const defaultRouteRegex = pageIsDynamicRoute
+ ? `
+ const defaultRouteRegex = getRouteRegex("${page}")
+ `
+ : ''
+
const collectDynamicRouteParams = pageIsDynamic... | true |
Other | vercel | next.js | 7d7a8fc3000bb830a24225bc362a73a65bda3936.json | Normalize serverless asPath value (#15914)
Since we now use query parameters to pass dynamic route params while routing on Vercel, this makes sure we normalize the request URL before populating the `asPath`
Fixes: https://github.com/vercel/next.js/issues/15879 | test/integration/dynamic-optional-routing/pages/[[...optionalName]].js | @@ -1,3 +1,5 @@
+import { useRouter } from 'next/router'
+
export async function getServerSideProps({ query }) {
return {
props: {
@@ -16,6 +18,7 @@ export default function Page(props) {
: `[${props.query.optionalName.join('|')}]`}
</div>
<div id="keys">{JSON.stringify(Object.keys(prop... | true |
Other | vercel | next.js | 7d7a8fc3000bb830a24225bc362a73a65bda3936.json | Normalize serverless asPath value (#15914)
Since we now use query parameters to pass dynamic route params while routing on Vercel, this makes sure we normalize the request URL before populating the `asPath`
Fixes: https://github.com/vercel/next.js/issues/15879 | test/integration/dynamic-optional-routing/pages/nested/[[...optionalName]].js | @@ -1,3 +1,5 @@
+import { useRouter } from 'next/router'
+
export async function getServerSideProps({ query }) {
return {
props: {
@@ -16,6 +18,7 @@ export default function Page(props) {
: `[${props.query.optionalName.join('|')}]`}
</div>
<div id="keys">{JSON.stringify(Object.keys(prop... | true |
Other | vercel | next.js | 7d7a8fc3000bb830a24225bc362a73a65bda3936.json | Normalize serverless asPath value (#15914)
Since we now use query parameters to pass dynamic route params while routing on Vercel, this makes sure we normalize the request URL before populating the `asPath`
Fixes: https://github.com/vercel/next.js/issues/15879 | test/integration/dynamic-optional-routing/test/index.test.js | @@ -375,31 +375,39 @@ describe('Dynamic Optional Routing', () => {
const $ = cheerio.load(html)
expect($('#route').text()).toBe('top level route param: undefined')
expect($('#keys').text()).toBe('[]')
+ expect($('#asPath').text()).toBe('/')
})
it('should render top level optional c... | true |
Other | vercel | next.js | 17716d149913f03f8010ed835c0dd9d411130b99.json | Add tests for querystring-relative urls (#15911) | test/integration/client-navigation/pages/nav/query-only.js | @@ -0,0 +1,24 @@
+import Link from 'next/link'
+import { useRouter } from 'next/router'
+
+export async function getServerSideProps({ query: { prop = '' } }) {
+ return { props: { prop } }
+}
+
+export default function Page({ prop }) {
+ const router = useRouter()
+ return (
+ <>
+ <div id="prop">{prop}</div... | true |
Other | vercel | next.js | 17716d149913f03f8010ed835c0dd9d411130b99.json | Add tests for querystring-relative urls (#15911) | test/integration/client-navigation/test/index.test.js | @@ -789,6 +789,41 @@ describe('Client Navigation', () => {
})
})
+ describe('with querystring relative urls', () => {
+ it('should work with Link', async () => {
+ const browser = await webdriver(context.appPort, '/nav/query-only')
+ try {
+ await browser.elementByCss('#link').click()
+
+... | true |
Other | vercel | next.js | 5dbe0d0215bb9a02ce9f71b1d152640ec897c18b.json | Allow absolute urls in router and Link (#15792)
Fixes https://github.com/vercel/next.js/issues/15639
Fixes https://github.com/vercel/next.js/issues/15820
To Do:
- [x] Doesn't work with `basePath` yet | packages/next/client/link.tsx | @@ -1,21 +1,14 @@
-declare const __NEXT_DATA__: any
-
import React, { Children } from 'react'
import { UrlObject } from 'url'
-import { PrefetchOptions, NextRouter } from '../next-server/lib/router/router'
-import { execOnce, getLocationOrigin } from '../next-server/lib/utils'
+import {
+ PrefetchOptions,
+ NextRou... | true |
Other | vercel | next.js | 5dbe0d0215bb9a02ce9f71b1d152640ec897c18b.json | Allow absolute urls in router and Link (#15792)
Fixes https://github.com/vercel/next.js/issues/15639
Fixes https://github.com/vercel/next.js/issues/15820
To Do:
- [x] Doesn't work with `basePath` yet | packages/next/next-server/lib/router/router.ts | @@ -11,6 +11,7 @@ import {
loadGetInitialProps,
NextPageContext,
ST,
+ getLocationOrigin,
} from '../utils'
import { isDynamicRoute } from './utils/is-dynamic'
import { getRouteMatcher } from './utils/route-matcher'
@@ -47,7 +48,8 @@ export function hasBasePath(path: string): boolean {
}
export functio... | true |
Other | vercel | next.js | 5dbe0d0215bb9a02ce9f71b1d152640ec897c18b.json | Allow absolute urls in router and Link (#15792)
Fixes https://github.com/vercel/next.js/issues/15639
Fixes https://github.com/vercel/next.js/issues/15820
To Do:
- [x] Doesn't work with `basePath` yet | packages/next/next-server/lib/router/utils/parse-relative-url.ts | @@ -1,17 +1,30 @@
-const DUMMY_BASE = new URL('http://n')
+import { getLocationOrigin } from '../../utils'
+
+const DUMMY_BASE = new URL(
+ typeof window === 'undefined' ? 'http://n' : getLocationOrigin()
+)
/**
* Parses path-relative urls (e.g. `/hello/world?foo=bar`). If url isn't path-relative
* (e.g. `./hel... | true |
Other | vercel | next.js | 5dbe0d0215bb9a02ce9f71b1d152640ec897c18b.json | Allow absolute urls in router and Link (#15792)
Fixes https://github.com/vercel/next.js/issues/15639
Fixes https://github.com/vercel/next.js/issues/15820
To Do:
- [x] Doesn't work with `basePath` yet | test/integration/basepath/pages/absolute-url-basepath.js | @@ -0,0 +1,19 @@
+import React from 'react'
+import Link from 'next/link'
+
+export async function getServerSideProps({ query: { port } }) {
+ if (!port) {
+ throw new Error('port required')
+ }
+ return { props: { port } }
+}
+
+export default function Page({ port }) {
+ return (
+ <>
+ <Link href={`htt... | true |
Other | vercel | next.js | 5dbe0d0215bb9a02ce9f71b1d152640ec897c18b.json | Allow absolute urls in router and Link (#15792)
Fixes https://github.com/vercel/next.js/issues/15639
Fixes https://github.com/vercel/next.js/issues/15820
To Do:
- [x] Doesn't work with `basePath` yet | test/integration/basepath/pages/absolute-url-no-basepath.js | @@ -0,0 +1,19 @@
+import React from 'react'
+import Link from 'next/link'
+
+export async function getServerSideProps({ query: { port } }) {
+ if (!port) {
+ throw new Error('port required')
+ }
+ return { props: { port } }
+}
+
+export default function Page({ port }) {
+ return (
+ <>
+ <Link href={`htt... | true |
Other | vercel | next.js | 5dbe0d0215bb9a02ce9f71b1d152640ec897c18b.json | Allow absolute urls in router and Link (#15792)
Fixes https://github.com/vercel/next.js/issues/15639
Fixes https://github.com/vercel/next.js/issues/15820
To Do:
- [x] Doesn't work with `basePath` yet | test/integration/basepath/pages/absolute-url.js | @@ -0,0 +1,16 @@
+import React from 'react'
+import Link from 'next/link'
+
+export default function Page() {
+ return (
+ <>
+ <Link href="https://vercel.com/">
+ <a id="absolute-link">https://vercel.com/</a>
+ </Link>
+ <br />
+ <Link href="mailto:idk@idk.com">
+ <a id="mailto-li... | true |
Other | vercel | next.js | 5dbe0d0215bb9a02ce9f71b1d152640ec897c18b.json | Allow absolute urls in router and Link (#15792)
Fixes https://github.com/vercel/next.js/issues/15639
Fixes https://github.com/vercel/next.js/issues/15820
To Do:
- [x] Doesn't work with `basePath` yet | test/integration/basepath/test/index.test.js | @@ -390,6 +390,45 @@ const runTests = (context, dev = false) => {
expect(pathname).toBe('/docs')
})
+ it('should navigate an absolute url', async () => {
+ const browser = await webdriver(context.appPort, `/docs/absolute-url`)
+ await browser.waitForElementByCss('#absolute-link').click()
+ await che... | true |
Other | vercel | next.js | 5dbe0d0215bb9a02ce9f71b1d152640ec897c18b.json | Allow absolute urls in router and Link (#15792)
Fixes https://github.com/vercel/next.js/issues/15639
Fixes https://github.com/vercel/next.js/issues/15820
To Do:
- [x] Doesn't work with `basePath` yet | test/integration/build-output/test/index.test.js | @@ -104,7 +104,7 @@ describe('Build Output', () => {
expect(parseFloat(err404FirstLoad) - 63).toBeLessThanOrEqual(0)
expect(err404FirstLoad.endsWith('kB')).toBe(true)
- expect(parseFloat(sharedByAll) - 59.3).toBeLessThanOrEqual(0)
+ expect(parseFloat(sharedByAll) - 59.4).toBeLessThanOrEqual(0)... | true |
Other | vercel | next.js | 5dbe0d0215bb9a02ce9f71b1d152640ec897c18b.json | Allow absolute urls in router and Link (#15792)
Fixes https://github.com/vercel/next.js/issues/15639
Fixes https://github.com/vercel/next.js/issues/15820
To Do:
- [x] Doesn't work with `basePath` yet | test/integration/client-navigation/pages/absolute-url.js | @@ -0,0 +1,66 @@
+import React from 'react'
+import Link from 'next/link'
+import { useRouter } from 'next/router'
+
+export async function getServerSideProps({ query: { port } }) {
+ if (!port) {
+ throw new Error('port required')
+ }
+ return { props: { port } }
+}
+
+export default function Page({ port }) {
+ ... | true |
Other | vercel | next.js | 5dbe0d0215bb9a02ce9f71b1d152640ec897c18b.json | Allow absolute urls in router and Link (#15792)
Fixes https://github.com/vercel/next.js/issues/15639
Fixes https://github.com/vercel/next.js/issues/15820
To Do:
- [x] Doesn't work with `basePath` yet | test/integration/client-navigation/pages/dynamic/[slug]/route.js | @@ -8,6 +8,6 @@ export default class DynamicRoute extends React.Component {
}
render() {
- return <p>{this.props.query.slug}</p>
+ return <p id="dynamic-page">{this.props.query.slug}</p>
}
} | true |
Other | vercel | next.js | 5dbe0d0215bb9a02ce9f71b1d152640ec897c18b.json | Allow absolute urls in router and Link (#15792)
Fixes https://github.com/vercel/next.js/issues/15639
Fixes https://github.com/vercel/next.js/issues/15820
To Do:
- [x] Doesn't work with `basePath` yet | test/integration/client-navigation/test/index.test.js | @@ -10,6 +10,7 @@ import {
launchApp,
renderViaHTTP,
waitFor,
+ check,
} from 'next-test-utils'
import webdriver from 'next-webdriver'
import { join } from 'path'
@@ -124,6 +125,47 @@ describe('Client Navigation', () => {
expect(counterText).toBe('Counter: 1')
await browser.close()
})
+
... | true |
Other | vercel | next.js | 5dbe0d0215bb9a02ce9f71b1d152640ec897c18b.json | Allow absolute urls in router and Link (#15792)
Fixes https://github.com/vercel/next.js/issues/15639
Fixes https://github.com/vercel/next.js/issues/15820
To Do:
- [x] Doesn't work with `basePath` yet | test/integration/invalid-href/pages/second.js | @@ -1,7 +1,7 @@
import Link from 'next/link'
import { useRouter } from 'next/router'
-const invalidLink = 'https://google.com/another'
+const invalidLink = 'https://vercel.com/solutions/nextjs'
export default function Page() {
const { query, ...router } = useRouter() | true |
Other | vercel | next.js | 5dbe0d0215bb9a02ce9f71b1d152640ec897c18b.json | Allow absolute urls in router and Link (#15792)
Fixes https://github.com/vercel/next.js/issues/15639
Fixes https://github.com/vercel/next.js/issues/15820
To Do:
- [x] Doesn't work with `basePath` yet | test/integration/invalid-href/pages/third.js | @@ -1,26 +1,10 @@
-import { useRouter } from 'next/router'
-import { useState } from 'react'
-
-const invalidLink = 'https://vercel.com/'
+import Link from 'next/link'
+const invalidLink = 'https://'
export default function Page() {
- const { query, ...router } = useRouter()
- const [isDone, setIsDone] = useState(... | true |
Other | vercel | next.js | 5dbe0d0215bb9a02ce9f71b1d152640ec897c18b.json | Allow absolute urls in router and Link (#15792)
Fixes https://github.com/vercel/next.js/issues/15639
Fixes https://github.com/vercel/next.js/issues/15820
To Do:
- [x] Doesn't work with `basePath` yet | test/integration/invalid-href/test/index.test.js | @@ -10,7 +10,9 @@ import {
nextStart,
waitFor,
check,
+ fetchViaHTTP,
} from 'next-test-utils'
+import cheerio from 'cheerio'
import webdriver from 'next-webdriver'
import { join } from 'path'
@@ -20,9 +22,6 @@ let app
let appPort
const appDir = join(__dirname, '..')
-const firstErrorRegex = /Invalid... | true |
Other | vercel | next.js | 5dbe0d0215bb9a02ce9f71b1d152640ec897c18b.json | Allow absolute urls in router and Link (#15792)
Fixes https://github.com/vercel/next.js/issues/15639
Fixes https://github.com/vercel/next.js/issues/15820
To Do:
- [x] Doesn't work with `basePath` yet | test/integration/size-limit/test/index.test.js | @@ -100,7 +100,7 @@ describe('Production response size', () => {
)
// These numbers are without gzip compression!
- const delta = responseSizesBytes - 166 * 1024
+ const delta = responseSizesBytes - 167 * 1024
expect(delta).toBeLessThanOrEqual(1024) // don't increase size more than 1kb
expec... | true |
Other | vercel | next.js | 885b40681cca414ff8093cd2bae662ff322db420.json | remove dotenv from with-stripe-typescript (#15814)
removed the dotenv dependency in favor of Next.js environment support: #15225
The example seems to work with no other changes required
 | examples/with-stripe-typescript/.env.local.example | @@ -2,5 +2,6 @@
# https://dashboard.stripe.com/apikeys
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_12345
STRIPE_SECRET_KEY=sk_12345
+STRIPE_PAYMENT_DESCRIPTION='Software development services'
# https://stripe.com/docs/webhooks/signatures
STRIPE_WEBHOOK_SECRET=whsec_1234 | true |
Other | vercel | next.js | 5db2860cc87d8077da3e3ad7ae0cbaf29ae0fb71.json | add payment description for with-stripe-typescript (#15888) | examples/with-stripe-typescript/pages/api/payment_intents/index.ts | @@ -25,6 +25,7 @@ export default async function handler(
payment_method_types: ['card'],
amount: formatAmountForStripe(amount, CURRENCY),
currency: CURRENCY,
+ description: process.env.STRIPE_PAYMENT_DESCRIPTION ?? '',
}
const payment_intent: Stripe.PaymentIntent = await ... | true |
Other | vercel | next.js | fcc4d8cd50eb2170fda9fbac6f9853799ceb9959.json | await ctx.renderPage() in examples for TypeScript (#15528)
Co-authored-by: Joe Haddad <joe.haddad@zeit.co> | examples/with-cxs/pages/_document.js | @@ -3,7 +3,7 @@ import cxs from 'cxs/lite'
export default class MyDocument extends Document {
static async getInitialProps({ renderPage }) {
- const page = renderPage()
+ const page = await renderPage()
const style = cxs.getCss()
return { ...page, style }
} | true |
Other | vercel | next.js | fcc4d8cd50eb2170fda9fbac6f9853799ceb9959.json | await ctx.renderPage() in examples for TypeScript (#15528)
Co-authored-by: Joe Haddad <joe.haddad@zeit.co> | examples/with-glamor/pages/_document.js | @@ -3,7 +3,7 @@ import { renderStatic } from 'glamor/server'
class MyDocument extends Document {
static async getInitialProps({ renderPage }) {
- const page = renderPage()
+ const page = await renderPage()
const { css, ids } = renderStatic(() => page.html || page.errorHtml)
return { ...page, css, ... | true |
Other | vercel | next.js | fcc4d8cd50eb2170fda9fbac6f9853799ceb9959.json | await ctx.renderPage() in examples for TypeScript (#15528)
Co-authored-by: Joe Haddad <joe.haddad@zeit.co> | examples/with-goober/pages/_document.js | @@ -2,9 +2,8 @@ import Document, { Head, Main, NextScript } from 'next/document'
import { extractCss } from 'goober'
export default class MyDocument extends Document {
- static getInitialProps({ renderPage }) {
- const page = renderPage()
-
+ static async getInitialProps({ renderPage }) {
+ const page = awa... | true |
Other | vercel | next.js | fcc4d8cd50eb2170fda9fbac6f9853799ceb9959.json | await ctx.renderPage() in examples for TypeScript (#15528)
Co-authored-by: Joe Haddad <joe.haddad@zeit.co> | examples/with-react-native-web/pages/_document.js | @@ -15,7 +15,7 @@ export default class MyDocument extends Document {
static async getInitialProps({ renderPage }) {
AppRegistry.registerComponent(config.name, () => Main)
const { getStyleElement } = AppRegistry.getApplication(config.name)
- const page = renderPage()
+ const page = await renderPage()
... | true |
Other | vercel | next.js | fcc4d8cd50eb2170fda9fbac6f9853799ceb9959.json | await ctx.renderPage() in examples for TypeScript (#15528)
Co-authored-by: Joe Haddad <joe.haddad@zeit.co> | examples/with-tailwindcss-emotion/pages/_document.js | @@ -10,7 +10,7 @@ import { extractCritical } from '@emotion/server'
export default class MyDocument extends Document {
static async getInitialProps(ctx) {
const initialProps = await Document.getInitialProps(ctx)
- const page = ctx.renderPage()
+ const page = await ctx.renderPage()
const styles = ext... | true |
Other | vercel | next.js | fcc4d8cd50eb2170fda9fbac6f9853799ceb9959.json | await ctx.renderPage() in examples for TypeScript (#15528)
Co-authored-by: Joe Haddad <joe.haddad@zeit.co> | examples/with-typestyle/pages/_document.js | @@ -2,8 +2,8 @@ import Document, { Head, Main, NextScript } from 'next/document'
import { getStyles } from 'typestyle'
export default class MyDocument extends Document {
- static getInitialProps({ renderPage }) {
- const page = renderPage()
+ static async getInitialProps({ renderPage }) {
+ const page = awa... | true |
Other | vercel | next.js | 9ca670d1b964eb41f1a2838cb6780fd5736ccb4a.json | Remove dotenv from with-firebase example (#15743)
Remove the dotenv dependency from all examples (in favor of environment support): #15225
All variables are exposed to the client. This Example does not use firebase-admin. | examples/with-firebase/.env.example | @@ -1,8 +0,0 @@
-# TODO. Fill in with Firebase Config
-FIREBASE_API_KEY=
-FIREBASE_AUTH_DOMAIN=
-FIREBASE_DATABASE_URL=
-FIREBASE_PROJECT_ID=
-FIREBASE_STORAGE_BUCKET=
-FIREBASE_MESSAGING_SENDER_ID=
-FIREBASE_APP_ID=
\ No newline at end of file | true |
Other | vercel | next.js | 9ca670d1b964eb41f1a2838cb6780fd5736ccb4a.json | Remove dotenv from with-firebase example (#15743)
Remove the dotenv dependency from all examples (in favor of environment support): #15225
All variables are exposed to the client. This Example does not use firebase-admin. | examples/with-firebase/.env.local.example | @@ -0,0 +1,8 @@
+# TODO. Fill in with Firebase Config
+NEXT_PUBLIC_FIREBASE_API_KEY=
+NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=
+NEXT_PUBLIC_FIREBASE_DATABASE_URL=
+NEXT_PUBLIC_FIREBASE_PROJECT_ID=
+NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=
+NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=
+NEXT_PUBLIC_FIREBASE_APP_ID=
\ No newline at end... | true |
Other | vercel | next.js | 9ca670d1b964eb41f1a2838cb6780fd5736ccb4a.json | Remove dotenv from with-firebase example (#15743)
Remove the dotenv dependency from all examples (in favor of environment support): #15225
All variables are exposed to the client. This Example does not use firebase-admin. | examples/with-firebase/README.md | @@ -1,4 +1,4 @@
-# With Firebase
+# Firebase Example
This is a simple set up for Firebase for client side applications.
@@ -14,8 +14,6 @@ Deploy the example using [Vercel](https://vercel.com):
## How to use
-### Using `create-next-app`
-
Execute [`create-next-app`](https://github.com/vercel/next.js/tree/cana... | true |
Other | vercel | next.js | 9ca670d1b964eb41f1a2838cb6780fd5736ccb4a.json | Remove dotenv from with-firebase example (#15743)
Remove the dotenv dependency from all examples (in favor of environment support): #15225
All variables are exposed to the client. This Example does not use firebase-admin. | examples/with-firebase/firebase/clientApp.js | @@ -5,13 +5,13 @@ import 'firebase/storage' // If you need it
import 'firebase/analytics' // If you need it
const clientCredentials = {
- apiKey: process.env.FIREBASE_API_KEY,
- authDomain: process.env.FIREBASE_AUTH_DOMAIN,
- databaseURL: process.env.FIREBASE_DATABASE_URL,
- projectId: process.env.FIREBASE_PROJ... | true |
Other | vercel | next.js | 9ca670d1b964eb41f1a2838cb6780fd5736ccb4a.json | Remove dotenv from with-firebase example (#15743)
Remove the dotenv dependency from all examples (in favor of environment support): #15225
All variables are exposed to the client. This Example does not use firebase-admin. | examples/with-firebase/next.config.js | @@ -1,14 +0,0 @@
-// On production, variables are set with `now secrets`. On development, they use the .env file
-require('dotenv').config()
-
-module.exports = {
- env: {
- FIREBASE_API_KEY: process.env.FIREBASE_API_KEY,
- FIREBASE_AUTH_DOMAIN: process.env.FIREBASE_AUTH_DOMAIN,
- FIREBASE_DATABASE_URL: proce... | true |
Other | vercel | next.js | 9ca670d1b964eb41f1a2838cb6780fd5736ccb4a.json | Remove dotenv from with-firebase example (#15743)
Remove the dotenv dependency from all examples (in favor of environment support): #15225
All variables are exposed to the client. This Example does not use firebase-admin. | examples/with-firebase/package.json | @@ -7,12 +7,10 @@
"start": "next start"
},
"dependencies": {
- "firebase": "7.11.0",
+ "firebase": "7.17.0",
"next": "latest",
"react": "^16.13.0",
"react-dom": "^16.13.0"
},
- "devDependencies": {
- "dotenv": "8.2.0"
- }
+ "license": "MIT"
} | true |
Other | vercel | next.js | e0d0c2ebb5c05237103f683982d78f78525b64fb.json | Explain Sass Extensions in CSS Docs (#15830)
Fixes #15737 | docs/basic-features/built-in-css-support.md | @@ -117,6 +117,13 @@ npm install sass
Sass support has the same benefits and restrictions as the built-in CSS support detailed above.
+> **Note**: Sass supports [two different syntaxes](https://sass-lang.com/documentation/syntax), each with their own extension.
+> The `.scss` extension requires you use the [SCSS s... | false |
Other | vercel | next.js | e89bcf7e3965783424468463c0cde0b45e32f868.json | Add docs page for Create Next App (#15454)
Following up from #14830, this PR adds a new page to the docs for Create Next App. The content is identical to the README created as part of #14830.
Also added a link on the main `getting-started` page to the new docs for Create Next App to help users find more info on Crea... | docs/create-next-app.md | @@ -0,0 +1,55 @@
+---
+description: Create Next.js apps in one command with create-next-app.
+---
+
+# Create Next App
+
+The easiest way to get started with Next.js is by using `create-next-app`. This simple CLI tool enables you to quickly start building a new Next.js application, with everything set up for you. You c... | true |
Other | vercel | next.js | e89bcf7e3965783424468463c0cde0b45e32f868.json | Add docs page for Create Next App (#15454)
Following up from #14830, this PR adds a new page to the docs for Create Next App. The content is identical to the README created as part of #14830.
Also added a link on the main `getting-started` page to the new docs for Create Next App to help users find more info on Crea... | docs/getting-started.md | @@ -29,6 +29,8 @@ yarn create next-app
After the installation is complete, follow the instructions to start the development server. Try editing `pages/index.js` and see the result on your browser.
+For more information on how to use `create-next-app`, you can review the [`create-next-app` documentation](/docs/crea... | true |
Other | vercel | next.js | 9dd974dfca1efd0b451065056f95f92747e2dada.json | Fix dotenv loading with cascading values (#15799)
Adds additional test cases for cascading env values and corrects behavior
Fixes: https://github.com/vercel/next.js/issues/15744 | packages/next/lib/load-env-config.ts | @@ -27,6 +27,9 @@ export function processEnv(loadedEnvFiles: LoadedEnvFiles, dir?: string) {
// function is re-used or we are running in `next start` mode
process.env.__NEXT_PROCESSED_ENV = 'true'
+ const origEnv = Object.assign({}, process.env)
+ const parsed: dotenv.DotenvParseOutput = {}
+
for (const en... | true |
Other | vercel | next.js | 9dd974dfca1efd0b451065056f95f92747e2dada.json | Fix dotenv loading with cascading values (#15799)
Adds additional test cases for cascading env values and corrects behavior
Fixes: https://github.com/vercel/next.js/issues/15744 | test/integration/env-config/app/.env | @@ -1,5 +1,6 @@
PROCESS_ENV_KEY="env"
ENV_FILE_KEY=env
+ENV_FILE_EMPTY_FIRST=
ENV_FILE_LOCAL_OVERRIDE_TEST=env
ENV_FILE_DEVELOPMENT_OVERRIDE_TEST=env
ENV_FILE_DEVELOPMENT_LOCAL_OVERRIDEOVERRIDE_TEST=env
@@ -11,4 +12,5 @@ NEXT_PUBLIC_TEST_DEST=another
ENV_FILE_EXPANDED=$ENV_FILE_KEY
ENV_FILE_EXPANDED_CONCAT=hello... | true |
Other | vercel | next.js | 9dd974dfca1efd0b451065056f95f92747e2dada.json | Fix dotenv loading with cascading values (#15799)
Adds additional test cases for cascading env values and corrects behavior
Fixes: https://github.com/vercel/next.js/issues/15744 | test/integration/env-config/app/.env.local | @@ -1,2 +1,3 @@
LOCAL_ENV_FILE_KEY=localenv
+ENV_FILE_EMPTY_FIRST=\$escaped
ENV_FILE_LOCAL_OVERRIDE_TEST=localenv
\ No newline at end of file | true |
Other | vercel | next.js | 9dd974dfca1efd0b451065056f95f92747e2dada.json | Fix dotenv loading with cascading values (#15799)
Adds additional test cases for cascading env values and corrects behavior
Fixes: https://github.com/vercel/next.js/issues/15744 | test/integration/env-config/app/pages/api/all.js | @@ -1,6 +1,8 @@
const variables = [
'PROCESS_ENV_KEY',
'ENV_FILE_KEY',
+ 'ENV_FILE_EMPTY_FIRST',
+ 'ENV_FILE_PROCESS_ENV',
'LOCAL_ENV_FILE_KEY',
'ENV_FILE_LOCAL_OVERRIDE_TEST',
'PRODUCTION_ENV_FILE_KEY', | true |
Other | vercel | next.js | 9dd974dfca1efd0b451065056f95f92747e2dada.json | Fix dotenv loading with cascading values (#15799)
Adds additional test cases for cascading env values and corrects behavior
Fixes: https://github.com/vercel/next.js/issues/15744 | test/integration/env-config/app/pages/index.js | @@ -1,6 +1,8 @@
const variables = [
'PROCESS_ENV_KEY',
'ENV_FILE_KEY',
+ 'ENV_FILE_EMPTY_FIRST',
+ 'ENV_FILE_PROCESS_ENV',
'LOCAL_ENV_FILE_KEY',
'ENV_FILE_LOCAL_OVERRIDE_TEST',
'PRODUCTION_ENV_FILE_KEY', | true |
Other | vercel | next.js | 9dd974dfca1efd0b451065056f95f92747e2dada.json | Fix dotenv loading with cascading values (#15799)
Adds additional test cases for cascading env values and corrects behavior
Fixes: https://github.com/vercel/next.js/issues/15744 | test/integration/env-config/app/pages/some-ssg.js | @@ -1,6 +1,8 @@
const variables = [
'PROCESS_ENV_KEY',
'ENV_FILE_KEY',
+ 'ENV_FILE_EMPTY_FIRST',
+ 'ENV_FILE_PROCESS_ENV',
'LOCAL_ENV_FILE_KEY',
'ENV_FILE_LOCAL_OVERRIDE_TEST',
'PRODUCTION_ENV_FILE_KEY',
@@ -25,7 +27,7 @@ export async function getStaticProps() {
const items = {}
variables.forE... | true |
Other | vercel | next.js | 9dd974dfca1efd0b451065056f95f92747e2dada.json | Fix dotenv loading with cascading values (#15799)
Adds additional test cases for cascading env values and corrects behavior
Fixes: https://github.com/vercel/next.js/issues/15744 | test/integration/env-config/app/pages/some-ssp.js | @@ -1,6 +1,8 @@
const variables = [
'PROCESS_ENV_KEY',
'ENV_FILE_KEY',
+ 'ENV_FILE_EMPTY_FIRST',
+ 'ENV_FILE_PROCESS_ENV',
'LOCAL_ENV_FILE_KEY',
'ENV_FILE_LOCAL_OVERRIDE_TEST',
'PRODUCTION_ENV_FILE_KEY',
@@ -25,7 +27,7 @@ export async function getServerSideProps() {
const items = {}
variables.... | true |
Other | vercel | next.js | 9dd974dfca1efd0b451065056f95f92747e2dada.json | Fix dotenv loading with cascading values (#15799)
Adds additional test cases for cascading env values and corrects behavior
Fixes: https://github.com/vercel/next.js/issues/15744 | test/integration/env-config/test/index.test.js | @@ -51,6 +51,8 @@ const runTests = (mode = 'dev') => {
expect(data.ENV_FILE_EXPANDED_CONCAT).toBe('hello-env')
expect(data.ENV_FILE_EXPANDED_ESCAPED).toBe('$ENV_FILE_KEY')
expect(data.ENV_FILE_KEY_EXCLAMATION).toBe('hello!')
+ expect(data.ENV_FILE_EMPTY_FIRST).toBe(isTestEnv ? '' : '$escaped')
+ ex... | true |
Other | vercel | next.js | 9f92819742c0138ef90e155feb94224d450f8883.json | Remove dotenv from auth0 Next.js example (#15398)
We should remove the dotenv dependency from all Next.js examples (in favor of Next.js environment support):
https://github.com/vercel/next.js/issues/15225 | examples/auth0/.env.local.example | @@ -0,0 +1,11 @@
+# Public Environment variables that can be used in the browser.
+NEXT_PUBLIC_AUTH0_CLIENT_ID=
+NEXT_PUBLIC_AUTH0_SCOPE="openid profile"
+NEXT_PUBLIC_AUTH0_DOMAIN=
+NEXT_PUBLIC_REDIRECT_URI="http://localhost:3000/api/callback"
+NEXT_PUBLIC_POST_LOGOUT_REDIRECT_URI="http://localhost:3000"
+
+# Secret en... | true |
Other | vercel | next.js | 9f92819742c0138ef90e155feb94224d450f8883.json | Remove dotenv from auth0 Next.js example (#15398)
We should remove the dotenv dependency from all Next.js examples (in favor of Next.js environment support):
https://github.com/vercel/next.js/issues/15225 | examples/auth0/.env.template | @@ -1,6 +0,0 @@
-AUTH0_CLIENT_ID=
-AUTH0_DOMAIN=
-AUTH0_CLIENT_SECRET=
-REDIRECT_URI=
-POST_LOGOUT_REDIRECT_URI=
-SESSION_COOKIE_SECRET= | true |
Other | vercel | next.js | 9f92819742c0138ef90e155feb94224d450f8883.json | Remove dotenv from auth0 Next.js example (#15398)
We should remove the dotenv dependency from all Next.js examples (in favor of Next.js environment support):
https://github.com/vercel/next.js/issues/15225 | examples/auth0/.gitignore | @@ -24,9 +24,6 @@ npm-debug.log*
yarn-debug.log*
yarn-error.log*
-# auth0 env
-.env
-
# local env files
.env.local
.env.development.local | true |
Other | vercel | next.js | 9f92819742c0138ef90e155feb94224d450f8883.json | Remove dotenv from auth0 Next.js example (#15398)
We should remove the dotenv dependency from all Next.js examples (in favor of Next.js environment support):
https://github.com/vercel/next.js/issues/15225 | examples/auth0/README.md | @@ -1,10 +1,17 @@
# Next.js and Auth0 Example
-This example shows how you can use `@auth0/nextjs-auth` to easily add authentication support to your Next.js application.
+This example shows how you can use `@auth0/nextjs-auth` to easily add authentication support to your Next.js application. It tries to cover a few t... | true |
Other | vercel | next.js | 9f92819742c0138ef90e155feb94224d450f8883.json | Remove dotenv from auth0 Next.js example (#15398)
We should remove the dotenv dependency from all Next.js examples (in favor of Next.js environment support):
https://github.com/vercel/next.js/issues/15225 | examples/auth0/lib/auth0.js | @@ -1,15 +1,18 @@
import { initAuth0 } from '@auth0/nextjs-auth0'
-import config from './config'
export default initAuth0({
- clientId: config.AUTH0_CLIENT_ID,
- clientSecret: config.AUTH0_CLIENT_SECRET,
- scope: config.AUTH0_SCOPE,
- domain: config.AUTH0_DOMAIN,
- redirectUri: config.REDIRECT_URI,
- postLogo... | true |
Other | vercel | next.js | 9f92819742c0138ef90e155feb94224d450f8883.json | Remove dotenv from auth0 Next.js example (#15398)
We should remove the dotenv dependency from all Next.js examples (in favor of Next.js environment support):
https://github.com/vercel/next.js/issues/15225 | examples/auth0/lib/config.js | @@ -1,26 +0,0 @@
-if (typeof window === 'undefined') {
- /**
- * Settings exposed to the server.
- */
- module.exports = {
- AUTH0_CLIENT_ID: process.env.AUTH0_CLIENT_ID,
- AUTH0_CLIENT_SECRET: process.env.AUTH0_CLIENT_SECRET,
- AUTH0_SCOPE: process.env.AUTH0_SCOPE,
- AUTH0_DOMAIN: process.env.AUTH0_D... | true |
Other | vercel | next.js | 9f92819742c0138ef90e155feb94224d450f8883.json | Remove dotenv from auth0 Next.js example (#15398)
We should remove the dotenv dependency from all Next.js examples (in favor of Next.js environment support):
https://github.com/vercel/next.js/issues/15225 | examples/auth0/next.config.js | @@ -1,17 +0,0 @@
-const dotenv = require('dotenv')
-dotenv.config()
-
-module.exports = {
- env: {
- AUTH0_DOMAIN: process.env.AUTH0_DOMAIN,
- AUTH0_CLIENT_ID: process.env.AUTH0_CLIENT_ID,
- AUTH0_CLIENT_SECRET: process.env.AUTH0_CLIENT_SECRET,
- AUTH0_SCOPE: 'openid profile',
- REDIRECT_URI:
- pro... | true |
Other | vercel | next.js | 9f92819742c0138ef90e155feb94224d450f8883.json | Remove dotenv from auth0 Next.js example (#15398)
We should remove the dotenv dependency from all Next.js examples (in favor of Next.js environment support):
https://github.com/vercel/next.js/issues/15225 | examples/auth0/package.json | @@ -9,7 +9,6 @@
"license": "MIT",
"dependencies": {
"@auth0/nextjs-auth0": "^0.6.0",
- "dotenv": "^8.2.0",
"next": "latest",
"react": "^16.12.0",
"react-dom": "^16.12.0" | true |
Other | vercel | next.js | 9f92819742c0138ef90e155feb94224d450f8883.json | Remove dotenv from auth0 Next.js example (#15398)
We should remove the dotenv dependency from all Next.js examples (in favor of Next.js environment support):
https://github.com/vercel/next.js/issues/15225 | examples/auth0/vercel.json | @@ -1,12 +0,0 @@
-{
- "build": {
- "env": {
- "AUTH0_DOMAIN": "YOUR_AUTH0_DOMAIN",
- "AUTH0_CLIENT_ID": "YOUR_AUTH0_CLIENT_ID",
- "AUTH0_CLIENT_SECRET": "@auth0_client_secret",
- "REDIRECT_URI": "https://my-website.now.sh/api/callback",
- "POST_LOGOUT_REDIRECT_URI": "https://my-website.now.... | true |
Other | vercel | next.js | 841d4efc517a379d8947f491e3c6a1c4784bbccf.json | Improve router types (#15775) | packages/next/next-server/lib/router/router.ts | @@ -22,6 +22,18 @@ import {
normalizePathTrailingSlash,
} from '../../../client/normalize-trailing-slash'
+interface TransitionOptions {
+ shallow?: boolean
+}
+
+interface NextHistoryState {
+ url: string
+ as: string
+ options: TransitionOptions
+}
+
+type HistoryState = null | { __N: false } | ({ __N: true... | false |
Other | vercel | next.js | d0c57cf6b3473c2a280ab03059a24f20555e9d3f.json | Add clarification of routing to a dynamic route (#15771)
While it is mentioned in the [link documentation](https://nextjs.org/docs/api-reference/next/link), I think it is useful to also explain in the dynamic route documentation that you need to include the as parameter when routing to a dynamic route/ | docs/routing/dynamic-routes.md | @@ -108,5 +108,6 @@ The `query` objects are as follows:
- `pages/post/[pid].js` - Will match `/post/1`, `/post/abc`, etc. But not `/post/create`
- `pages/post/[...slug].js` - Will match `/post/1/2`, `/post/a/b/c`, etc. But not `/post/create`, `/post/abc`
- Pages that are statically optimized by [Automatic Static... | false |
Other | vercel | next.js | ad5c736798d832f818692f20ae583d349dce7874.json | Remove unused error (#15748)
Irrelevant since https://github.com/vercel/next.js/pull/15379 | errors/popstate-state-empty.md | @@ -2,12 +2,12 @@
#### Why This Error Occurred
-When using the browser back button the popstate event is triggered. Next.js sets
-`popstate` event triggered but `event.state` did not have `url` or `as`, causing a route change failure
+When using the browser back button the popstate event is triggered. Next.js sees... | true |
Other | vercel | next.js | ad5c736798d832f818692f20ae583d349dce7874.json | Remove unused error (#15748)
Irrelevant since https://github.com/vercel/next.js/pull/15379 | packages/next/next-server/lib/router/router.ts | @@ -360,13 +360,6 @@ export default class Router implements BaseRouter {
return
}
- if (process.env.NODE_ENV !== 'production') {
- if (typeof url === 'undefined' || typeof as === 'undefined') {
- console.warn(
- '`popstate` event triggered but `event.state` did not have `url` or `a... | true |
Other | vercel | next.js | c9e379c3bf3c028900f0feb7876590cf85fdb199.json | Fix wrong asPath on 404 (#15728)
Caught this while reviewing router code for https://github.com/vercel/next.js/pull/15710 | packages/next/client/index.js | @@ -58,7 +58,7 @@ if (
page === '/_error' &&
hydrateProps &&
hydrateProps.pageProps &&
- hydrateProps.pageProps.statusCode === '404'
+ hydrateProps.pageProps.statusCode === 404
)
) {
asPath = delBasePath(asPath) | true |
Other | vercel | next.js | c9e379c3bf3c028900f0feb7876590cf85fdb199.json | Fix wrong asPath on 404 (#15728)
Caught this while reviewing router code for https://github.com/vercel/next.js/pull/15710 | test/integration/basepath/test/index.test.js | @@ -212,6 +212,7 @@ const runTests = (context, dev = false) => {
it('should not update URL for a 404', async () => {
const browser = await webdriver(context.appPort, '/missing')
const pathname = await browser.eval(() => window.location.pathname)
+ expect(await browser.eval(() => window.next.router.asPat... | true |
Other | vercel | next.js | d97d045dfc7bbad53dfee8b092e1d95bcaf099f1.json | Stabilize another test (#15697)
Saw this one fail on azure | test/integration/empty-object-getInitialProps/test/index.test.js | @@ -8,6 +8,7 @@ import {
launchApp,
killApp,
waitFor,
+ check,
} from 'next-test-utils'
jest.setTimeout(1000 * 60 * 2)
@@ -49,20 +50,24 @@ describe('Empty Project', () => {
it('should show empty object warning during client transition', async () => {
const browser = await webdriver(appPort, '/st... | false |
Other | vercel | next.js | 1e3534e1694f2c59b32025357039cd006d6e3532.json | Add apollo state func (#19137)
The intention is to show people the correlation between things, in this case, understand the usage of the same key from the props and the rehydration.
Hopefully, this change will bring value as it has done with some Juniors already. | examples/with-apollo/lib/apolloClient.js | @@ -3,6 +3,8 @@ import { ApolloClient, HttpLink, InMemoryCache } from '@apollo/client'
import { concatPagination } from '@apollo/client/utilities'
import merge from 'deepmerge'
+export const APOLLO_STATE_PROP_NAME = '__APOLLO_STATE__'
+
let apolloClient
function createApolloClient() {
@@ -47,7 +49,16 @@ export ... | true |
Other | vercel | next.js | 1e3534e1694f2c59b32025357039cd006d6e3532.json | Add apollo state func (#19137)
The intention is to show people the correlation between things, in this case, understand the usage of the same key from the props and the rehydration.
Hopefully, this change will bring value as it has done with some Juniors already. | examples/with-apollo/pages/_app.js | @@ -2,7 +2,7 @@ import { ApolloProvider } from '@apollo/client'
import { useApollo } from '../lib/apolloClient'
export default function App({ Component, pageProps }) {
- const apolloClient = useApollo(pageProps.initialApolloState)
+ const apolloClient = useApollo(pageProps)
return (
<ApolloProvider clie... | true |
Other | vercel | next.js | 1e3534e1694f2c59b32025357039cd006d6e3532.json | Add apollo state func (#19137)
The intention is to show people the correlation between things, in this case, understand the usage of the same key from the props and the rehydration.
Hopefully, this change will bring value as it has done with some Juniors already. | examples/with-apollo/pages/index.js | @@ -6,7 +6,7 @@ import PostList, {
ALL_POSTS_QUERY,
allPostsQueryVars,
} from '../components/PostList'
-import { initializeApollo } from '../lib/apolloClient'
+import { initializeApollo, addApolloState } from '../lib/apolloClient'
const IndexPage = () => (
<App>
@@ -25,12 +25,10 @@ export async function ge... | true |
Other | vercel | next.js | 17a53e27656cb74700d1da3296179e94f3646e59.json | Revise image example with layouts near the top (#19161)
This page is useful for testing out layouts so we moved that section to the top. | examples/image-component/README.md | @@ -2,7 +2,7 @@
This example shows how to use the [Image Component in Next.js](https://nextjs.org/docs/api-reference/next/image) serve optimized, responsive images.
-The index page ([`pages/index.js`](pages/index.js)) has a couple images, one internal image and one external image. In [`next.config.js`](next.config... | true |
Other | vercel | next.js | 17a53e27656cb74700d1da3296179e94f3646e59.json | Revise image example with layouts near the top (#19161)
This page is useful for testing out layouts so we moved that section to the top. | examples/image-component/pages/index.js | @@ -11,52 +11,28 @@ const Index = () => (
<div className={styles.card}>
<h1>Image Component with Next.js</h1>
<p>
- The images below use the{' '}
+ This page demonstrates the usage of the{' '}
<a href="https://nextjs.org/docs/api-reference/next/image">
next/image
... | true |
Other | vercel | next.js | 7aa8c2c7ec4149629856182f05cce556db8366ae.json | Update docs to use <Image> instead of <img> (#19160)
This unifies the docs to always use `<Image>` instead of `<img>` so we can set readers up for success. | docs/api-reference/next.config.js/runtime-configuration.md | @@ -32,6 +32,7 @@ To get access to the runtime configs in your app use `next/config`, like so:
```jsx
import getConfig from 'next/config'
+import Image from 'next/image'
// Only holds serverRuntimeConfig and publicRuntimeConfig
const { serverRuntimeConfig, publicRuntimeConfig } = getConfig()
@@ -43,7 +44,11 @@ ... | true |
Other | vercel | next.js | 7aa8c2c7ec4149629856182f05cce556db8366ae.json | Update docs to use <Image> instead of <img> (#19160)
This unifies the docs to always use `<Image>` instead of `<img>` so we can set readers up for success. | docs/api-reference/next/link.md | @@ -202,12 +202,21 @@ The default behavior of the `Link` component is to `push` a new URL into the `hi
`Link` supports any component that supports the `onClick` event, in the case you don't provide an `<a>` tag, consider the following example:
```jsx
-<Link href="/about">
- <img src="/static/image.png" alt="image"... | true |
Other | vercel | next.js | 7aa8c2c7ec4149629856182f05cce556db8366ae.json | Update docs to use <Image> instead of <img> (#19160)
This unifies the docs to always use `<Image>` instead of `<img>` so we can set readers up for success. | docs/basic-features/static-file-serving.md | @@ -6,14 +6,16 @@ description: Next.js allows you to serve static files, like images, in the publi
Next.js can serve static files, like images, under a folder called `public` in the root directory. Files inside `public` can then be referenced by your code starting from the base URL (`/`).
-For example, if you add ... | true |
Other | vercel | next.js | 7aa8c2c7ec4149629856182f05cce556db8366ae.json | Update docs to use <Image> instead of <img> (#19160)
This unifies the docs to always use `<Image>` instead of `<img>` so we can set readers up for success. | docs/manifest.json | @@ -25,14 +25,14 @@
"title": "Image Optimization",
"path": "/docs/basic-features/image-optimization.md"
},
- {
- "title": "Fast Refresh",
- "path": "/docs/basic-features/fast-refresh.md"
- },
{
"title"... | true |
Other | vercel | next.js | 29694572ed499f18b63ac329173a9b893dd611a2.json | Fix typo in 1.Bug_report.md (#19143)
likelyhood -> likelihood | .github/ISSUE_TEMPLATE/1.Bug_report.md | @@ -4,7 +4,7 @@ about: Create a bug report for the Next.js core / examples
labels: 'template: bug'
---
-<!-- NOTE: This template is not optional. If you remove it or leave out sections there is a high likelyhood it will be moved to the GitHub Discussions "Help" section -->
+<!-- NOTE: This template is not optional.... | false |
Other | vercel | next.js | 9174b7a337b181a6db1f0f20dd03325b6e1cc1c3.json | Fix component lifecycle order for style swap (#19125)
Co-authored-by: Gerald Monaco <gbmonaco@google.com> | packages/next/client/index.tsx | @@ -661,7 +661,7 @@ function doRender(input: RenderRouteInfo): Promise<any> {
return true
}
- function onCommit() {
+ function onHeadCommit() {
if (
// We use `style-loader` in development, so we don't need to do anything
// unless we're in production:
@@ -723,12 +723,15 @@ function doRen... | true |
Other | vercel | next.js | 9174b7a337b181a6db1f0f20dd03325b6e1cc1c3.json | Fix component lifecycle order for style swap (#19125)
Co-authored-by: Gerald Monaco <gbmonaco@google.com> | test/integration/css-fixtures/transition-react/pages/index.js | @@ -0,0 +1,11 @@
+import Link from 'next/link'
+
+export default function Home() {
+ return (
+ <main>
+ <Link href="/other" prefetch={false}>
+ <a id="link-other">other</a>
+ </Link>
+ </main>
+ )
+} | true |
Other | vercel | next.js | 9174b7a337b181a6db1f0f20dd03325b6e1cc1c3.json | Fix component lifecycle order for style swap (#19125)
Co-authored-by: Gerald Monaco <gbmonaco@google.com> | test/integration/css-fixtures/transition-react/pages/other.js | @@ -0,0 +1,34 @@
+import React from 'react'
+import Link from 'next/link'
+import css from './other.module.css'
+
+export default class Other extends React.Component {
+ ref = React.createRef()
+
+ constructor(props) {
+ super(props)
+ this.state = {
+ color: null,
+ }
+ }
+
+ componentDidMount() {
+ ... | true |
Other | vercel | next.js | 9174b7a337b181a6db1f0f20dd03325b6e1cc1c3.json | Fix component lifecycle order for style swap (#19125)
Co-authored-by: Gerald Monaco <gbmonaco@google.com> | test/integration/css-fixtures/transition-react/pages/other.module.css | @@ -0,0 +1,3 @@
+.root {
+ color: red;
+} | true |
Other | vercel | next.js | 9174b7a337b181a6db1f0f20dd03325b6e1cc1c3.json | Fix component lifecycle order for style swap (#19125)
Co-authored-by: Gerald Monaco <gbmonaco@google.com> | test/integration/css/test/index.test.js | @@ -245,6 +245,82 @@ describe('CSS Support', () => {
})
})
+ describe('React Lifecyce Order (dev)', () => {
+ const appDir = join(fixturesDir, 'transition-react')
+ beforeAll(async () => {
+ await remove(join(appDir, '.next'))
+ })
+
+ let appPort
+ let app
+ beforeAll(async () => {
+ ... | true |
Other | vercel | next.js | 9174b7a337b181a6db1f0f20dd03325b6e1cc1c3.json | Fix component lifecycle order for style swap (#19125)
Co-authored-by: Gerald Monaco <gbmonaco@google.com> | test/integration/size-limit/test/index.test.js | @@ -80,7 +80,7 @@ describe('Production response size', () => {
)
// These numbers are without gzip compression!
- const delta = responseSizesBytes - 282 * 1024
+ const delta = responseSizesBytes - 283 * 1024
expect(delta).toBeLessThanOrEqual(1024) // don't increase size more than 1kb
expect(... | true |
Other | vercel | next.js | c64bbfeacd031a5a09e263b85b0d7f51f36211bf.json | Propose some sentence changes (#19121) | docs/advanced-features/customizing-babel-config.md | @@ -11,9 +11,9 @@ description: Extend the babel preset added by Next.js with your own configs.
</ul>
</details>
-Next.js includes the `next/babel` preset to your app, it includes everything needed to compile React applications and server-side code. But if you want to extend the default Babel configs, it's also po... | false |
Other | vercel | next.js | 04ab35298a23a5c726055a5777a9020937b11fe6.json | Remove preload for priority images (#19118)
Fixes #18720
This removes image preloading. It doesn't work correctly on any browser other than Chrome (with Chrome's real engine). On all other browsers, it triggers 2x the bytes to be downloaded. The tradeoff isn't worth it here IMO.
Chrome itself should be smart enough ... | packages/next/client/image.tsx | @@ -1,5 +1,4 @@
-import React, { ReactElement } from 'react'
-import Head from '../next-server/lib/head'
+import React from 'react'
import { toBase64 } from '../next-server/lib/to-base-64'
import {
ImageConfig,
@@ -160,47 +159,6 @@ function generateSrcSet({
.join(', ')
}
-type PreloadData = {
- src: strin... | true |
Other | vercel | next.js | 04ab35298a23a5c726055a5777a9020937b11fe6.json | Remove preload for priority images (#19118)
Fixes #18720
This removes image preloading. It doesn't work correctly on any browser other than Chrome (with Chrome's real engine). On all other browsers, it triggers 2x the bytes to be downloaded. The tradeoff isn't worth it here IMO.
Chrome itself should be smart enough ... | test/integration/image-component/basic/test/index.test.js | @@ -219,28 +219,28 @@ describe('Image Component Tests', () => {
browser = null
})
runTests()
- it('should add a preload tag for a priority image', async () => {
+ it.skip('should add a preload tag for a priority image', async () => {
expect(
await hasPreloadLinkMatchingUrl(
... | true |
Other | vercel | next.js | 6c282a3df4df178ea121234baa1a7868c0389b82.json | Add note about changing basePath config (#19111) | docs/api-reference/next.config.js/basepath.md | @@ -16,6 +16,8 @@ module.exports = {
}
```
+Note: this value must be set at build time and can not be changed without re-building as the value is inlined in the client-side bundles.
+
## Links
When linking to other pages using `next/link` and `next/router` the `basePath` will be automatically applied. | false |
Other | vercel | next.js | feb0cb497b61946f98bb00520704e09e23209730.json | Add upgrading guide from Next.js 9 to 10 (#19101)
There are no breaking changes but we're seeing some reports of confusion because there's no section for 9 to 10, so this adds it. | docs/upgrading.md | @@ -4,7 +4,17 @@ description: Learn how to upgrade Next.js.
# Upgrade Guide
-## Upgrading from version 8 to 9.0.x
+## Upgrading from version 9 to 10
+
+There were no breaking changes between version 9 and 10.
+
+To upgrade run the following command:
+
+```
+npm install next@latest
+```
+
+## Upgrading from version... | false |
Other | vercel | next.js | 67494bd991c6d74ec795f2b573cfffe1d8826b8d.json | Upgrade use-subscription for React 16/17 bicompat (#19087)
Fixes #18518 | packages/next/package.json | @@ -99,7 +99,7 @@
"stream-browserify": "3.0.0",
"style-loader": "1.2.1",
"styled-jsx": "3.3.1",
- "use-subscription": "1.5.0",
+ "use-subscription": "1.5.1",
"vm-browserify": "1.1.2",
"watchpack": "2.0.0-beta.13",
"webpack": "4.44.1", | true |
Other | vercel | next.js | 67494bd991c6d74ec795f2b573cfffe1d8826b8d.json | Upgrade use-subscription for React 16/17 bicompat (#19087)
Fixes #18518 | yarn.lock | @@ -16312,10 +16312,10 @@ url@^0.11.0:
punycode "1.3.2"
querystring "0.2.0"
-use-subscription@1.5.0:
- version "1.5.0"
- resolved "https://registry.yarnpkg.com/use-subscription/-/use-subscription-1.5.0.tgz#0df66fdf97b9a340147ad72f76fac1db6f56d240"
- integrity sha512-/FVRiB2I7NDjzWoNBYPt6YkkvleMm/lFtxj1hH... | true |
Other | vercel | next.js | 54b70425ab55d3dcd8fb15e08a45d099cfcbde10.json | Ensure i18n with basePath works properly (#19083) | packages/next/build/entries.ts | @@ -85,7 +85,7 @@ export function createEntrypoints(
assetPrefix: config.assetPrefix,
generateEtags: config.generateEtags,
poweredByHeader: config.poweredByHeader,
- canonicalBase: config.canonicalBase,
+ canonicalBase: config.amp.canonicalBase,
basePath: config.basePath,
runtimeConfig: h... | true |
Other | vercel | next.js | 54b70425ab55d3dcd8fb15e08a45d099cfcbde10.json | Ensure i18n with basePath works properly (#19083) | packages/next/build/webpack/loaders/next-serverless-loader.ts | @@ -8,6 +8,7 @@ import {
BUILD_MANIFEST,
REACT_LOADABLE_MANIFEST,
ROUTES_MANIFEST,
+ TEMPORARY_REDIRECT_STATUS,
} from '../../../next-server/lib/constants'
import { isDynamicRoute } from '../../../next-server/lib/router/utils'
import { __ApiPreviewProps } from '../../../next-server/server/api-utils'
@@ -36... | true |
Other | vercel | next.js | 54b70425ab55d3dcd8fb15e08a45d099cfcbde10.json | Ensure i18n with basePath works properly (#19083) | packages/next/next-server/lib/router/router.ts | @@ -475,7 +475,8 @@ export default class Router implements BaseRouter {
this.changeState(
'replaceState',
formatWithValidation({ pathname: addBasePath(pathname), query }),
- getURL()
+ getURL(),
+ { locale }
)
}
@@ -621,7 +622,7 @@ export defau... | true |
Other | vercel | next.js | 54b70425ab55d3dcd8fb15e08a45d099cfcbde10.json | Ensure i18n with basePath works properly (#19083) | packages/next/next-server/server/next-server.ts | @@ -315,9 +315,11 @@ export default class Server {
req.url = req.url!.replace(basePath, '') || '/'
}
- if (i18n && !parsedUrl.pathname?.startsWith('/_next')) {
+ if (i18n && !req.url?.startsWith('/_next')) {
// get pathname from URL with basePath stripped for locale detection
- const { p... | true |
Other | vercel | next.js | 54b70425ab55d3dcd8fb15e08a45d099cfcbde10.json | Ensure i18n with basePath works properly (#19083) | packages/next/next-server/server/router.ts | @@ -183,9 +183,17 @@ export default class Router {
(req as any).__nextStrippedLocale &&
parsedUrl.query.__nextLocale
) {
+ if (keepBasePath) {
+ currentPathname = replaceBasePath(this.basePath, currentPathname!)
+ }
+
currentPathname = `/${parsedUrl.query.__nextL... | true |
Other | vercel | next.js | 54b70425ab55d3dcd8fb15e08a45d099cfcbde10.json | Ensure i18n with basePath works properly (#19083) | test/integration/build-output/test/index.test.js | @@ -101,7 +101,7 @@ describe('Build Output', () => {
expect(parseFloat(err404Size) - 3.6).toBeLessThanOrEqual(0)
expect(err404Size.endsWith('kB')).toBe(true)
- expect(parseFloat(err404FirstLoad) - 64.9).toBeLessThanOrEqual(0)
+ expect(parseFloat(err404FirstLoad) - 65).toBeLessThanOrEqual(0)
... | true |
Other | vercel | next.js | 54b70425ab55d3dcd8fb15e08a45d099cfcbde10.json | Ensure i18n with basePath works properly (#19083) | test/integration/i18n-support-base-path/next.config.js | @@ -0,0 +1,91 @@
+module.exports = {
+ // target: 'experimental-serverless-trace',
+ // basePath: '/docs',
+ i18n: {
+ // localeDetection: false,
+ locales: ['nl-NL', 'nl-BE', 'nl', 'fr-BE', 'fr', 'en-US', 'en'],
+ defaultLocale: 'en-US',
+ domains: [
+ {
+ // used for testing, this should no... | true |
Other | vercel | next.js | 54b70425ab55d3dcd8fb15e08a45d099cfcbde10.json | Ensure i18n with basePath works properly (#19083) | test/integration/i18n-support-base-path/pages/404.js | @@ -0,0 +1,19 @@
+export default function NotFound(props) {
+ return (
+ <>
+ <h1 id="not-found">This page could not be found | 404</h1>
+ <p id="props">{JSON.stringify(props)}</p>
+ </>
+ )
+}
+
+export const getStaticProps = ({ locale, locales, defaultLocale }) => {
+ return {
+ props: {
+ ... | true |
Other | vercel | next.js | 54b70425ab55d3dcd8fb15e08a45d099cfcbde10.json | Ensure i18n with basePath works properly (#19083) | test/integration/i18n-support-base-path/pages/_app.js | @@ -0,0 +1,19 @@
+if (typeof window !== 'undefined') {
+ window.caughtWarns = []
+
+ const origWarn = window.console.warn
+ const origError = window.console.error
+
+ window.console.warn = function (...args) {
+ window.caughtWarns.push(args.join(' '))
+ origWarn(...args)
+ }
+ window.console.error = functio... | true |
Other | vercel | next.js | 54b70425ab55d3dcd8fb15e08a45d099cfcbde10.json | Ensure i18n with basePath works properly (#19083) | test/integration/i18n-support-base-path/pages/amp/amp-first.js | @@ -0,0 +1,32 @@
+import { useAmp } from 'next/amp'
+import { useRouter } from 'next/router'
+
+export const config = {
+ amp: true,
+}
+
+export default function Page(props) {
+ const router = useRouter()
+
+ return (
+ <>
+ <p id="another">another page</p>
+ <p id="is-amp">{useAmp() ? 'yes' : 'no'}</p... | true |
Other | vercel | next.js | 54b70425ab55d3dcd8fb15e08a45d099cfcbde10.json | Ensure i18n with basePath works properly (#19083) | test/integration/i18n-support-base-path/pages/amp/amp-hybrid.js | @@ -0,0 +1,23 @@
+import { useAmp } from 'next/amp'
+import { useRouter } from 'next/router'
+
+export const config = {
+ amp: 'hybrid',
+}
+
+export default function Page(props) {
+ const router = useRouter()
+
+ return (
+ <>
+ <p id="another">another page</p>
+ <p id="is-amp">{useAmp() ? 'yes' : 'no'... | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.