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 | ce830af202be415e943876d74a743ceaec6549ce.json | chore(create-next-app): add missing types (#12691) | packages/create-next-app/helpers/examples.ts | @@ -47,7 +47,12 @@ export async function getRepoInfo(
}
}
-export function hasRepo({ username, name, branch, filePath }: RepoInfo) {
+export function hasRepo({
+ username,
+ name,
+ branch,
+ filePath,
+}: RepoInfo): Promise<boolean> {
const contentsUrl = `https://api.github.com/repos/${username}/${name}/c... | true |
Other | vercel | next.js | ce830af202be415e943876d74a743ceaec6549ce.json | chore(create-next-app): add missing types (#12691) | packages/create-next-app/helpers/install.ts | @@ -5,7 +5,7 @@ export function install(
root: string,
dependencies: string[] | null,
{ useYarn, isOnline }: { useYarn: boolean; isOnline: boolean }
-) {
+): Promise<void> {
return new Promise((resolve, reject) => {
let command: string
let args: string[] | true |
Other | vercel | next.js | ce830af202be415e943876d74a743ceaec6549ce.json | chore(create-next-app): add missing types (#12691) | packages/create-next-app/index.ts | @@ -43,7 +43,7 @@ const program = new Commander.Command(packageJson.name)
.allowUnknownOption()
.parse(process.argv)
-async function run() {
+async function run(): Promise<void> {
if (typeof projectPath === 'string') {
projectPath = projectPath.trim()
}
@@ -177,7 +177,7 @@ async function run() {
c... | true |
Other | vercel | next.js | cf0b1d9472af83dea48fcebd8b7125c5a2d71d8f.json | chore(create-next-app): add missing return types on helpers (#12616)
Co-authored-by: Tim Neutkens <tim@timneutkens.nl> | packages/create-next-app/helpers/examples.ts | @@ -12,7 +12,7 @@ export type RepoInfo = {
filePath: string
}
-export async function isUrlOk(url: string) {
+export async function isUrlOk(url: string): Promise<boolean> {
const res = await got(url).catch(e => e)
return res.statusCode === 200
} | true |
Other | vercel | next.js | cf0b1d9472af83dea48fcebd8b7125c5a2d71d8f.json | chore(create-next-app): add missing return types on helpers (#12616)
Co-authored-by: Tim Neutkens <tim@timneutkens.nl> | packages/create-next-app/helpers/git.ts | @@ -2,23 +2,23 @@ import { execSync } from 'child_process'
import path from 'path'
import rimraf from 'rimraf'
-function isInGitRepository() {
+function isInGitRepository(): boolean {
try {
execSync('git rev-parse --is-inside-work-tree', { stdio: 'ignore' })
return true
} catch (_) {}
return fals... | true |
Other | vercel | next.js | cf0b1d9472af83dea48fcebd8b7125c5a2d71d8f.json | chore(create-next-app): add missing return types on helpers (#12616)
Co-authored-by: Tim Neutkens <tim@timneutkens.nl> | packages/create-next-app/helpers/is-folder-empty.ts | @@ -2,7 +2,7 @@ import chalk from 'chalk'
import fs from 'fs'
import path from 'path'
-export function isFolderEmpty(root: string, name: string) {
+export function isFolderEmpty(root: string, name: string): boolean {
const validFiles = [
'.DS_Store',
'.git', | true |
Other | vercel | next.js | cf0b1d9472af83dea48fcebd8b7125c5a2d71d8f.json | chore(create-next-app): add missing return types on helpers (#12616)
Co-authored-by: Tim Neutkens <tim@timneutkens.nl> | packages/create-next-app/helpers/should-use-yarn.ts | @@ -1,6 +1,6 @@
import { execSync } from 'child_process'
-export function shouldUseYarn() {
+export function shouldUseYarn(): boolean {
try {
const userAgent = process.env.npm_config_user_agent
if (userAgent) { | true |
Other | vercel | next.js | be02fe183f8ca8fa2b96d7a50c63b648ba031313.json | Allow `@babel/preset-typescript` to be configured (#11840)
* Allow `@babel/preset-typescript` to be configured
Some usages, e.g. [getting parameter decorators to work properly](https://github.com/WarnerHooh/babel-plugin-parameter-decorator/pull/19), require configuring `@babel/preset-typescript`.
This commit add... | .prettierignore | @@ -7,4 +7,7 @@ packages/react-refresh-utils/**/*.js
packages/react-refresh-utils/**/*.d.ts
packages/react-dev-overlay/lib/**
**/__tmp__/**
+# prettier can't handle the `import type {} from ''` syntax yet
+test/integration/typescript-only-remove-type-imports/**/*.ts
+test/integration/typescript-only-remove-type-impo... | true |
Other | vercel | next.js | be02fe183f8ca8fa2b96d7a50c63b648ba031313.json | Allow `@babel/preset-typescript` to be configured (#11840)
* Allow `@babel/preset-typescript` to be configured
Some usages, e.g. [getting parameter decorators to work properly](https://github.com/WarnerHooh/babel-plugin-parameter-decorator/pull/19), require configuring `@babel/preset-typescript`.
This commit add... | .prettierignore_staged | @@ -2,4 +2,7 @@
**/_next/**
**/dist/**
packages/next/compiled/**/*
+# prettier can't handle the `import type {} from ''` syntax yet
+test/integration/typescript-only-remove-type-imports/**/*.ts
+test/integration/typescript-only-remove-type-imports/**/*.tsx
lerna.json | true |
Other | vercel | next.js | be02fe183f8ca8fa2b96d7a50c63b648ba031313.json | Allow `@babel/preset-typescript` to be configured (#11840)
* Allow `@babel/preset-typescript` to be configured
Some usages, e.g. [getting parameter decorators to work properly](https://github.com/WarnerHooh/babel-plugin-parameter-decorator/pull/19), require configuring `@babel/preset-typescript`.
This commit add... | package.json | @@ -104,7 +104,7 @@
"tailwindcss": "1.1.3",
"taskr": "1.1.0",
"tree-kill": "1.2.1",
- "typescript": "3.7.3",
+ "typescript": "3.8.3",
"wait-port": "0.2.2",
"webpack-bundle-analyzer": "3.6.1"
}, | true |
Other | vercel | next.js | be02fe183f8ca8fa2b96d7a50c63b648ba031313.json | Allow `@babel/preset-typescript` to be configured (#11840)
* Allow `@babel/preset-typescript` to be configured
Some usages, e.g. [getting parameter decorators to work properly](https://github.com/WarnerHooh/babel-plugin-parameter-decorator/pull/19), require configuring `@babel/preset-typescript`.
This commit add... | packages/create-next-app/package.json | @@ -42,7 +42,7 @@
"prompts": "2.1.0",
"rimraf": "3.0.0",
"tar": "4.4.10",
- "typescript": "3.7.3",
+ "typescript": "3.8.3",
"update-check": "1.5.4",
"validate-npm-package-name": "3.0.0"
} | true |
Other | vercel | next.js | be02fe183f8ca8fa2b96d7a50c63b648ba031313.json | Allow `@babel/preset-typescript` to be configured (#11840)
* Allow `@babel/preset-typescript` to be configured
Some usages, e.g. [getting parameter decorators to work properly](https://github.com/WarnerHooh/babel-plugin-parameter-decorator/pull/19), require configuring `@babel/preset-typescript`.
This commit add... | packages/next/build/babel/preset.ts | @@ -43,6 +43,7 @@ type NextBabelPresetOptions = {
'transform-runtime'?: any
'experimental-modern-preset'?: PluginItem
'styled-jsx'?: StyledJsxBabelOptions
+ 'preset-typescript'?: any
}
type BabelPreset = {
@@ -116,7 +117,10 @@ module.exports = (
...options['preset-react'],
},
],... | true |
Other | vercel | next.js | be02fe183f8ca8fa2b96d7a50c63b648ba031313.json | Allow `@babel/preset-typescript` to be configured (#11840)
* Allow `@babel/preset-typescript` to be configured
Some usages, e.g. [getting parameter decorators to work properly](https://github.com/WarnerHooh/babel-plugin-parameter-decorator/pull/19), require configuring `@babel/preset-typescript`.
This commit add... | packages/next/package.json | @@ -59,21 +59,22 @@
},
"dependencies": {
"@ampproject/toolbox-optimizer": "2.3.1",
- "@babel/core": "7.7.2",
- "@babel/plugin-proposal-class-properties": "7.7.0",
- "@babel/plugin-proposal-nullish-coalescing-operator": "7.7.4",
+ "@babel/core": "7.9.0",
+ "@babel/plugin-proposal-class-properti... | true |
Other | vercel | next.js | be02fe183f8ca8fa2b96d7a50c63b648ba031313.json | Allow `@babel/preset-typescript` to be configured (#11840)
* Allow `@babel/preset-typescript` to be configured
Some usages, e.g. [getting parameter decorators to work properly](https://github.com/WarnerHooh/babel-plugin-parameter-decorator/pull/19), require configuring `@babel/preset-typescript`.
This commit add... | 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 - 258 * 1024
+ const delta = responseSizesBytes - 262 * 1024
expect(delta).toBeLessThanOrEqual(1024) // don't increase size more than 1kb
expect(... | true |
Other | vercel | next.js | be02fe183f8ca8fa2b96d7a50c63b648ba031313.json | Allow `@babel/preset-typescript` to be configured (#11840)
* Allow `@babel/preset-typescript` to be configured
Some usages, e.g. [getting parameter decorators to work properly](https://github.com/WarnerHooh/babel-plugin-parameter-decorator/pull/19), require configuring `@babel/preset-typescript`.
This commit add... | test/integration/typescript-only-remove-type-imports/.babelrc | @@ -0,0 +1,12 @@
+{
+ "presets": [
+ [
+ "next/babel",
+ {
+ "preset-typescript": {
+ "onlyRemoveTypeImports": false
+ }
+ }
+ ]
+ ]
+} | true |
Other | vercel | next.js | be02fe183f8ca8fa2b96d7a50c63b648ba031313.json | Allow `@babel/preset-typescript` to be configured (#11840)
* Allow `@babel/preset-typescript` to be configured
Some usages, e.g. [getting parameter decorators to work properly](https://github.com/WarnerHooh/babel-plugin-parameter-decorator/pull/19), require configuring `@babel/preset-typescript`.
This commit add... | test/integration/typescript-only-remove-type-imports/User.ts | @@ -0,0 +1,5 @@
+export interface User {
+ id: string
+ username: string
+ email: string
+} | true |
Other | vercel | next.js | be02fe183f8ca8fa2b96d7a50c63b648ba031313.json | Allow `@babel/preset-typescript` to be configured (#11840)
* Allow `@babel/preset-typescript` to be configured
Some usages, e.g. [getting parameter decorators to work properly](https://github.com/WarnerHooh/babel-plugin-parameter-decorator/pull/19), require configuring `@babel/preset-typescript`.
This commit add... | test/integration/typescript-only-remove-type-imports/UserStatistics.ts | @@ -0,0 +1,5 @@
+import type { User } from "./User";
+
+export function getNewsletterRecipients(users: User[]) {
+ return users.map(u => u.email);
+}
\ No newline at end of file | true |
Other | vercel | next.js | be02fe183f8ca8fa2b96d7a50c63b648ba031313.json | Allow `@babel/preset-typescript` to be configured (#11840)
* Allow `@babel/preset-typescript` to be configured
Some usages, e.g. [getting parameter decorators to work properly](https://github.com/WarnerHooh/babel-plugin-parameter-decorator/pull/19), require configuring `@babel/preset-typescript`.
This commit add... | test/integration/typescript-only-remove-type-imports/pages/index.tsx | @@ -0,0 +1,30 @@
+import type { User } from "../User";
+// eslint-disable-next-line
+import * as UnusedUserStatisticsThatShouldNotBeElided from "../UserStatistics";
+
+const users: User[] = [
+ {
+ id: "a",
+ email: "a@a.de",
+ username: "anton"
+ },
+ {
+ id: "b",
+ email: "b@b.de",
+ username: "b... | true |
Other | vercel | next.js | be02fe183f8ca8fa2b96d7a50c63b648ba031313.json | Allow `@babel/preset-typescript` to be configured (#11840)
* Allow `@babel/preset-typescript` to be configured
Some usages, e.g. [getting parameter decorators to work properly](https://github.com/WarnerHooh/babel-plugin-parameter-decorator/pull/19), require configuring `@babel/preset-typescript`.
This commit add... | test/integration/typescript-only-remove-type-imports/pages/normal.tsx | @@ -0,0 +1 @@
+export default () => "A normal one"
\ No newline at end of file | true |
Other | vercel | next.js | be02fe183f8ca8fa2b96d7a50c63b648ba031313.json | Allow `@babel/preset-typescript` to be configured (#11840)
* Allow `@babel/preset-typescript` to be configured
Some usages, e.g. [getting parameter decorators to work properly](https://github.com/WarnerHooh/babel-plugin-parameter-decorator/pull/19), require configuring `@babel/preset-typescript`.
This commit add... | test/integration/typescript-only-remove-type-imports/test/index.test.js | @@ -0,0 +1,54 @@
+/* eslint-env jest */
+/* global jasmine */
+import { join } from 'path'
+import {
+ nextBuild,
+ nextStart,
+ findPort,
+ killApp,
+ launchApp,
+ renderViaHTTP,
+} from 'next-test-utils'
+
+jasmine.DEFAULT_TIMEOUT_INTERVAL = 1000 * 60 * 2
+
+const appDir = join(__dirname, '../')
+let app
+let a... | true |
Other | vercel | next.js | be02fe183f8ca8fa2b96d7a50c63b648ba031313.json | Allow `@babel/preset-typescript` to be configured (#11840)
* Allow `@babel/preset-typescript` to be configured
Some usages, e.g. [getting parameter decorators to work properly](https://github.com/WarnerHooh/babel-plugin-parameter-decorator/pull/19), require configuring `@babel/preset-typescript`.
This commit add... | test/integration/typescript-only-remove-type-imports/tsconfig.json | @@ -0,0 +1,19 @@
+{
+ "compilerOptions": {
+ "esModuleInterop": true,
+ "module": "esnext",
+ "jsx": "preserve",
+ "target": "es5",
+ "lib": ["dom", "dom.iterable", "esnext"],
+ "allowJs": true,
+ "skipLibCheck": true,
+ "strict": true,
+ "forceConsistentCasingInFileNames": true,
+ "noEmi... | true |
Other | vercel | next.js | be02fe183f8ca8fa2b96d7a50c63b648ba031313.json | Allow `@babel/preset-typescript` to be configured (#11840)
* Allow `@babel/preset-typescript` to be configured
Some usages, e.g. [getting parameter decorators to work properly](https://github.com/WarnerHooh/babel-plugin-parameter-decorator/pull/19), require configuring `@babel/preset-typescript`.
This commit add... | test/unit/next-babel.test.js | @@ -13,9 +13,9 @@ process.env.NODE_ENV = 'production'
const preset = require('next/dist/build/babel/preset')
process.env.NODE_ENV = NODE_ENV
-const babel = (code, esm = false, presetOptions = {}) =>
+const babel = (code, esm = false, presetOptions = {}, filename = 'noop.js') =>
transform(code, {
- filename: '... | true |
Other | vercel | next.js | be02fe183f8ca8fa2b96d7a50c63b648ba031313.json | Allow `@babel/preset-typescript` to be configured (#11840)
* Allow `@babel/preset-typescript` to be configured
Some usages, e.g. [getting parameter decorators to work properly](https://github.com/WarnerHooh/babel-plugin-parameter-decorator/pull/19), require configuring `@babel/preset-typescript`.
This commit add... | yarn.lock | @@ -45,28 +45,39 @@
dependencies:
cross-fetch "3.0.4"
-"@babel/code-frame@7.8.3", "@babel/code-frame@^7.0.0", "@babel/code-frame@^7.5.5", "@babel/code-frame@^7.8.3":
+"@babel/code-frame@7.8.3", "@babel/code-frame@^7.0.0", "@babel/code-frame@^7.8.3":
version "7.8.3"
resolved "https://registry.yarnpkg.com... | true |
Other | vercel | next.js | 83b4fd150910917d4f91d8f743df0cc4d3ca5696.json | Fix linting of markdown documentation | docs/basic-features/data-fetching.md | @@ -192,7 +192,7 @@ export async function getStaticPaths() {
// Get the paths we want to pre-render based on posts
const paths = posts.map(post => ({
- params: {id: post.id}
+ params: { id: post.id },
}))
// We'll pre-render only these paths at build time. | false |
Other | vercel | next.js | b13892e0070993e4d014a70f6b424302fe583635.json | Add TypeScript docs for SSG (#10865)
* Add TypeScript docs
* Fix types | docs/api-reference/data-fetching/getInitialProps.md | @@ -4,6 +4,14 @@ description: Enable Server-Side Rendering in a page and do initial data populati
# getInitialProps
+## Recommended: Use `getStaticProps` or `getServerSideProps` instead
+
+If you're using Next.js 9.3 or newer, you should use `getStaticProps` or `getServerSideProps` instead of `getInitialProps`.
+
... | true |
Other | vercel | next.js | b13892e0070993e4d014a70f6b424302fe583635.json | Add TypeScript docs for SSG (#10865)
* Add TypeScript docs
* Fix types | docs/basic-features/data-fetching.md | @@ -82,6 +82,18 @@ You should use `getStaticProps` if:
- The data can be publicly cached (not user-specific).
- The page must be pre-rendered (for SEO) and be very fast — `getStaticProps` generates HTML and JSON files, both of which can be cached by a CDN for performance.
+### TypeScript: Use `GetStaticProps`
+
+Fo... | true |
Other | vercel | next.js | b13892e0070993e4d014a70f6b424302fe583635.json | Add TypeScript docs for SSG (#10865)
* Add TypeScript docs
* Fix types | docs/basic-features/typescript.md | @@ -47,52 +47,28 @@ By default, Next.js reports TypeScript errors during development for pages you a
If you want to silence the error reports, refer to the documentation for [Ignoring TypeScript errors](/docs/api-reference/next.config.js/ignoring-typescript-errors.md).
-## Pages
+## Static Generation and Server-si... | true |
Other | vercel | next.js | 0ff0973edb2f604ea166df7b12ec5adc5616add9.json | Preview mode documentation (#10863)
* Add preview mode file
* Update descriptions for data fetching
* Add preview mode documentation
* Use quotes for front matter
* Wordsmith
* Fix URL
* Minor updates
Co-authored-by: Tim Neutkens <timneutkens@me.com> | docs/advanced-features/preview-mode.md | @@ -0,0 +1,216 @@
+---
+description: Next.js has the preview mode for statically generated pages. You can learn how it works here.
+---
+
+# Preview Mode
+
+> This document is for Next.js versions 9.3 and up. If you’re using older versions of Next.js, refer to our [previous documentation](https://nextjs.org/docs/tag/v9... | true |
Other | vercel | next.js | 0ff0973edb2f604ea166df7b12ec5adc5616add9.json | Preview mode documentation (#10863)
* Add preview mode file
* Update descriptions for data fetching
* Add preview mode documentation
* Use quotes for front matter
* Wordsmith
* Fix URL
* Minor updates
Co-authored-by: Tim Neutkens <timneutkens@me.com> | docs/basic-features/data-fetching.md | @@ -1,5 +1,5 @@
---
-description: Next.js can handle data fetching in multiple ways for server-rendered and static pages. Learn how it works here.
+description: 'Next.js has 2 pre-rendering modes: Static Generation and Server-side rendering. Learn how they work here.'
---
# Data fetching
@@ -30,7 +30,9 @@ export a... | true |
Other | vercel | next.js | 0ff0973edb2f604ea166df7b12ec5adc5616add9.json | Preview mode documentation (#10863)
* Add preview mode file
* Update descriptions for data fetching
* Add preview mode documentation
* Use quotes for front matter
* Wordsmith
* Fix URL
* Minor updates
Co-authored-by: Tim Neutkens <timneutkens@me.com> | docs/basic-features/pages.md | @@ -253,6 +253,13 @@ We recommend you to read the following sections next:
</a>
</div>
+<div class="card">
+ <a href="/docs/advanced-features/preview-mode.md">
+ <b>Preview Mode:</b>
+ <small>Learn more about the preview mode in Next.js.</small>
+ </a>
+</div>
+
<div class="card">
<a href="/docs/routi... | true |
Other | vercel | next.js | 0ff0973edb2f604ea166df7b12ec5adc5616add9.json | Preview mode documentation (#10863)
* Add preview mode file
* Update descriptions for data fetching
* Add preview mode documentation
* Use quotes for front matter
* Wordsmith
* Fix URL
* Minor updates
Co-authored-by: Tim Neutkens <timneutkens@me.com> | docs/manifest.json | @@ -80,6 +80,10 @@
{
"title": "Advanced Features",
"routes": [
+ {
+ "title": "Preview Mode",
+ "path": "/docs/advanced-features/preview-mode.md"
+ },
{
"title": "Dynamic Import",
"path": "/docs/adv... | true |
Other | vercel | next.js | f1d0e577e6a29a14caba521afa11396fc3bf46f9.json | Add Test Case for SSG Full Re-Export (#10864) | test/unit/babel-plugin-next-ssg-transform.test.js | @@ -429,5 +429,15 @@ describe('babel plugin (next-ssg-transform)', () => {
`"class El extends React.Component{render(){return __jsx(\\"div\\",null);}}const a=5;export var __N_SSG=true;export{El as default,a};"`
)
})
+
+ it('should support full re-export', () => {
+ const output = babel(trim... | false |
Other | vercel | next.js | 1a9b49bf476e3aa63ebd3122df47126ba636d04d.json | Fix Prerender Test Cases (#10861)
* Fix Prerender Test Cases
* fix test | test/integration/prerender/pages/index.js | @@ -33,7 +33,7 @@ const Page = ({ world, time }) => {
<Link href="/blog/[post]" as="/blog/post-100">
<a id="broken-post">to broken</a>
</Link>
- <Link href="/blog/[post]" as="/blog/post-999">
+ <Link href="/blog/[post]" as="/blog/post-999" prefetch={false}>
<a id="broken-at-fir... | true |
Other | vercel | next.js | 1a9b49bf476e3aa63ebd3122df47126ba636d04d.json | Fix Prerender Test Cases (#10861)
* Fix Prerender Test Cases
* fix test | test/integration/prerender/test/index.test.js | @@ -377,21 +377,21 @@ const runTests = (dev = false, looseMode = false) => {
it('should reload page on failed data request', async () => {
const browser = await webdriver(appPort, '/')
- await browser.eval('window.beforeClick = true')
+ await browser.eval('window.beforeClick = "abc"')
await browser... | true |
Other | vercel | next.js | 744b50d5d45c8c59ecc01b5e3f722d0301898e8c.json | add example for why-did-you-render (#10662)
* add example for why-did-you-render
* Load whyDidYouRender from _app.js
To avoid custom webpack main entry modifications
as this can cause [hydration errors](https://github.com/zeit/next.js/pull/10662#pullrequestreview-365188433) | examples/with-why-did-you-render/README.md | @@ -0,0 +1,45 @@
+# Why did you render
+
+This is a simple example of getting [why-did-you-render](https://github.com/welldone-software/why-did-you-render) up and running.
+The header component will rerender despite the state staying the same. You can see details in developer console.
+
+## Deploy your own
+
+Deploy th... | true |
Other | vercel | next.js | 744b50d5d45c8c59ecc01b5e3f722d0301898e8c.json | add example for why-did-you-render (#10662)
* add example for why-did-you-render
* Load whyDidYouRender from _app.js
To avoid custom webpack main entry modifications
as this can cause [hydration errors](https://github.com/zeit/next.js/pull/10662#pullrequestreview-365188433) | examples/with-why-did-you-render/components/header.js | @@ -0,0 +1,19 @@
+import React, { useState, useEffect } from 'react'
+
+const Header = () => {
+ const [objState, setObjState] = useState({ name: 'World' })
+
+ useEffect(() => {
+ setObjState({ name: 'World' })
+ }, [])
+
+ return (
+ <header>
+ <h1>Hello {objState.name} !</h1>
+ </header>
+ )
+}
+
... | true |
Other | vercel | next.js | 744b50d5d45c8c59ecc01b5e3f722d0301898e8c.json | add example for why-did-you-render (#10662)
* add example for why-did-you-render
* Load whyDidYouRender from _app.js
To avoid custom webpack main entry modifications
as this can cause [hydration errors](https://github.com/zeit/next.js/pull/10662#pullrequestreview-365188433) | examples/with-why-did-you-render/package.json | @@ -0,0 +1,15 @@
+{
+ "name": "why-did-you-render",
+ "scripts": {
+ "dev": "next",
+ "build": "next build",
+ "start": "next start"
+ },
+ "dependencies": {
+ "@welldone-software/why-did-you-render": "^4.0.4",
+ "next": "latest",
+ "react": "^16.7.0",
+ "react-dom": "^16.7.0"
+ },
+ "license... | true |
Other | vercel | next.js | 744b50d5d45c8c59ecc01b5e3f722d0301898e8c.json | add example for why-did-you-render (#10662)
* add example for why-did-you-render
* Load whyDidYouRender from _app.js
To avoid custom webpack main entry modifications
as this can cause [hydration errors](https://github.com/zeit/next.js/pull/10662#pullrequestreview-365188433) | examples/with-why-did-you-render/pages/_app.js | @@ -0,0 +1,8 @@
+import React from 'react'
+import whyDidYouRender from '@welldone-software/why-did-you-render'
+
+if (typeof window !== 'undefined' && process.env.NODE_ENV === 'development') {
+ whyDidYouRender(React)
+}
+
+export default ({ Component, pageProps }) => <Component {...pageProps} /> | true |
Other | vercel | next.js | 744b50d5d45c8c59ecc01b5e3f722d0301898e8c.json | add example for why-did-you-render (#10662)
* add example for why-did-you-render
* Load whyDidYouRender from _app.js
To avoid custom webpack main entry modifications
as this can cause [hydration errors](https://github.com/zeit/next.js/pull/10662#pullrequestreview-365188433) | examples/with-why-did-you-render/pages/index.js | @@ -0,0 +1,7 @@
+import Header from '../components/header.js'
+
+export default () => (
+ <div>
+ <Header />
+ </div>
+) | true |
Other | vercel | next.js | a61dfb22a14abbff524c5598bd8569f28db644c4.json | Fix data fetching learn more links | docs/basic-features/data-fetching.md | @@ -380,15 +380,15 @@ function Profile() {
We recommend you to read the following sections next:
-<div class=“card”>
- <a href=“/docs/routing/introduction.md”>
+<div class="card">
+ <a href="/docs/routing/introduction.md">
<b>Routing:</b>
<small>Learn more about routing in Next.js.</small>
</a>
</d... | false |
Other | vercel | next.js | 1e505e860f43f8f57eff01d297e3c0fe2db76119.json | Ensure an accessible default viewport meta tag (#10823)
* fix: remove minimum-scale from default viewport
* update test
* remove extra comma
* drop initial-scale | packages/next/next-server/lib/head.tsx | @@ -11,12 +11,7 @@ type WithInAmpMode = {
export function defaultHead(inAmpMode = false) {
const head = [<meta charSet="utf-8" />]
if (!inAmpMode) {
- head.push(
- <meta
- name="viewport"
- content="width=device-width,minimum-scale=1,initial-scale=1"
- />
- )
+ head.push(<meta na... | true |
Other | vercel | next.js | 1e505e860f43f8f57eff01d297e3c0fe2db76119.json | Ensure an accessible default viewport meta tag (#10823)
* fix: remove minimum-scale from default viewport
* update test
* remove extra comma
* drop initial-scale | test/integration/client-navigation/test/rendering.js | @@ -52,7 +52,7 @@ export default function(render, fetch) {
test('header renders default viewport', async () => {
const html = await render('/default-head')
expect(html).toContain(
- '<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1"/>'
+ '<meta name="vie... | true |
Other | vercel | next.js | a4eef95056405c48d65fc61b65081cd7855edd0c.json | Add docs for static 404 and pages/404 (#10811)
* Add docs for static 404 and pages/404
* Remove new from docs
* Apply suggestions from code review
Co-Authored-By: Shu Uesugi <shu@chibicode.com>
* Rework using suggestions from review
* Apply suggestions from code review
Co-Authored-By: Shu Uesugi <shu... | docs/advanced-features/custom-error-page.md | @@ -2,9 +2,30 @@
description: Override and extend the built-in Error page to handle custom errors.
---
-# Custom Error Page
+## 404 Page
-**404** or **500** errors are handled both client-side and server-side by the `Error` component. If you wish to override it, define the file `pages/_error.js` and add the follo... | false |
Other | vercel | next.js | 50c95d16b49631d5eaffc376c61f9d778def2079.json | Send Credentials for `getServerSideProps` Requests (#10826)
* Send Credentials for `getServerSideProps` Requests
* Fix tests | packages/next/next-server/lib/router/router.ts | @@ -83,7 +83,21 @@ function fetchNextData(
// @ts-ignore __NEXT_DATA__
pathname: `/_next/data/${__NEXT_DATA__.buildId}${pathname}.json`,
query,
- })
+ }),
+ {
+ // Cookies are required to be present for Next.js' SSG "Preview Mode".
+ // Cookies may also be require... | true |
Other | vercel | next.js | 50c95d16b49631d5eaffc376c61f9d778def2079.json | Send Credentials for `getServerSideProps` Requests (#10826)
* Send Credentials for `getServerSideProps` Requests
* Fix tests | test/integration/getserversideprops-preview/pages/to-index.js | @@ -0,0 +1,15 @@
+import Link from 'next/link'
+
+export function getServerSideProps() {
+ return { props: {} }
+}
+
+export default function() {
+ return (
+ <main>
+ <Link href="/">
+ <a id="to-index">To Index</a>
+ </Link>
+ </main>
+ )
+} | true |
Other | vercel | next.js | 50c95d16b49631d5eaffc376c61f9d778def2079.json | Send Credentials for `getServerSideProps` Requests (#10826)
* Send Credentials for `getServerSideProps` Requests
* Fix tests | test/integration/getserversideprops-preview/test/index.test.js | @@ -165,7 +165,7 @@ function runTests(startServer = nextStart) {
)
})
- it('should fetch preview data', async () => {
+ it('should fetch preview data on SSR', async () => {
await browser.get(`http://localhost:${appPort}/`)
await browser.waitForElementByCss('#props-pre')
// expect(await browse... | true |
Other | vercel | next.js | 50c95d16b49631d5eaffc376c61f9d778def2079.json | Send Credentials for `getServerSideProps` Requests (#10826)
* Send Credentials for `getServerSideProps` Requests
* Fix tests | test/integration/prerender-preview/pages/to-index.js | @@ -0,0 +1,15 @@
+import Link from 'next/link'
+
+export function getStaticProps() {
+ return { props: {} }
+}
+
+export default function() {
+ return (
+ <main>
+ <Link href="/">
+ <a id="to-index">To Index</a>
+ </Link>
+ </main>
+ )
+} | true |
Other | vercel | next.js | 50c95d16b49631d5eaffc376c61f9d778def2079.json | Send Credentials for `getServerSideProps` Requests (#10826)
* Send Credentials for `getServerSideProps` Requests
* Fix tests | test/integration/prerender-preview/test/index.test.js | @@ -165,7 +165,7 @@ function runTests(startServer = nextStart) {
)
})
- it('should fetch preview data', async () => {
+ it('should fetch preview data on SSR', async () => {
await browser.get(`http://localhost:${appPort}/`)
await browser.waitForElementByCss('#props-pre')
// expect(await browse... | true |
Other | vercel | next.js | 4ef1cd4ebe574700baafbd603d940fc2467818cb.json | Add identifier to NEXT_DATA for gs(s)p (#10812)
* Add identifier to NEXT_DATA for gs(s)p
* Apply suggestions from code review
Co-Authored-By: Joe Haddad <joe.haddad@zeit.co>
* fix lint
* apply lint fix
Co-authored-by: Joe Haddad <timer150@gmail.com> | packages/next/next-server/lib/utils.ts | @@ -78,6 +78,8 @@ export type NEXT_DATA = {
isFallback?: boolean
dynamicIds?: string[]
err?: Error & { statusCode?: number }
+ gsp?: boolean
+ gssp?: boolean
}
/** | true |
Other | vercel | next.js | 4ef1cd4ebe574700baafbd603d940fc2467818cb.json | Add identifier to NEXT_DATA for gs(s)p (#10812)
* Add identifier to NEXT_DATA for gs(s)p
* Apply suggestions from code review
Co-Authored-By: Joe Haddad <joe.haddad@zeit.co>
* fix lint
* apply lint fix
Co-authored-by: Joe Haddad <timer150@gmail.com> | packages/next/next-server/server/render.tsx | @@ -181,6 +181,8 @@ function renderDocument(
htmlProps,
bodyTags,
headTags,
+ gsp,
+ gssp,
}: RenderOpts & {
props: any
docProps: DocumentInitialProps
@@ -201,6 +203,8 @@ function renderDocument(
bodyTags: any
headTags: any
isFallback?: boolean
+ gsp?: boolean
+ gs... | true |
Other | vercel | next.js | 4ef1cd4ebe574700baafbd603d940fc2467818cb.json | Add identifier to NEXT_DATA for gs(s)p (#10812)
* Add identifier to NEXT_DATA for gs(s)p
* Apply suggestions from code review
Co-Authored-By: Joe Haddad <joe.haddad@zeit.co>
* fix lint
* apply lint fix
Co-authored-by: Joe Haddad <timer150@gmail.com> | test/integration/getserversideprops/test/index.test.js | @@ -191,6 +191,18 @@ const runTests = (dev = false) => {
expect(html).toMatch(/Post:.*?post-1/)
})
+ it('should have gssp in __NEXT_DATA__', async () => {
+ const html = await renderViaHTTP(appPort, '/')
+ const $ = cheerio.load(html)
+ expect(JSON.parse($('#__NEXT_DATA__').text()).gssp).toBe(true)
... | true |
Other | vercel | next.js | 4ef1cd4ebe574700baafbd603d940fc2467818cb.json | Add identifier to NEXT_DATA for gs(s)p (#10812)
* Add identifier to NEXT_DATA for gs(s)p
* Apply suggestions from code review
Co-Authored-By: Joe Haddad <joe.haddad@zeit.co>
* fix lint
* apply lint fix
Co-authored-by: Joe Haddad <timer150@gmail.com> | test/integration/prerender/test/index.test.js | @@ -282,6 +282,18 @@ const runTests = (dev = false, looseMode = false) => {
expect(html).toMatch(/Post:.*?post-1/)
})
+ it('should have gsp in __NEXT_DATA__', async () => {
+ const html = await renderViaHTTP(appPort, '/')
+ const $ = cheerio.load(html)
+ expect(JSON.parse($('#__NEXT_DATA__').text())... | true |
Other | vercel | next.js | 3ca022a821e45f826e9907ae151c99ace7e073fc.json | Throw NoFallbackError instead of returning (#10793)
* Throw a NoFallbackError instead of returning
* Replace invariant
Co-authored-by: JJ Kasper <jj@jjsweb.site> | packages/next/next-server/server/next-server.ts | @@ -871,7 +871,7 @@ export default class Server {
pathname: string,
{ components, query }: FindComponentsResult,
opts: RenderOptsPartial
- ): Promise<string | false | null> {
+ ): Promise<string | null> {
// we need to ensure the status code if /404 is visited directly
if (pathname === '/404'... | false |
Other | vercel | next.js | 8f01a4ae83a6ba60ac8fc2049a5ce990970dca0e.json | Fix RenderOpts in `next-server` (#10776)
* Correctly pass preview data
* remove todo
* re-do change
* fix types
* Prevent regression | packages/next/next-server/server/api-utils.ts | @@ -260,6 +260,7 @@ const COOKIE_NAME_PRERENDER_BYPASS = `__prerender_bypass`
const COOKIE_NAME_PRERENDER_DATA = `__next_preview_data`
export const SYMBOL_PREVIEW_DATA = Symbol(COOKIE_NAME_PRERENDER_DATA)
+const SYMBOL_CLEARED_COOKIES = Symbol(COOKIE_NAME_PRERENDER_BYPASS)
export function tryGetPreviewData(
r... | true |
Other | vercel | next.js | 8f01a4ae83a6ba60ac8fc2049a5ce990970dca0e.json | Fix RenderOpts in `next-server` (#10776)
* Correctly pass preview data
* remove todo
* re-do change
* fix types
* Prevent regression | packages/next/next-server/server/next-server.ts | @@ -41,7 +41,7 @@ import pathMatch from './lib/path-match'
import { recursiveReadDirSync } from './lib/recursive-readdir-sync'
import { loadComponents, LoadComponentsReturnType } from './load-components'
import { normalizePagePath } from './normalize-page-path'
-import { renderToHTML } from './render'
+import { Rend... | true |
Other | vercel | next.js | 8f01a4ae83a6ba60ac8fc2049a5ce990970dca0e.json | Fix RenderOpts in `next-server` (#10776)
* Correctly pass preview data
* remove todo
* re-do change
* fix types
* Prevent regression | packages/next/next-server/server/render.tsx | @@ -124,7 +124,7 @@ function render(
return { html, head }
}
-type RenderOpts = LoadComponentsReturnType & {
+export type RenderOptsPartial = {
staticMarkup: boolean
buildId: string
canonicalBase: string
@@ -147,6 +147,8 @@ type RenderOpts = LoadComponentsReturnType & {
previewProps: __ApiPreviewProps... | true |
Other | vercel | next.js | 8f01a4ae83a6ba60ac8fc2049a5ce990970dca0e.json | Fix RenderOpts in `next-server` (#10776)
* Correctly pass preview data
* remove todo
* re-do change
* fix types
* Prevent regression | test/integration/prerender-preview/test/index.test.js | @@ -8,6 +8,7 @@ import {
findPort,
initNextServerScript,
killApp,
+ launchApp,
nextBuild,
nextStart,
renderViaHTTP,
@@ -201,6 +202,66 @@ const startServerlessEmulator = async (dir, port) => {
}
describe('Prerender Preview Mode', () => {
+ describe('Development Mode', () => {
+ beforeAll(async... | true |
Other | vercel | next.js | 644a1ef187dada46cf411141b27813c1cb0219e2.json | examples: react-native-web: fix config to prefer .web.* exts (#10774)
* [examples/with-react-native-web] fix config to get .web.* extensions resolved before other
Simple issue if you have `Compo.js` & `Compo.web.js` (eg 1st for iOS/android & second for web): with current config, .web are resolved after.
My change ... | examples/with-react-native-web/next.config.js | @@ -1,11 +1,16 @@
module.exports = {
- webpack: (config, { defaultLoaders }) => {
+ webpack: config => {
config.resolve.alias = {
...(config.resolve.alias || {}),
// Transform all direct `react-native` imports to `react-native-web`
'react-native$': 'react-native-web',
}
- config.res... | false |
Other | vercel | next.js | 8999ef26604bd0b9e44b02a9408020f0223fd2f3.json | Remove Dead Code from Next Server (#10772)
* Remove Dead Code from Next Server
* remove options
* trigger | packages/next/next-server/server/next-server.ts | @@ -780,7 +780,7 @@ export default class Server {
return this.render404(req, res, parsedUrl)
}
- const html = await this.renderToHTML(req, res, pathname, query, {})
+ const html = await this.renderToHTML(req, res, pathname, query)
// Request was ended by the user
if (html === null) {
... | true |
Other | vercel | next.js | 8999ef26604bd0b9e44b02a9408020f0223fd2f3.json | Remove Dead Code from Next Server (#10772)
* Remove Dead Code from Next Server
* remove options
* trigger | packages/next/server/next-dev-server.ts | @@ -448,8 +448,7 @@ export default class DevServer extends Server {
req: IncomingMessage,
res: ServerResponse,
pathname: string,
- query: { [key: string]: string },
- options = {}
+ query: { [key: string]: string }
) {
const compilationErr = await this.getCompilationError(pathname)
... | true |
Other | vercel | next.js | c52c0389fd2eb554761ced854eb3c833859b6ec4.json | Add params to getStaticProps on err.sh (#10751)
* Add params to getStaticProps
* Update errors/invalid-getstaticprops-value.md
Co-Authored-By: JJ Kasper <jj@jjsweb.site>
Co-authored-by: JJ Kasper <jj@jjsweb.site> | errors/invalid-getstaticprops-value.md | @@ -9,7 +9,11 @@ In one of the page's `getStaticProps` the return value had the incorrect shape.
Make sure to return the following shape from `getStaticProps`:
```js
-export async function getStaticProps() {
+export async function getStaticProps(ctx: {
+ params?: ParsedUrlQuery
+ preview?: boolean
+ previewData?... | false |
Other | vercel | next.js | e608c86b59e9b504ff879f4b6eb2a4313afc1265.json | Separate Low Priority Files from Main Files (#10756)
* Separate Low Priority Files from Main Files
* Fix tests | packages/next/build/webpack/plugins/build-manifest-plugin.ts | @@ -1,7 +1,6 @@
import devalue from 'devalue'
import { Compiler } from 'webpack'
import { RawSource } from 'webpack-sources'
-
import {
BUILD_MANIFEST,
CLIENT_STATIC_FILES_PATH,
@@ -10,19 +9,12 @@ import {
IS_BUNDLED_PAGE_REGEX,
ROUTE_NAME_REGEX,
} from '../../../next-server/lib/constants'
-
-interface... | true |
Other | vercel | next.js | e608c86b59e9b504ff879f4b6eb2a4313afc1265.json | Separate Low Priority Files from Main Files (#10756)
* Separate Low Priority Files from Main Files
* Fix tests | packages/next/next-server/lib/utils.ts | @@ -153,6 +153,7 @@ export type DocumentProps = DocumentInitialProps & {
hasCssMode: boolean
devFiles: string[]
files: string[]
+ lowPriorityFiles: string[]
polyfillFiles: string[]
dynamicImports: ManifestItem[]
assetPrefix?: string | true |
Other | vercel | next.js | e608c86b59e9b504ff879f4b6eb2a4313afc1265.json | Separate Low Priority Files from Main Files (#10756)
* Separate Low Priority Files from Main Files
* Fix tests | packages/next/next-server/server/get-page-files.ts | @@ -2,7 +2,9 @@ import { normalizePagePath } from './normalize-page-path'
export type BuildManifest = {
devFiles: string[]
+ lowPriorityFiles: string[]
pages: {
+ '/_app': string[]
[page: string]: string[]
}
} | true |
Other | vercel | next.js | e608c86b59e9b504ff879f4b6eb2a4313afc1265.json | Separate Low Priority Files from Main Files (#10756)
* Separate Low Priority Files from Main Files
* Fix tests | packages/next/next-server/server/render.tsx | @@ -174,6 +174,7 @@ function renderDocument(
staticMarkup,
devFiles,
files,
+ lowPriorityFiles,
polyfillFiles,
dynamicImports,
htmlProps,
@@ -191,8 +192,9 @@ function renderDocument(
hybridAmp: boolean
dynamicImportsIds: string[]
dynamicImports: ManifestItem[]
- files:... | true |
Other | vercel | next.js | e608c86b59e9b504ff879f4b6eb2a4313afc1265.json | Separate Low Priority Files from Main Files (#10756)
* Separate Low Priority Files from Main Files
* Fix tests | packages/next/pages/_document.tsx | @@ -44,10 +44,6 @@ function getOptionalModernScriptVariant(path: string) {
return path
}
-function isLowPriority(file: string) {
- return file.includes('_buildManifest')
-}
-
/**
* `Document` component handles the initial `document` markup and renders only on the server side.
* Commonly used for implementin... | true |
Other | vercel | next.js | e608c86b59e9b504ff879f4b6eb2a4313afc1265.json | Separate Low Priority Files from Main Files (#10756)
* Separate Low Priority Files from Main Files
* Fix tests | test/integration/chunking/test/index.test.js | @@ -1,12 +1,12 @@
/* eslint-env jest */
/* global jasmine */
-import { join } from 'path'
+import cheerio from 'cheerio'
import express from 'express'
+import { access, readdir, readFile, unlink } from 'fs-extra'
import http from 'http'
import { nextBuild, nextServer, promiseCall, stopApp } from 'next-test-utils'
... | true |
Other | vercel | next.js | 709aac1e962eb825c7ff7ea52edc4400a29cd3cb.json | Move upgrading guide to /docs (#10727)
* Move UPGRADING.md to docs
* Add upgrading guide to manifest.json
* Update title
* Move to docs/upgrading
* Update UPGRADING.md
* Update docs/manifest.json
* Update UPGRADING.md
Co-authored-by: Tim Neutkens <tim@timneutkens.nl> | UPGRADING.md | @@ -1,213 +1 @@
-# Migrating from v8 to v9
-
-## Preamble
-
-#### Production Deployment on ZEIT Now v2
-
-If you previously configured `routes` in your `now.json` file for dynamic routes, these rules can be removed when leveraging Next.js 9's new [Dynamic Routing feature](https://github.com/zeit/next.js#dynamic-routing... | true |
Other | vercel | next.js | 709aac1e962eb825c7ff7ea52edc4400a29cd3cb.json | Move upgrading guide to /docs (#10727)
* Move UPGRADING.md to docs
* Add upgrading guide to manifest.json
* Update title
* Move to docs/upgrading
* Update UPGRADING.md
* Update docs/manifest.json
* Update UPGRADING.md
Co-authored-by: Tim Neutkens <tim@timneutkens.nl> | docs/manifest.json | @@ -147,6 +147,10 @@
}
]
},
+ {
+ "title": "Upgrade Guide",
+ "path": "/docs/upgrading.md"
+ },
{ "title": "FAQ", "path": "/docs/faq.md" }
]
}, | true |
Other | vercel | next.js | 709aac1e962eb825c7ff7ea52edc4400a29cd3cb.json | Move upgrading guide to /docs (#10727)
* Move UPGRADING.md to docs
* Add upgrading guide to manifest.json
* Update title
* Move to docs/upgrading
* Update UPGRADING.md
* Update docs/manifest.json
* Update UPGRADING.md
Co-authored-by: Tim Neutkens <tim@timneutkens.nl> | docs/upgrading.md | @@ -0,0 +1,219 @@
+---
+description: Learn how to upgrade Next.js.
+---
+
+# Upgrade Guide
+
+## Upgrading from version 8 to 9.0.x
+
+### Preamble
+
+#### Production Deployment on ZEIT Now v2
+
+If you previously configured `routes` in your `now.json` file for dynamic routes, these rules can be removed when leveraging ... | true |
Other | vercel | next.js | b2624012ea52438dee783425e0d6b87d14c0fc9e.json | Remove old eslint-ignores from unstable_ prefix (#10740) | packages/next/export/worker.js | @@ -118,9 +118,7 @@ export default async function({
let curRenderOpts = {}
let renderMethod = renderToHTML
- // eslint-disable-next-line camelcase
const renderedDuringBuild = getStaticProps => {
- // eslint-disable-next-line camelcase
return !buildExport && getStaticProps && !isDynamicRo... | true |
Other | vercel | next.js | b2624012ea52438dee783425e0d6b87d14c0fc9e.json | Remove old eslint-ignores from unstable_ prefix (#10740) | test/integration/client-navigation/pages/nav/url-prop-change.js | @@ -10,7 +10,6 @@ export default class UrlPropChange extends React.Component {
}
}
- // eslint-disable-next-line camelcase
componentDidUpdate(prevProps) {
if (prevProps.url !== this.props.url) {
this.setState(() => { | true |
Other | vercel | next.js | b2624012ea52438dee783425e0d6b87d14c0fc9e.json | Remove old eslint-ignores from unstable_ prefix (#10740) | test/integration/getserversideprops/pages/another/index.js | @@ -2,7 +2,6 @@ import Link from 'next/link'
import fs from 'fs'
import findUp from 'find-up'
-// eslint-disable-next-line camelcase
export async function getServerSideProps() {
const text = fs
.readFileSync( | true |
Other | vercel | next.js | b2624012ea52438dee783425e0d6b87d14c0fc9e.json | Remove old eslint-ignores from unstable_ prefix (#10740) | test/integration/getserversideprops/pages/blog/[post]/[comment].js | @@ -1,7 +1,6 @@
import React from 'react'
import Link from 'next/link'
-// eslint-disable-next-line camelcase
export async function getServerSideProps({ query }) {
return {
props: { | true |
Other | vercel | next.js | b2624012ea52438dee783425e0d6b87d14c0fc9e.json | Remove old eslint-ignores from unstable_ prefix (#10740) | test/integration/getserversideprops/pages/blog/[post]/index.js | @@ -2,7 +2,6 @@ import React from 'react'
import Link from 'next/link'
import { useRouter } from 'next/router'
-// eslint-disable-next-line camelcase
export async function getServerSideProps({ params }) {
if (params.post === 'post-10') {
await new Promise(resolve => { | true |
Other | vercel | next.js | b2624012ea52438dee783425e0d6b87d14c0fc9e.json | Remove old eslint-ignores from unstable_ prefix (#10740) | test/integration/getserversideprops/pages/blog/index.js | @@ -1,7 +1,6 @@
import React from 'react'
import Link from 'next/link'
-// eslint-disable-next-line camelcase
export async function getServerSideProps() {
return {
props: { | true |
Other | vercel | next.js | b2624012ea52438dee783425e0d6b87d14c0fc9e.json | Remove old eslint-ignores from unstable_ prefix (#10740) | test/integration/getserversideprops/pages/catchall/[...path].js | @@ -2,7 +2,6 @@ import React from 'react'
import Link from 'next/link'
import { useRouter } from 'next/router'
-// eslint-disable-next-line camelcase
export async function getServerSideProps({ params }) {
return {
props: { | true |
Other | vercel | next.js | b2624012ea52438dee783425e0d6b87d14c0fc9e.json | Remove old eslint-ignores from unstable_ prefix (#10740) | test/integration/getserversideprops/pages/default-revalidate.js | @@ -1,6 +1,5 @@
import Link from 'next/link'
-// eslint-disable-next-line camelcase
export async function getServerSideProps() {
return {
props: { | true |
Other | vercel | next.js | b2624012ea52438dee783425e0d6b87d14c0fc9e.json | Remove old eslint-ignores from unstable_ prefix (#10740) | test/integration/getserversideprops/pages/index.js | @@ -1,6 +1,5 @@
import Link from 'next/link'
-// eslint-disable-next-line camelcase
export async function getServerSideProps() {
return {
props: { | true |
Other | vercel | next.js | b2624012ea52438dee783425e0d6b87d14c0fc9e.json | Remove old eslint-ignores from unstable_ prefix (#10740) | test/integration/getserversideprops/pages/invalid-keys.js | @@ -2,7 +2,6 @@ import React from 'react'
import Link from 'next/link'
import { useRouter } from 'next/router'
-// eslint-disable-next-line camelcase
export async function getServerSideProps({ params, query }) {
return {
world: 'world', | true |
Other | vercel | next.js | b2624012ea52438dee783425e0d6b87d14c0fc9e.json | Remove old eslint-ignores from unstable_ prefix (#10740) | test/integration/getserversideprops/pages/something.js | @@ -2,7 +2,6 @@ import React from 'react'
import Link from 'next/link'
import { useRouter } from 'next/router'
-// eslint-disable-next-line camelcase
export async function getServerSideProps({ params, query }) {
return {
props: { | true |
Other | vercel | next.js | b2624012ea52438dee783425e0d6b87d14c0fc9e.json | Remove old eslint-ignores from unstable_ prefix (#10740) | test/integration/getserversideprops/pages/user/[user]/profile.js | @@ -1,7 +1,6 @@
import React from 'react'
import Link from 'next/link'
-// eslint-disable-next-line camelcase
export async function getServerSideProps({ query }) {
return {
props: { | true |
Other | vercel | next.js | b2624012ea52438dee783425e0d6b87d14c0fc9e.json | Remove old eslint-ignores from unstable_ prefix (#10740) | test/integration/prerender-invalid-catchall-params/pages/[...slug].js | @@ -1,11 +1,9 @@
import React from 'react'
-// eslint-disable-next-line camelcase
export async function getStaticPaths() {
return { paths: [{ params: { slug: 'hello' } }], fallback: true }
}
-// eslint-disable-next-line camelcase
export async function getStaticProps({ params }) {
return {
props: { | true |
Other | vercel | next.js | b2624012ea52438dee783425e0d6b87d14c0fc9e.json | Remove old eslint-ignores from unstable_ prefix (#10740) | test/integration/prerender-invalid-paths/pages/[foo]/[post].js | @@ -1,11 +1,9 @@
import React from 'react'
-// eslint-disable-next-line camelcase
export async function getStaticPaths() {
return { paths: [{ foo: 'bad', baz: 'herro' }], fallback: true }
}
-// eslint-disable-next-line camelcase
export async function getStaticProps({ params }) {
return {
props: { | true |
Other | vercel | next.js | b2624012ea52438dee783425e0d6b87d14c0fc9e.json | Remove old eslint-ignores from unstable_ prefix (#10740) | test/integration/prerender-legacy/pages/blog/[post].js | @@ -1,11 +1,9 @@
import React from 'react'
-// eslint-disable-next-line camelcase
export async function unstable_getStaticParams() {
return ['/blog/post-1']
}
-// eslint-disable-next-line camelcase
export async function getStaticProps({ params }) {
return {
props: { | true |
Other | vercel | next.js | b2624012ea52438dee783425e0d6b87d14c0fc9e.json | Remove old eslint-ignores from unstable_ prefix (#10740) | test/integration/prerender/pages/another/index.js | @@ -2,7 +2,6 @@ import Link from 'next/link'
import fs from 'fs'
import findUp from 'find-up'
-// eslint-disable-next-line camelcase
export async function getStaticProps() {
const text = fs
.readFileSync( | true |
Other | vercel | next.js | b2624012ea52438dee783425e0d6b87d14c0fc9e.json | Remove old eslint-ignores from unstable_ prefix (#10740) | test/integration/prerender/pages/blog/[post]/[comment].js | @@ -1,7 +1,6 @@
import React from 'react'
import Link from 'next/link'
-// eslint-disable-next-line camelcase
export async function getStaticPaths() {
return {
paths: [
@@ -12,7 +11,6 @@ export async function getStaticPaths() {
}
}
-// eslint-disable-next-line camelcase
export async function getStat... | true |
Other | vercel | next.js | b2624012ea52438dee783425e0d6b87d14c0fc9e.json | Remove old eslint-ignores from unstable_ prefix (#10740) | test/integration/prerender/pages/blog/[post]/index.js | @@ -2,7 +2,6 @@ import React from 'react'
import Link from 'next/link'
import { useRouter } from 'next/router'
-// eslint-disable-next-line camelcase
export async function getStaticPaths() {
return {
paths: [
@@ -19,7 +18,6 @@ export async function getStaticPaths() {
let counter = 0
-// eslint-disable... | true |
Other | vercel | next.js | b2624012ea52438dee783425e0d6b87d14c0fc9e.json | Remove old eslint-ignores from unstable_ prefix (#10740) | test/integration/prerender/pages/blog/index.js | @@ -1,7 +1,6 @@
import React from 'react'
import Link from 'next/link'
-// eslint-disable-next-line camelcase
export async function getStaticProps() {
return {
props: { | true |
Other | vercel | next.js | b2624012ea52438dee783425e0d6b87d14c0fc9e.json | Remove old eslint-ignores from unstable_ prefix (#10740) | test/integration/prerender/pages/default-revalidate.js | @@ -1,6 +1,5 @@
import Link from 'next/link'
-// eslint-disable-next-line camelcase
export async function getStaticProps() {
return {
props: { | true |
Other | vercel | next.js | b2624012ea52438dee783425e0d6b87d14c0fc9e.json | Remove old eslint-ignores from unstable_ prefix (#10740) | test/integration/prerender/pages/index.js | @@ -1,6 +1,5 @@
import Link from 'next/link'
-// eslint-disable-next-line camelcase
export async function getStaticProps() {
// throw new Error('oops from getStaticProps')
return { | true |
Other | vercel | next.js | b2624012ea52438dee783425e0d6b87d14c0fc9e.json | Remove old eslint-ignores from unstable_ prefix (#10740) | test/integration/prerender/pages/something.js | @@ -2,7 +2,6 @@ import React from 'react'
import Link from 'next/link'
import { useRouter } from 'next/router'
-// eslint-disable-next-line camelcase
export async function getStaticProps({ params }) {
return {
props: { | true |
Other | vercel | next.js | b2624012ea52438dee783425e0d6b87d14c0fc9e.json | Remove old eslint-ignores from unstable_ prefix (#10740) | test/integration/prerender/pages/user/[user]/profile.js | @@ -1,12 +1,10 @@
import React from 'react'
import Link from 'next/link'
-// eslint-disable-next-line camelcase
export async function getStaticPaths() {
return { paths: [], fallback: true }
}
-// eslint-disable-next-line camelcase
export async function getStaticProps({ params }) {
return {
props: { | true |
Other | vercel | next.js | 663f5c4b6e385ebe168e00110ca5217f56af6161.json | Fix Error Message | packages/next/build/utils.ts | @@ -539,7 +539,7 @@ export async function buildStaticPaths(
if (typeof staticPathsResult.fallback !== 'boolean') {
throw new Error(
- `The \`fallback\` key must be returned from unstable_getStaticProps in ${page}.\n` +
+ `The \`fallback\` key must be returned from unstable_getStaticPaths in ${page}.... | false |
Other | vercel | next.js | f143ca63be26036f4f82aaf03a2b8a171c9373ec.json | Update SSG types and clean up RenderOpts type (#10259)
* Update SSG types and clean up RenderOpts type
* Move SSG types back to internal module | packages/next/build/babel/plugins/next-page-config.ts | @@ -1,6 +1,6 @@
import { NodePath, PluginObj } from '@babel/core'
import * as BabelTypes from '@babel/types'
-import { PageConfig } from '../../../types'
+import { PageConfig } from 'next/types'
const configKeys = new Set(['amp'])
const STRING_LITERAL_DROP_BUNDLE = '__NEXT_DROP_CLIENT_FILE__' | true |
Other | vercel | next.js | f143ca63be26036f4f82aaf03a2b8a171c9373ec.json | Update SSG types and clean up RenderOpts type (#10259)
* Update SSG types and clean up RenderOpts type
* Move SSG types back to internal module | packages/next/next-server/lib/utils.ts | @@ -3,7 +3,7 @@ import { ParsedUrlQuery } from 'querystring'
import { ComponentType } from 'react'
import { format, URLFormatOptions, UrlObject } from 'url'
-import { ManifestItem } from '../server/render'
+import { ManifestItem } from '../server/load-components'
import { NextRouter } from './router/router'
/** | true |
Other | vercel | next.js | f143ca63be26036f4f82aaf03a2b8a171c9373ec.json | Update SSG types and clean up RenderOpts type (#10259)
* Update SSG types and clean up RenderOpts type
* Move SSG types back to internal module | packages/next/next-server/server/api-utils.ts | @@ -4,7 +4,7 @@ import { Stream } from 'stream'
import getRawBody from 'raw-body'
import { parse } from 'content-type'
import { Params } from './router'
-import { PageConfig } from '../../types'
+import { PageConfig } from 'next/types'
import { interopDefault } from './load-components'
import { isResSent } from '.... | true |
Other | vercel | next.js | f143ca63be26036f4f82aaf03a2b8a171c9373ec.json | Update SSG types and clean up RenderOpts type (#10259)
* Update SSG types and clean up RenderOpts type
* Move SSG types back to internal module | packages/next/next-server/server/load-components.ts | @@ -5,28 +5,44 @@ import {
SERVER_DIRECTORY,
} from '../lib/constants'
import { join } from 'path'
-import { PageConfig } from '../../types'
import { requirePage } from './require'
+import { ParsedUrlQuery } from 'querystring'
+import { BuildManifest } from './get-page-files'
+import { AppType, DocumentType } fro... | true |
Other | vercel | next.js | f143ca63be26036f4f82aaf03a2b8a171c9373ec.json | Update SSG types and clean up RenderOpts type (#10259)
* Update SSG types and clean up RenderOpts type
* Move SSG types back to internal module | packages/next/next-server/server/next-server.ts | @@ -863,15 +863,15 @@ export default class Server {
// check request state
const isLikeServerless =
typeof result.Component === 'object' &&
- typeof result.Component.renderReqToHTML === 'function'
+ typeof (result.Component as any).renderReqToHTML === 'function'
const isSSG = !!result.un... | true |
Other | vercel | next.js | f143ca63be26036f4f82aaf03a2b8a171c9373ec.json | Update SSG types and clean up RenderOpts type (#10259)
* Update SSG types and clean up RenderOpts type
* Move SSG types back to internal module | packages/next/next-server/server/render.tsx | @@ -14,31 +14,19 @@ import {
NextComponentType,
DocumentType,
AppType,
- NextPageContext,
} from '../lib/utils'
import Head, { defaultHead } from '../lib/head'
-// @ts-ignore types will be added later as it's an internal module
import Loadable from '../lib/loadable'
import { LoadableContext } from '../lib... | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.