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 | c24daa21722fadfce2d1d561ce65ecc0efa6a7ea.json | Add initial support for unstable_getServerProps (#10077)
* Add support for unstable_getServerProps
* Apply suggestions from review
* Add no-cache header and update types
* Revert sharing of load-components type
* Add catchall test and update routes-manifest field
* Update header check
* Update to pass query for ... | packages/next/lib/constants.ts | @@ -25,3 +25,7 @@ export const DOT_NEXT_ALIAS = 'private-dot-next'
export const PUBLIC_DIR_MIDDLEWARE_CONFLICT = `You can not have a '_next' folder inside of your public folder. This conflicts with the internal '/_next' route. https://err.sh/zeit/next.js/public-next-folder-conflict`
export const SSG_GET_INITIAL_PRO... | true |
Other | vercel | next.js | c24daa21722fadfce2d1d561ce65ecc0efa6a7ea.json | Add initial support for unstable_getServerProps (#10077)
* Add support for unstable_getServerProps
* Apply suggestions from review
* Add no-cache header and update types
* Revert sharing of load-components type
* Add catchall test and update routes-manifest field
* Update header check
* Update to pass query for ... | packages/next/next-server/lib/router/router.ts | @@ -27,6 +27,9 @@ function toRoute(path: string): string {
return path.replace(/\/$/, '') || '/'
}
+const prepareRoute = (path: string) =>
+ toRoute(!path || path === '/' ? '/index' : path)
+
type Url = UrlObject | string
export type BaseRouter = {
@@ -61,6 +64,33 @@ type BeforePopStateCallback = (state: any... | true |
Other | vercel | next.js | c24daa21722fadfce2d1d561ce65ecc0efa6a7ea.json | Add initial support for unstable_getServerProps (#10077)
* Add support for unstable_getServerProps
* Apply suggestions from review
* Add no-cache header and update types
* Revert sharing of load-components type
* Add catchall test and update routes-manifest field
* Update header check
* Update to pass query for ... | packages/next/next-server/server/load-components.ts | @@ -1,3 +1,5 @@
+import { IncomingMessage, ServerResponse } from 'http'
+import { ParsedUrlQuery } from 'querystring'
import {
BUILD_MANIFEST,
CLIENT_STATIC_FILES_PATH,
@@ -6,7 +8,6 @@ import {
} from '../lib/constants'
import { join } from 'path'
import { requirePage } from './require'
-import { ParsedUrlQue... | true |
Other | vercel | next.js | c24daa21722fadfce2d1d561ce65ecc0efa6a7ea.json | Add initial support for unstable_getServerProps (#10077)
* Add support for unstable_getServerProps
* Apply suggestions from review
* Add no-cache header and update types
* Revert sharing of load-components type
* Add catchall test and update routes-manifest field
* Update header check
* Update to pass query for ... | packages/next/next-server/server/next-server.ts | @@ -382,7 +382,7 @@ export default class Server {
req,
res,
pathname,
- { _nextDataReq: '1' },
+ { ..._parsedUrl.query, _nextDataReq: '1' },
parsedUrl
)
return {
@@ -823,7 +823,9 @@ export default class Server {
if (r... | true |
Other | vercel | next.js | c24daa21722fadfce2d1d561ce65ecc0efa6a7ea.json | Add initial support for unstable_getServerProps (#10077)
* Add support for unstable_getServerProps
* Apply suggestions from review
* Add no-cache header and update types
* Revert sharing of load-components type
* Add catchall test and update routes-manifest field
* Update header check
* Update to pass query for ... | packages/next/next-server/server/render.tsx | @@ -24,7 +24,11 @@ import { AmpStateContext } from '../lib/amp-context'
import optimizeAmp from './optimize-amp'
import { isInAmpMode } from '../lib/amp'
import { isDynamicRoute } from '../lib/router/utils/is-dynamic'
-import { SSG_GET_INITIAL_PROPS_CONFLICT } from '../../lib/constants'
+import {
+ SSG_GET_INITIAL_... | true |
Other | vercel | next.js | c24daa21722fadfce2d1d561ce65ecc0efa6a7ea.json | Add initial support for unstable_getServerProps (#10077)
* Add support for unstable_getServerProps
* Apply suggestions from review
* Add no-cache header and update types
* Revert sharing of load-components type
* Add catchall test and update routes-manifest field
* Update header check
* Update to pass query for ... | test/integration/getserverprops/pages/another/index.js | @@ -0,0 +1,38 @@
+import Link from 'next/link'
+import fs from 'fs'
+import findUp from 'find-up'
+
+// eslint-disable-next-line camelcase
+export async function unstable_getServerProps() {
+ const text = fs
+ .readFileSync(
+ findUp.sync('world.txt', {
+ // prevent webpack from intercepting
+ //... | true |
Other | vercel | next.js | c24daa21722fadfce2d1d561ce65ecc0efa6a7ea.json | Add initial support for unstable_getServerProps (#10077)
* Add support for unstable_getServerProps
* Apply suggestions from review
* Add no-cache header and update types
* Revert sharing of load-components type
* Add catchall test and update routes-manifest field
* Update header check
* Update to pass query for ... | test/integration/getserverprops/pages/blog/[post]/[comment].js | @@ -0,0 +1,26 @@
+import React from 'react'
+import Link from 'next/link'
+
+// eslint-disable-next-line camelcase
+export async function unstable_getServerProps({ query }) {
+ return {
+ props: {
+ post: query.post,
+ comment: query.comment,
+ time: new Date().getTime(),
+ },
+ }
+}
+
+export de... | true |
Other | vercel | next.js | c24daa21722fadfce2d1d561ce65ecc0efa6a7ea.json | Add initial support for unstable_getServerProps (#10077)
* Add support for unstable_getServerProps
* Apply suggestions from review
* Add no-cache header and update types
* Revert sharing of load-components type
* Add catchall test and update routes-manifest field
* Update header check
* Update to pass query for ... | test/integration/getserverprops/pages/blog/[post]/index.js | @@ -0,0 +1,38 @@
+import React from 'react'
+import Link from 'next/link'
+import { useRouter } from 'next/router'
+
+// eslint-disable-next-line camelcase
+export async function unstable_getServerProps({ params }) {
+ if (params.post === 'post-10') {
+ await new Promise(resolve => {
+ setTimeout(() => resolve... | true |
Other | vercel | next.js | c24daa21722fadfce2d1d561ce65ecc0efa6a7ea.json | Add initial support for unstable_getServerProps (#10077)
* Add support for unstable_getServerProps
* Apply suggestions from review
* Add no-cache header and update types
* Revert sharing of load-components type
* Add catchall test and update routes-manifest field
* Update header check
* Update to pass query for ... | test/integration/getserverprops/pages/blog/index.js | @@ -0,0 +1,24 @@
+import React from 'react'
+import Link from 'next/link'
+
+// eslint-disable-next-line camelcase
+export async function unstable_getServerProps() {
+ return {
+ props: {
+ slugs: ['post-1', 'post-2'],
+ time: (await import('perf_hooks')).performance.now(),
+ },
+ }
+}
+
+export defau... | true |
Other | vercel | next.js | c24daa21722fadfce2d1d561ce65ecc0efa6a7ea.json | Add initial support for unstable_getServerProps (#10077)
* Add support for unstable_getServerProps
* Apply suggestions from review
* Add no-cache header and update types
* Revert sharing of load-components type
* Add catchall test and update routes-manifest field
* Update header check
* Update to pass query for ... | test/integration/getserverprops/pages/catchall/[...path].js | @@ -0,0 +1,34 @@
+import React from 'react'
+import Link from 'next/link'
+import { useRouter } from 'next/router'
+
+// eslint-disable-next-line camelcase
+export async function unstable_getServerProps({ params }) {
+ return {
+ props: {
+ world: 'world',
+ params: params || {},
+ time: new Date().g... | true |
Other | vercel | next.js | c24daa21722fadfce2d1d561ce65ecc0efa6a7ea.json | Add initial support for unstable_getServerProps (#10077)
* Add support for unstable_getServerProps
* Apply suggestions from review
* Add no-cache header and update types
* Revert sharing of load-components type
* Add catchall test and update routes-manifest field
* Update header check
* Update to pass query for ... | test/integration/getserverprops/pages/default-revalidate.js | @@ -0,0 +1,25 @@
+import Link from 'next/link'
+
+// eslint-disable-next-line camelcase
+export async function unstable_getServerProps() {
+ return {
+ props: {
+ world: 'world',
+ time: new Date().getTime(),
+ },
+ }
+}
+
+export default ({ world, time }) => (
+ <>
+ <p>hello {world}</p>
+ <sp... | true |
Other | vercel | next.js | c24daa21722fadfce2d1d561ce65ecc0efa6a7ea.json | Add initial support for unstable_getServerProps (#10077)
* Add support for unstable_getServerProps
* Apply suggestions from review
* Add no-cache header and update types
* Revert sharing of load-components type
* Add catchall test and update routes-manifest field
* Update header check
* Update to pass query for ... | test/integration/getserverprops/pages/index.js | @@ -0,0 +1,47 @@
+import Link from 'next/link'
+
+// eslint-disable-next-line camelcase
+export async function unstable_getServerProps() {
+ return {
+ props: {
+ world: 'world',
+ time: new Date().getTime(),
+ },
+ }
+}
+
+const Page = ({ world, time }) => {
+ return (
+ <>
+ <p>hello {world... | true |
Other | vercel | next.js | c24daa21722fadfce2d1d561ce65ecc0efa6a7ea.json | Add initial support for unstable_getServerProps (#10077)
* Add support for unstable_getServerProps
* Apply suggestions from review
* Add no-cache header and update types
* Revert sharing of load-components type
* Add catchall test and update routes-manifest field
* Update header check
* Update to pass query for ... | test/integration/getserverprops/pages/invalid-keys.js | @@ -0,0 +1,34 @@
+import React from 'react'
+import Link from 'next/link'
+import { useRouter } from 'next/router'
+
+// eslint-disable-next-line camelcase
+export async function unstable_getServerProps({ params, query }) {
+ return {
+ world: 'world',
+ query: query || {},
+ params: params || {},
+ time: ... | true |
Other | vercel | next.js | c24daa21722fadfce2d1d561ce65ecc0efa6a7ea.json | Add initial support for unstable_getServerProps (#10077)
* Add support for unstable_getServerProps
* Apply suggestions from review
* Add no-cache header and update types
* Revert sharing of load-components type
* Add catchall test and update routes-manifest field
* Update header check
* Update to pass query for ... | test/integration/getserverprops/pages/normal.js | @@ -0,0 +1 @@
+export default () => <p id="normal-text">a normal page</p> | true |
Other | vercel | next.js | c24daa21722fadfce2d1d561ce65ecc0efa6a7ea.json | Add initial support for unstable_getServerProps (#10077)
* Add support for unstable_getServerProps
* Apply suggestions from review
* Add no-cache header and update types
* Revert sharing of load-components type
* Add catchall test and update routes-manifest field
* Update header check
* Update to pass query for ... | test/integration/getserverprops/pages/something.js | @@ -0,0 +1,36 @@
+import React from 'react'
+import Link from 'next/link'
+import { useRouter } from 'next/router'
+
+// eslint-disable-next-line camelcase
+export async function unstable_getServerProps({ params, query }) {
+ return {
+ props: {
+ world: 'world',
+ query: query || {},
+ params: param... | true |
Other | vercel | next.js | c24daa21722fadfce2d1d561ce65ecc0efa6a7ea.json | Add initial support for unstable_getServerProps (#10077)
* Add support for unstable_getServerProps
* Apply suggestions from review
* Add no-cache header and update types
* Revert sharing of load-components type
* Add catchall test and update routes-manifest field
* Update header check
* Update to pass query for ... | test/integration/getserverprops/pages/user/[user]/profile.js | @@ -0,0 +1,24 @@
+import React from 'react'
+import Link from 'next/link'
+
+// eslint-disable-next-line camelcase
+export async function unstable_getServerProps({ query }) {
+ return {
+ props: {
+ user: query.user,
+ time: (await import('perf_hooks')).performance.now(),
+ },
+ }
+}
+
+export default... | true |
Other | vercel | next.js | c24daa21722fadfce2d1d561ce65ecc0efa6a7ea.json | Add initial support for unstable_getServerProps (#10077)
* Add support for unstable_getServerProps
* Apply suggestions from review
* Add no-cache header and update types
* Revert sharing of load-components type
* Add catchall test and update routes-manifest field
* Update header check
* Update to pass query for ... | test/integration/getserverprops/test/index.test.js | @@ -0,0 +1,407 @@
+/* eslint-env jest */
+/* global jasmine */
+import fs from 'fs-extra'
+import { join } from 'path'
+import webdriver from 'next-webdriver'
+import cheerio from 'cheerio'
+import escapeRegex from 'escape-string-regexp'
+import {
+ renderViaHTTP,
+ fetchViaHTTP,
+ findPort,
+ launchApp,
+ killApp... | true |
Other | vercel | next.js | c24daa21722fadfce2d1d561ce65ecc0efa6a7ea.json | Add initial support for unstable_getServerProps (#10077)
* Add support for unstable_getServerProps
* Apply suggestions from review
* Add no-cache header and update types
* Revert sharing of load-components type
* Add catchall test and update routes-manifest field
* Update header check
* Update to pass query for ... | test/integration/getserverprops/world.txt | @@ -0,0 +1 @@
+world
\ No newline at end of file | true |
Other | vercel | next.js | c24daa21722fadfce2d1d561ce65ecc0efa6a7ea.json | Add initial support for unstable_getServerProps (#10077)
* Add support for unstable_getServerProps
* Apply suggestions from review
* Add no-cache header and update types
* Revert sharing of load-components type
* Add catchall test and update routes-manifest field
* Update header check
* Update to pass query for ... | test/integration/mixed-ssg-serverprops-error/pages/index.js | @@ -0,0 +1,13 @@
+export const unstable_getStaticProps = async () => {
+ return {
+ props: { world: 'world' },
+ }
+}
+
+export const unstable_getServerProps = async () => {
+ return {
+ props: { world: 'world' },
+ }
+}
+
+export default ({ world }) => <p>Hello {world}</p> | true |
Other | vercel | next.js | c24daa21722fadfce2d1d561ce65ecc0efa6a7ea.json | Add initial support for unstable_getServerProps (#10077)
* Add support for unstable_getServerProps
* Apply suggestions from review
* Add no-cache header and update types
* Revert sharing of load-components type
* Add catchall test and update routes-manifest field
* Update header check
* Update to pass query for ... | test/integration/mixed-ssg-serverprops-error/pages/index.js.alt | @@ -0,0 +1,13 @@
+export const unstable_getStaticPaths = async () => {
+ return {
+ props: { world: 'world' }
+ }
+}
+
+export const unstable_getServerProps = async () => {
+ return {
+ props: { world: 'world' }
+ }
+}
+
+export default ({ world }) => <p>Hello {world}</p> | true |
Other | vercel | next.js | c24daa21722fadfce2d1d561ce65ecc0efa6a7ea.json | Add initial support for unstable_getServerProps (#10077)
* Add support for unstable_getServerProps
* Apply suggestions from review
* Add no-cache header and update types
* Revert sharing of load-components type
* Add catchall test and update routes-manifest field
* Update header check
* Update to pass query for ... | test/integration/mixed-ssg-serverprops-error/test/index.test.js | @@ -0,0 +1,32 @@
+/* eslint-env jest */
+/* global jasmine */
+import fs from 'fs-extra'
+import { join } from 'path'
+import { nextBuild } from 'next-test-utils'
+import { SERVER_PROPS_SSG_CONFLICT } from 'next/dist/lib/constants'
+
+jasmine.DEFAULT_TIMEOUT_INTERVAL = 1000 * 60 * 1
+const appDir = join(__dirname, '..'... | true |
Other | vercel | next.js | abd69ec4be4c46565ec102f435d9552eaee7952f.json | Fix Experimental Modern Mode with CSS (#10289) | packages/next/build/webpack/plugins/build-manifest-plugin.ts | @@ -33,7 +33,9 @@ const generateClientManifest = (
// Filter out dependencies in the _app entry, because those will have already
// been loaded by the client prior to a navigation event
const filteredDeps = dependencies.filter(
- dep => !appDependencies.has(dep) && /\.module\.js$/.test(dep) === isMo... | true |
Other | vercel | next.js | abd69ec4be4c46565ec102f435d9552eaee7952f.json | Fix Experimental Modern Mode with CSS (#10289) | test/integration/css-client-nav/test/index.test.js | @@ -171,3 +171,159 @@ describe('CSS Module client-side navigation in Production', () => {
}
})
})
+
+describe('CSS Module client-side navigation in Production (Modern)', () => {
+ const appDir = join(fixturesDir, 'multi-module-modern')
+
+ beforeAll(async () => {
+ await remove(join(appDir, '.next'))
+ }... | true |
Other | vercel | next.js | abd69ec4be4c46565ec102f435d9552eaee7952f.json | Fix Experimental Modern Mode with CSS (#10289) | test/integration/css-fixtures/multi-module-modern/next.config.js | @@ -0,0 +1,9 @@
+const parent = require('../next.config')
+
+module.exports = {
+ ...parent,
+ experimental: {
+ ...parent.experimental,
+ modern: true,
+ },
+} | true |
Other | vercel | next.js | abd69ec4be4c46565ec102f435d9552eaee7952f.json | Fix Experimental Modern Mode with CSS (#10289) | test/integration/css-fixtures/multi-module-modern/pages/blue.js | @@ -0,0 +1,20 @@
+import Link from 'next/link'
+import { blueText } from './blue.module.css'
+
+export default function Blue() {
+ return (
+ <>
+ <div id="verify-blue" className={blueText}>
+ This text should be blue.
+ </div>
+ <br />
+ <Link href="/red" prefetch>
+ <a id="link-r... | true |
Other | vercel | next.js | abd69ec4be4c46565ec102f435d9552eaee7952f.json | Fix Experimental Modern Mode with CSS (#10289) | test/integration/css-fixtures/multi-module-modern/pages/blue.module.css | @@ -0,0 +1,3 @@
+.blueText {
+ color: blue;
+} | true |
Other | vercel | next.js | abd69ec4be4c46565ec102f435d9552eaee7952f.json | Fix Experimental Modern Mode with CSS (#10289) | test/integration/css-fixtures/multi-module-modern/pages/none.js | @@ -0,0 +1,19 @@
+import Link from 'next/link'
+
+export default function None() {
+ return (
+ <>
+ <div id="verify-black" style={{ color: 'black' }}>
+ This text should be black.
+ </div>
+ <br />
+ <Link href="/red" prefetch={false}>
+ <a id="link-red">Red</a>
+ </Link>
+ ... | true |
Other | vercel | next.js | abd69ec4be4c46565ec102f435d9552eaee7952f.json | Fix Experimental Modern Mode with CSS (#10289) | test/integration/css-fixtures/multi-module-modern/pages/red.js | @@ -0,0 +1,20 @@
+import Link from 'next/link'
+import { redText } from './red.module.css'
+
+export default function Red() {
+ return (
+ <>
+ <div id="verify-red" className={redText}>
+ This text should be red.
+ </div>
+ <br />
+ <Link href="/blue" prefetch={false}>
+ <a id="lin... | true |
Other | vercel | next.js | abd69ec4be4c46565ec102f435d9552eaee7952f.json | Fix Experimental Modern Mode with CSS (#10289) | test/integration/css-fixtures/multi-module-modern/pages/red.module.css | @@ -0,0 +1,3 @@
+.redText {
+ color: red;
+} | true |
Other | vercel | next.js | abd69ec4be4c46565ec102f435d9552eaee7952f.json | Fix Experimental Modern Mode with CSS (#10289) | test/integration/css-fixtures/multi-module/next.config.js | @@ -0,0 +1,9 @@
+const parent = require('../next.config')
+
+module.exports = {
+ ...parent,
+ experimental: {
+ ...parent.experimental,
+ modern: false,
+ },
+} | true |
Other | vercel | next.js | dd3bb73d8078f8206dcca2660ba706c5e9e4f6bd.json | Update typo in typescript docs (#10276) | docs/basic-features/typescript.md | @@ -101,7 +101,7 @@ The following is an example of how to use the built-in types for API routes:
import { NextApiRequest, NextApiResponse } from 'next'
export default (req: NextApiRequest, res: NextApiResponse) => {
- res.status(200).json({ name: 'Jhon Doe' })
+ res.status(200).json({ name: 'John Doe' })
}
```
... | false |
Other | vercel | next.js | a7fbd308be3030324bd2fc60e91a57e13c7e5163.json | Adjust README to mention Link | packages/next/README.md | @@ -300,6 +300,16 @@ export default Post
Any route like `/post/1`, `/post/abc`, etc will be matched by `pages/post/[pid].js`.
The matched path parameter will be sent as a query parameter to the page.
+> Note: A `<Link>` for a Dynamic Route looks like so:
+>
+> ```jsx
+> <Link href="/post/[pid]" as="/post/abc">
+> ... | false |
Other | vercel | next.js | 13cf664898a5c16f1adf4c90bb5406162ef5bece.json | Add support for legacy server npm modules (#7898)
Notably, this PR fixes `faunadb` which relies on `formidable`.
n.b. `formidable` is an unmaintained legacy npm package that uses practices not compatible with the modern ecosystem. | package.json | @@ -79,6 +79,7 @@
"eslint": "5.16.0",
"eslint-plugin-typescript": "0.14.0",
"express": "4.17.0",
+ "faunadb": "2.6.1",
"fs-extra": "7.0.1",
"get-port": "5.0.0",
"isomorphic-unfetch": "3.0.0", | true |
Other | vercel | next.js | 13cf664898a5c16f1adf4c90bb5406162ef5bece.json | Add support for legacy server npm modules (#7898)
Notably, this PR fixes `faunadb` which relies on `formidable`.
n.b. `formidable` is an unmaintained legacy npm package that uses practices not compatible with the modern ecosystem. | packages/next/build/webpack-config.ts | @@ -444,8 +444,18 @@ export default async function getBaseWebpackConfig(
config.exportTrailingSlash
),
...(isServer
- ? { 'typeof window': JSON.stringify('undefined') }
- : { 'typeof window': JSON.stringify('object') }),
+ ? {
+ // Allow browser-only ... | true |
Other | vercel | next.js | 13cf664898a5c16f1adf4c90bb5406162ef5bece.json | Add support for legacy server npm modules (#7898)
Notably, this PR fixes `faunadb` which relies on `formidable`.
n.b. `formidable` is an unmaintained legacy npm package that uses practices not compatible with the modern ecosystem. | test/integration/legacy-pkg-gently/next.config.js | @@ -0,0 +1 @@
+module.exports = { target: 'serverless' } | true |
Other | vercel | next.js | 13cf664898a5c16f1adf4c90bb5406162ef5bece.json | Add support for legacy server npm modules (#7898)
Notably, this PR fixes `faunadb` which relies on `formidable`.
n.b. `formidable` is an unmaintained legacy npm package that uses practices not compatible with the modern ecosystem. | test/integration/legacy-pkg-gently/pages/api/hello.js | @@ -0,0 +1,7 @@
+import { Client } from 'faunadb'
+
+export default (_req, res) => {
+ const client = new Client({ secret: 'foobar' })
+ console.log(client)
+ res.send({ message: 'hello world' })
+} | true |
Other | vercel | next.js | 13cf664898a5c16f1adf4c90bb5406162ef5bece.json | Add support for legacy server npm modules (#7898)
Notably, this PR fixes `faunadb` which relies on `formidable`.
n.b. `formidable` is an unmaintained legacy npm package that uses practices not compatible with the modern ecosystem. | test/integration/legacy-pkg-gently/test/index.test.js | @@ -0,0 +1,39 @@
+/* eslint-env jest */
+/* global jasmine */
+import { join } from 'path'
+import {
+ renderViaHTTP,
+ runNextCommand,
+ nextServer,
+ startApp,
+ stopApp
+} from 'next-test-utils'
+
+jasmine.DEFAULT_TIMEOUT_INTERVAL = 1000 * 60 * 5
+
+let app
+let appPort
+let server
+const appDir = join(__dirnam... | true |
Other | vercel | next.js | 13cf664898a5c16f1adf4c90bb5406162ef5bece.json | Add support for legacy server npm modules (#7898)
Notably, this PR fixes `faunadb` which relies on `formidable`.
n.b. `formidable` is an unmaintained legacy npm package that uses practices not compatible with the modern ecosystem. | yarn.lock | @@ -2854,7 +2854,7 @@ balanced-match@^1.0.0:
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767"
integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c=
-base64-js@^1.0.2:
+base64-js@^1.0.2, base64-js@^1.2.0:
version "1.3.0"
resolved "https://regi... | true |
Other | vercel | next.js | 6f9387f6cfbcd4bda51486d59e8b6ae7dd9095ab.json | Add declaration files to the contributing guide (#7885) | contributing.md | @@ -5,8 +5,11 @@ Our Commitment to Open Source can be found [here](https://zeit.co/blog/oss)
1. [Fork](https://help.github.com/articles/fork-a-repo/) this repository to your own GitHub account and then [clone](https://help.github.com/articles/cloning-a-repository/) it to your local device.
2. Install yarn: `npm insta... | true |
Other | vercel | next.js | 6f9387f6cfbcd4bda51486d59e8b6ae7dd9095ab.json | Add declaration files to the contributing guide (#7885) | package.json | @@ -18,6 +18,7 @@
"lint": "lerna run typescript && standard && standard --parser typescript-eslint-parser --plugin typescript \"packages/**/*.ts\"",
"lint-fix": "standard --fix && standard --fix --parser typescript-eslint-parser --plugin typescript \"packages/**/*.ts\"",
"prettier": "prettier --write \"*... | true |
Other | vercel | next.js | 41cb3b3bc0639df06d33797725244ba8a1cf76de.json | Stop PageConfig plugin from running on non-pages (#7884)
* Add test for PageConfig
* Make sure PageConfig plugin is only run for pages | packages/next/build/webpack/loaders/next-babel-loader.js | @@ -61,8 +61,11 @@ module.exports = babelLoader.custom(babel => {
customOptions: { isServer, asyncToPromises }
}
) {
+ const { cwd } = cfg.options
const filename = this.resourcePath
const options = Object.assign({}, cfg.options)
+ const isPageFile = filename.startsWith(join(... | true |
Other | vercel | next.js | 41cb3b3bc0639df06d33797725244ba8a1cf76de.json | Stop PageConfig plugin from running on non-pages (#7884)
* Add test for PageConfig
* Make sure PageConfig plugin is only run for pages | test/integration/page-config/config/index.js | @@ -0,0 +1 @@
+export const config = 'world' | true |
Other | vercel | next.js | 41cb3b3bc0639df06d33797725244ba8a1cf76de.json | Stop PageConfig plugin from running on non-pages (#7884)
* Add test for PageConfig
* Make sure PageConfig plugin is only run for pages | test/integration/page-config/pages/index.js | @@ -0,0 +1,8 @@
+import { config as hello } from '../something'
+import { config as world } from '../config'
+
+export default () => (
+ <p>
+ {hello} {world}
+ </p>
+) | true |
Other | vercel | next.js | 41cb3b3bc0639df06d33797725244ba8a1cf76de.json | Stop PageConfig plugin from running on non-pages (#7884)
* Add test for PageConfig
* Make sure PageConfig plugin is only run for pages | test/integration/page-config/something.js | @@ -0,0 +1 @@
+export const config = 'hello' | true |
Other | vercel | next.js | 41cb3b3bc0639df06d33797725244ba8a1cf76de.json | Stop PageConfig plugin from running on non-pages (#7884)
* Add test for PageConfig
* Make sure PageConfig plugin is only run for pages | test/integration/page-config/test/index.test.js | @@ -0,0 +1,14 @@
+/* eslint-env jest */
+/* global jasmine */
+import { join } from 'path'
+import { nextBuild } from 'next-test-utils'
+
+const appDir = join(__dirname, '..')
+jasmine.DEFAULT_TIMEOUT_INTERVAL = 1000 * 60 * 2
+
+describe('Page Config', () => {
+ it('builds without error when export const config is use... | true |
Other | vercel | next.js | 70b8bed4ad7f5249feb96cc940625fc35eee4653.json | Add a dev2 command | package.json | @@ -7,6 +7,7 @@
"scripts": {
"lerna": "lerna",
"dev": "lerna run build --stream --parallel",
+ "dev2": "while true; do yarn --check-files && yarn dev; done",
"testonly": "jest",
"testall": "yarn check && yarn run testonly -- --ci --reporters=default --reporters=jest-junit --forceExit --runInBa... | false |
Other | vercel | next.js | bf7af1d16b4c730571d5147dd4738564dc4af92d.json | Add default values for runtime config (#7847)
* Add default values for runtime config
* Add test to ensure default values are set
for runtime config
* Only add runtimeConfig if it's not empty
* Only add runtimeConfig if it's not empty
* Simplify default value adding
* Reduce bundle size
* remove com... | packages/next-server/lib/utils.ts | @@ -167,11 +167,11 @@ type Send<T> = (body: T) => void
*/
export type NextApiResponse<T = any> = ServerResponse & {
/**
- * Send data `any` data in reponse
+ * Send data `any` data in response
*/
send: Send<T>
/**
- * Send data `json` data in reponse
+ * Send data `json` data in response
*/
... | true |
Other | vercel | next.js | bf7af1d16b4c730571d5147dd4738564dc4af92d.json | Add default values for runtime config (#7847)
* Add default values for runtime config
* Add test to ensure default values are set
for runtime config
* Only add runtimeConfig if it's not empty
* Only add runtimeConfig if it's not empty
* Simplify default value adding
* Reduce bundle size
* remove com... | packages/next-server/server/config.ts | @@ -39,6 +39,8 @@ const defaultConfig: { [key: string]: any } = {
documentMiddleware: false,
publicDirectory: false,
},
+ serverRuntimeConfig: {},
+ publicRuntimeConfig: {},
}
function assignDefaults(userConfig: { [key: string]: any }) {
@@ -104,6 +106,12 @@ export default function loadConfig(
... | true |
Other | vercel | next.js | bf7af1d16b4c730571d5147dd4738564dc4af92d.json | Add default values for runtime config (#7847)
* Add default values for runtime config
* Add test to ensure default values are set
for runtime config
* Only add runtimeConfig if it's not empty
* Only add runtimeConfig if it's not empty
* Simplify default value adding
* Reduce bundle size
* remove com... | packages/next-server/server/next-server.ts | @@ -118,7 +118,7 @@ export default class Server {
// Only the `publicRuntimeConfig` key is exposed to the client side
// It'll be rendered as part of __NEXT_DATA__ on the client side
- if (publicRuntimeConfig) {
+ if (Object.keys(publicRuntimeConfig).length > 0) {
this.renderOpts.runtimeConfig ... | true |
Other | vercel | next.js | bf7af1d16b4c730571d5147dd4738564dc4af92d.json | Add default values for runtime config (#7847)
* Add default values for runtime config
* Add test to ensure default values are set
for runtime config
* Only add runtimeConfig if it's not empty
* Only add runtimeConfig if it's not empty
* Simplify default value adding
* Reduce bundle size
* remove com... | packages/next/build/index.ts | @@ -201,11 +201,6 @@ export default async function build(dir: string, conf = null): Promise<void> {
let result: CompilerResult = { warnings: [], errors: [] }
if (target === 'serverless') {
- if (config.publicRuntimeConfig)
- throw new Error(
- 'Cannot use publicRuntimeConfig with target=serverles... | true |
Other | vercel | next.js | bf7af1d16b4c730571d5147dd4738564dc4af92d.json | Add default values for runtime config (#7847)
* Add default values for runtime config
* Add test to ensure default values are set
for runtime config
* Only add runtimeConfig if it's not empty
* Only add runtimeConfig if it's not empty
* Simplify default value adding
* Reduce bundle size
* remove com... | packages/next/client/index.js | @@ -1,3 +1,4 @@
+/* global location */
import React, { Suspense } from 'react'
import ReactDOM from 'react-dom'
import HeadManager from './head-manager'
@@ -49,7 +50,7 @@ __webpack_public_path__ = `${prefix}/_next/` //eslint-disable-line
// Initialize next/config with the environment configuration
envConfig.setCon... | true |
Other | vercel | next.js | bf7af1d16b4c730571d5147dd4738564dc4af92d.json | Add default values for runtime config (#7847)
* Add default values for runtime config
* Add test to ensure default values are set
for runtime config
* Only add runtimeConfig if it's not empty
* Only add runtimeConfig if it's not empty
* Simplify default value adding
* Reduce bundle size
* remove com... | packages/next/export/index.js | @@ -110,7 +110,7 @@ export default async function (dir, options, configuration) {
const { serverRuntimeConfig, publicRuntimeConfig } = nextConfig
- if (publicRuntimeConfig) {
+ if (Object.keys(publicRuntimeConfig).length > 0) {
renderOpts.runtimeConfig = publicRuntimeConfig
}
| true |
Other | vercel | next.js | bf7af1d16b4c730571d5147dd4738564dc4af92d.json | Add default values for runtime config (#7847)
* Add default values for runtime config
* Add test to ensure default values are set
for runtime config
* Only add runtimeConfig if it's not empty
* Only add runtimeConfig if it's not empty
* Simplify default value adding
* Reduce bundle size
* remove com... | test/integration/production/pages/runtime-config.js | @@ -0,0 +1,16 @@
+import getConfig from 'next/config'
+
+const page = () => {
+ const { publicRuntimeConfig, serverRuntimeConfig } = getConfig()
+
+ return (
+ <>
+ {publicRuntimeConfig && <p>found public config</p>}
+ {serverRuntimeConfig && <p>found server config</p>}
+ </>
+ )
+}
+
+page.getInitia... | true |
Other | vercel | next.js | bf7af1d16b4c730571d5147dd4738564dc4af92d.json | Add default values for runtime config (#7847)
* Add default values for runtime config
* Add test to ensure default values are set
for runtime config
* Only add runtimeConfig if it's not empty
* Only add runtimeConfig if it's not empty
* Simplify default value adding
* Reduce bundle size
* remove com... | test/integration/production/test/index.test.js | @@ -375,6 +375,19 @@ describe('Production Usage', () => {
await browser.close()
})
+ it('should have default runtime values when not defined', async () => {
+ const html = await renderViaHTTP(appPort, '/runtime-config')
+ expect(html).toMatch(/found public config/)
+ expect(html).toMatch... | true |
Other | vercel | next.js | 8c5209efabdb800baf8c7612472be565a63bea01.json | Update typescript examples (#7867)
* Updated with-jest-typescript
* Updated the mobx-state-tree-typescript example
* Removed the sitemap with typescript example
* Updated the with css typings example | examples/with-jest-typescript/.babelrc | @@ -1,29 +1,3 @@
{
- "env": {
- "development": {
- "presets": [
- "next/babel",
- "@zeit/next-typescript/babel"
- ]
- },
- "production": {
- "presets": [
- "next/babel",
- "@zeit/next-typescript/babel"
- ]
- },
- "test": {
- "presets": [
- [
-... | true |
Other | vercel | next.js | 8c5209efabdb800baf8c7612472be565a63bea01.json | Update typescript examples (#7867)
* Updated with-jest-typescript
* Updated the mobx-state-tree-typescript example
* Removed the sitemap with typescript example
* Updated the with css typings example | examples/with-jest-typescript/next-env.d.ts | @@ -0,0 +1,2 @@
+/// <reference types="next" />
+/// <reference types="next/types/global" /> | true |
Other | vercel | next.js | 8c5209efabdb800baf8c7612472be565a63bea01.json | Update typescript examples (#7867)
* Updated with-jest-typescript
* Updated the mobx-state-tree-typescript example
* Removed the sitemap with typescript example
* Updated the with css typings example | examples/with-jest-typescript/next.config.js | @@ -1,2 +0,0 @@
-const withTypescript = require('@zeit/next-typescript')
-module.exports = withTypescript() | true |
Other | vercel | next.js | 8c5209efabdb800baf8c7612472be565a63bea01.json | Update typescript examples (#7867)
* Updated with-jest-typescript
* Updated the mobx-state-tree-typescript example
* Removed the sitemap with typescript example
* Updated the with css typings example | examples/with-jest-typescript/package.json | @@ -14,10 +14,8 @@
},
"devDependencies": {
"@types/jest": "^24.0.11",
- "@types/next": "^8.0.1",
"@types/react": "^16.8.8",
"@types/react-dom": "^16.8.2",
- "@zeit/next-typescript": "^1.1.1",
"babel-core": "^6.26.3",
"babel-jest": "^24.5.0",
"enzyme": "^3.9.0", | true |
Other | vercel | next.js | 8c5209efabdb800baf8c7612472be565a63bea01.json | Update typescript examples (#7867)
* Updated with-jest-typescript
* Updated the mobx-state-tree-typescript example
* Removed the sitemap with typescript example
* Updated the with css typings example | examples/with-jest-typescript/pages/cars.tsx | @@ -1,4 +1,4 @@
-import CarsOverview from './../src/modules/cars/Overview'
+import CarsOverview from '../src/modules/cars/Overview'
const CarsPage = () => <CarsOverview />
| true |
Other | vercel | next.js | 8c5209efabdb800baf8c7612472be565a63bea01.json | Update typescript examples (#7867)
* Updated with-jest-typescript
* Updated the mobx-state-tree-typescript example
* Removed the sitemap with typescript example
* Updated the with css typings example | examples/with-jest-typescript/pages/login.tsx | @@ -1,4 +1,4 @@
-import Login from './../src/modules/auth/Login'
+import Login from '../src/modules/auth/Login'
const LoginPage = () => <Login />
| true |
Other | vercel | next.js | 8c5209efabdb800baf8c7612472be565a63bea01.json | Update typescript examples (#7867)
* Updated with-jest-typescript
* Updated the mobx-state-tree-typescript example
* Removed the sitemap with typescript example
* Updated the with css typings example | examples/with-jest-typescript/src/modules/cars/Overview.tsx | @@ -3,7 +3,7 @@ import * as React from 'react'
import * as T from './types'
export interface CarsOverviewProps {
- cars: T.CarList
+ cars?: T.CarList
}
export interface CarsOverviewState {
@@ -26,7 +26,7 @@ export default class CarsOverview extends React.Component<
this.setState({ selectedCar: car })
... | true |
Other | vercel | next.js | 8c5209efabdb800baf8c7612472be565a63bea01.json | Update typescript examples (#7867)
* Updated with-jest-typescript
* Updated the mobx-state-tree-typescript example
* Removed the sitemap with typescript example
* Updated the with css typings example | examples/with-jest-typescript/tsconfig.json | @@ -14,14 +14,31 @@
"sourceMap": true,
"skipLibCheck": true,
"baseUrl": ".",
- "typeRoots": ["./node_modules/@types"],
- "lib": ["dom", "es2015", "es2016"]
+ "typeRoots": [
+ "./node_modules/@types"
+ ],
+ "lib": [
+ "dom",
+ "es2015",
+ "es2016"
+ ],
+ "strict": ... | true |
Other | vercel | next.js | 8c5209efabdb800baf8c7612472be565a63bea01.json | Update typescript examples (#7867)
* Updated with-jest-typescript
* Updated the mobx-state-tree-typescript example
* Removed the sitemap with typescript example
* Updated the with css typings example | examples/with-mobx-state-tree-typescript/.babelrc | @@ -1,9 +1,4 @@
{
- "presets": [
- "next/babel",
- "@zeit/next-typescript/babel"
- ],
- "plugins": [
- ["@babel/plugin-proposal-decorators", { "legacy": true }]
- ]
+ "presets": ["next/babel"],
+ "plugins": [["@babel/plugin-proposal-decorators", { "legacy": true }]]
} | true |
Other | vercel | next.js | 8c5209efabdb800baf8c7612472be565a63bea01.json | Update typescript examples (#7867)
* Updated with-jest-typescript
* Updated the mobx-state-tree-typescript example
* Removed the sitemap with typescript example
* Updated the with css typings example | examples/with-mobx-state-tree-typescript/next-env.d.ts | @@ -0,0 +1,2 @@
+/// <reference types="next" />
+/// <reference types="next/types/global" /> | true |
Other | vercel | next.js | 8c5209efabdb800baf8c7612472be565a63bea01.json | Update typescript examples (#7867)
* Updated with-jest-typescript
* Updated the mobx-state-tree-typescript example
* Removed the sitemap with typescript example
* Updated the with css typings example | examples/with-mobx-state-tree-typescript/next.config.js | @@ -1,2 +0,0 @@
-const withTypescript = require('@zeit/next-typescript')
-module.exports = withTypescript() | true |
Other | vercel | next.js | 8c5209efabdb800baf8c7612472be565a63bea01.json | Update typescript examples (#7867)
* Updated with-jest-typescript
* Updated the mobx-state-tree-typescript example
* Removed the sitemap with typescript example
* Updated the with css typings example | examples/with-mobx-state-tree-typescript/package.json | @@ -4,11 +4,9 @@
"scripts": {
"dev": "next",
"build": "next build",
- "start": "next start",
- "tslint": "tslint -c tslint.json -p tsconfig.json"
+ "start": "next start"
},
"dependencies": {
- "@zeit/next-typescript": "1.1.0",
"mobx": "^5.9.0",
"mobx-react": "^5.4.3",
"mobx... | true |
Other | vercel | next.js | 8c5209efabdb800baf8c7612472be565a63bea01.json | Update typescript examples (#7867)
* Updated with-jest-typescript
* Updated the mobx-state-tree-typescript example
* Removed the sitemap with typescript example
* Updated the with css typings example | examples/with-mobx-state-tree-typescript/stores/store.ts | @@ -41,10 +41,10 @@ export type IStoreSnapshotOut = SnapshotOut<typeof Store>
export const initializeStore = (isServer, snapshot = null) => {
if (isServer) {
- store = Store.create({ foo: 6, lastUpdate: Date.now() })
+ store = Store.create({ foo: 6, lastUpdate: Date.now(), light: false })
}
if ((store... | true |
Other | vercel | next.js | 8c5209efabdb800baf8c7612472be565a63bea01.json | Update typescript examples (#7867)
* Updated with-jest-typescript
* Updated the mobx-state-tree-typescript example
* Removed the sitemap with typescript example
* Updated the with css typings example | examples/with-mobx-state-tree-typescript/tsconfig.json | @@ -1,23 +1,20 @@
{
- "compileOnSave": false,
"compilerOptions": {
- "experimentalDecorators": true,
- "target": "esnext",
- "module": "esnext",
- "jsx": "preserve",
+ "target": "es5",
+ "lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
- "moduleResolution": "node",
- "allowSy... | true |
Other | vercel | next.js | 8c5209efabdb800baf8c7612472be565a63bea01.json | Update typescript examples (#7867)
* Updated with-jest-typescript
* Updated the mobx-state-tree-typescript example
* Removed the sitemap with typescript example
* Updated the with css typings example | examples/with-mobx-state-tree-typescript/tslint.json | @@ -1,44 +0,0 @@
-{
- "extends": ["tslint-config-standard", "tslint:latest", "tslint-react"],
- "rules": {
- "indent": [true, "spaces"],
- "jsx-no-lambda": false,
- "jsx-no-multiline-js": false,
- "max-line-length": false,
- "no-console": false,
- "no-object-literal-type-assertion": false,
- "no-... | true |
Other | vercel | next.js | 8c5209efabdb800baf8c7612472be565a63bea01.json | Update typescript examples (#7867)
* Updated with-jest-typescript
* Updated the mobx-state-tree-typescript example
* Removed the sitemap with typescript example
* Updated the with css typings example | examples/with-sitemap-and-robots-express-server-typescript/.babelrc | @@ -1,6 +0,0 @@
-{
- "presets": [
- "next/babel",
- "@zeit/next-typescript/babel"
- ]
-} | true |
Other | vercel | next.js | 8c5209efabdb800baf8c7612472be565a63bea01.json | Update typescript examples (#7867)
* Updated with-jest-typescript
* Updated the mobx-state-tree-typescript example
* Removed the sitemap with typescript example
* Updated the with css typings example | examples/with-sitemap-and-robots-express-server-typescript/.gitignore | @@ -1,16 +0,0 @@
-*~
-*.swp
-tmp/
-npm-debug.log
-.DS_Store
-
-
-.build/*
-.next
-.vscode/
-node_modules/
-.coverage
-.env
-.next
-
-yarn-error.log
\ No newline at end of file | true |
Other | vercel | next.js | 8c5209efabdb800baf8c7612472be565a63bea01.json | Update typescript examples (#7867)
* Updated with-jest-typescript
* Updated the mobx-state-tree-typescript example
* Removed the sitemap with typescript example
* Updated the with css typings example | examples/with-sitemap-and-robots-express-server-typescript/.npmignore | @@ -1,10 +0,0 @@
-.build/
-.next/
-.vscode/
-node_modules/
-
-README.md
-
-.env
-.eslintrc.js
-.gitignore
\ No newline at end of file | true |
Other | vercel | next.js | 8c5209efabdb800baf8c7612472be565a63bea01.json | Update typescript examples (#7867)
* Updated with-jest-typescript
* Updated the mobx-state-tree-typescript example
* Removed the sitemap with typescript example
* Updated the with css typings example | examples/with-sitemap-and-robots-express-server-typescript/README.md | @@ -1,75 +0,0 @@
-# Example with sitemap.xml and robots.txt using Express server and typescript
-
-## How to use
-
-### Using `create-next-app`
-
-Execute [`create-next-app`](https://github.com/segmentio/create-next-app) with [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) or [npx](https://github.com/zkat/npx#read... | true |
Other | vercel | next.js | 8c5209efabdb800baf8c7612472be565a63bea01.json | Update typescript examples (#7867)
* Updated with-jest-typescript
* Updated the mobx-state-tree-typescript example
* Removed the sitemap with typescript example
* Updated the with css typings example | examples/with-sitemap-and-robots-express-server-typescript/now.json | @@ -1,12 +0,0 @@
-{
- "env": {
- "NODE_ENV": "production"
- },
- "scale": {
- "sfo1": {
- "min": 1,
- "max": 1
- }
- },
- "alias": "https://sitemap-robots-typescript.now.sh"
-} | true |
Other | vercel | next.js | 8c5209efabdb800baf8c7612472be565a63bea01.json | Update typescript examples (#7867)
* Updated with-jest-typescript
* Updated the mobx-state-tree-typescript example
* Removed the sitemap with typescript example
* Updated the with css typings example | examples/with-sitemap-and-robots-express-server-typescript/package.json | @@ -1,34 +0,0 @@
-{
- "name": "with-sitemap-and-robots-express-server-typescript",
- "version": "1.0.0",
- "license": "MIT",
- "scripts": {
- "build-ts": "tsc -p tsconfig.next.json && tsc -p tsconfig.express.json",
- "build-static": "npx copyfiles -u 1 \"src/static/**/*\" dist",
- "build-next": "next build... | true |
Other | vercel | next.js | 8c5209efabdb800baf8c7612472be565a63bea01.json | Update typescript examples (#7867)
* Updated with-jest-typescript
* Updated the mobx-state-tree-typescript example
* Removed the sitemap with typescript example
* Updated the with css typings example | examples/with-sitemap-and-robots-express-server-typescript/src/components/RobotsLink.tsx | @@ -1,9 +0,0 @@
-const RobotsLink = () => {
- return (
- <a href="/robots.txt" target="_blank">
- Robots
- </a>
- )
-}
-
-export { RobotsLink } | true |
Other | vercel | next.js | 8c5209efabdb800baf8c7612472be565a63bea01.json | Update typescript examples (#7867)
* Updated with-jest-typescript
* Updated the mobx-state-tree-typescript example
* Removed the sitemap with typescript example
* Updated the with css typings example | examples/with-sitemap-and-robots-express-server-typescript/src/components/SitemapLink.tsx | @@ -1,9 +0,0 @@
-const SitemapLink = () => {
- return (
- <a href="/sitemap.xml" target="_blank">
- Sitemap
- </a>
- )
-}
-
-export { SitemapLink } | true |
Other | vercel | next.js | 8c5209efabdb800baf8c7612472be565a63bea01.json | Update typescript examples (#7867)
* Updated with-jest-typescript
* Updated the mobx-state-tree-typescript example
* Removed the sitemap with typescript example
* Updated the with css typings example | examples/with-sitemap-and-robots-express-server-typescript/src/pages/index.tsx | @@ -1,22 +0,0 @@
-import Head from 'next/head'
-import React from 'react'
-import { RobotsLink } from '../components/RobotsLink'
-import { SitemapLink } from '../components/SitemapLink'
-
-function Index() {
- return (
- <div style={{ padding: '10px 45px' }}>
- <Head>
- <title>Index page</title>
- ... | true |
Other | vercel | next.js | 8c5209efabdb800baf8c7612472be565a63bea01.json | Update typescript examples (#7867)
* Updated with-jest-typescript
* Updated the mobx-state-tree-typescript example
* Removed the sitemap with typescript example
* Updated the with css typings example | examples/with-sitemap-and-robots-express-server-typescript/src/public/robots.txt | @@ -1,10 +0,0 @@
-User-agent: *
-Allow: /a
-Allow: /b
-Allow: /posts/*
-Disallow: /
-Disallow: /a/*
-Disallow: /b/*
-Disallow: /posts
-
-Sitemap: https://sitemap-robots.now.sh/sitemap.xml
\ No newline at end of file | true |
Other | vercel | next.js | 8c5209efabdb800baf8c7612472be565a63bea01.json | Update typescript examples (#7867)
* Updated with-jest-typescript
* Updated the mobx-state-tree-typescript example
* Removed the sitemap with typescript example
* Updated the with css typings example | examples/with-sitemap-and-robots-express-server-typescript/src/server/app.ts | @@ -1,31 +0,0 @@
-import * as express from 'express'
-import * as next from 'next'
-import { addSitemap } from './sitemap'
-
-const dev = process.env.NODE_ENV !== 'production'
-const port = process.env.PORT || 8000
-const ROOT_URL = dev
- ? `http://localhost:${port}`
- : 'https://sitemap-robots-typescript.now.sh'
-
-... | true |
Other | vercel | next.js | 8c5209efabdb800baf8c7612472be565a63bea01.json | Update typescript examples (#7867)
* Updated with-jest-typescript
* Updated the mobx-state-tree-typescript example
* Removed the sitemap with typescript example
* Updated the with css typings example | examples/with-sitemap-and-robots-express-server-typescript/src/server/posts.ts | @@ -1,16 +0,0 @@
-interface IPost {
- name: string
- slug: string
-}
-
-const posts = () => {
- const arrayOfPosts: IPost[] = []
- const n = 5
-
- for (let i = 1; i < n + 1; i += 1) {
- arrayOfPosts.push({ name: `Post ${i}`, slug: `post-${i}` })
- }
- return arrayOfPosts
-}
-
-export { IPost, posts } | true |
Other | vercel | next.js | 8c5209efabdb800baf8c7612472be565a63bea01.json | Update typescript examples (#7867)
* Updated with-jest-typescript
* Updated the mobx-state-tree-typescript example
* Removed the sitemap with typescript example
* Updated the with css typings example | examples/with-sitemap-and-robots-express-server-typescript/src/server/sitemap.ts | @@ -1,45 +0,0 @@
-import * as path from 'path'
-import * as sm from 'sitemap'
-import { posts } from './posts'
-
-const sitemap = sm.createSitemap({
- cacheTime: 600000, // 600 sec - cache purge period
- hostname: 'https://sitemap-robots-typescript.now.sh'
-})
-
-const addSitemap = ({ server }) => {
- const Posts = ... | true |
Other | vercel | next.js | 8c5209efabdb800baf8c7612472be565a63bea01.json | Update typescript examples (#7867)
* Updated with-jest-typescript
* Updated the mobx-state-tree-typescript example
* Removed the sitemap with typescript example
* Updated the with css typings example | examples/with-sitemap-and-robots-express-server-typescript/tsconfig.express.json | @@ -1,25 +0,0 @@
-{
- "compileOnSave": true,
- "compilerOptions": {
- "pretty": true,
- "experimentalDecorators": true,
- "target": "es5",
- "module": "commonjs",
- "jsx": "preserve",
- "allowJs": true,
- "moduleResolution": "node",
- "allowSyntheticDefaultImports": true,
- "noImplicitThis"... | true |
Other | vercel | next.js | 8c5209efabdb800baf8c7612472be565a63bea01.json | Update typescript examples (#7867)
* Updated with-jest-typescript
* Updated the mobx-state-tree-typescript example
* Removed the sitemap with typescript example
* Updated the with css typings example | examples/with-sitemap-and-robots-express-server-typescript/tsconfig.next.json | @@ -1,26 +0,0 @@
-{
- "compileOnSave": true,
- "compilerOptions": {
- "pretty": true,
- "experimentalDecorators": true,
- "target": "esnext",
- "module": "es6",
- "jsx": "preserve",
- "allowJs": true,
- "moduleResolution": "node",
- "allowSyntheticDefaultImports": true,
- "noImplicitThis": ... | true |
Other | vercel | next.js | 8c5209efabdb800baf8c7612472be565a63bea01.json | Update typescript examples (#7867)
* Updated with-jest-typescript
* Updated the mobx-state-tree-typescript example
* Removed the sitemap with typescript example
* Updated the with css typings example | examples/with-sitemap-and-robots-express-server-typescript/tslint.json | @@ -1,44 +0,0 @@
-{
- "extends": ["tslint-config-standard", "tslint:latest", "tslint-react"],
- "rules": {
- "indent": [true, "spaces"],
- "jsx-no-lambda": false,
- "jsx-no-multiline-js": false,
- "max-line-length": false,
- "no-console": false,
- "no-object-literal-type-assertion": false,
- "no-... | true |
Other | vercel | next.js | 8c5209efabdb800baf8c7612472be565a63bea01.json | Update typescript examples (#7867)
* Updated with-jest-typescript
* Updated the mobx-state-tree-typescript example
* Removed the sitemap with typescript example
* Updated the with css typings example | examples/with-typings-for-css-modules/.babelrc | @@ -1,6 +0,0 @@
-{
- "presets": [
- "next/babel",
- "@zeit/next-typescript/babel"
- ]
-}
\ No newline at end of file | true |
Other | vercel | next.js | 8c5209efabdb800baf8c7612472be565a63bea01.json | Update typescript examples (#7867)
* Updated with-jest-typescript
* Updated the mobx-state-tree-typescript example
* Removed the sitemap with typescript example
* Updated the with css typings example | examples/with-typings-for-css-modules/README.md | @@ -39,4 +39,4 @@ now
## The idea behind the example
-This example shows how to generate type declarations for using CSS modules with TypeScript. It uses the [next-css](https://github.com/zeit/next-plugins/tree/master/packages/next-css) and [next-typescript](https://github.com/zeit/next-plugins/tree/master/package... | true |
Other | vercel | next.js | 8c5209efabdb800baf8c7612472be565a63bea01.json | Update typescript examples (#7867)
* Updated with-jest-typescript
* Updated the mobx-state-tree-typescript example
* Removed the sitemap with typescript example
* Updated the with css typings example | examples/with-typings-for-css-modules/next-env.d.ts | @@ -0,0 +1,2 @@
+/// <reference types="next" />
+/// <reference types="next/types/global" /> | true |
Other | vercel | next.js | 8c5209efabdb800baf8c7612472be565a63bea01.json | Update typescript examples (#7867)
* Updated with-jest-typescript
* Updated the mobx-state-tree-typescript example
* Removed the sitemap with typescript example
* Updated the with css typings example | examples/with-typings-for-css-modules/next.config.js | @@ -1,26 +1,24 @@
const withCSS = require('@zeit/next-css')
-const withTypescript = require('@zeit/next-typescript')
/* With additional configuration on top of CSS Modules */
-module.exports = withTypescript(
- withCSS({
- cssModules: true,
- cssLoaderOptions: {
- camelCase: true,
- namedExport: tr... | true |
Other | vercel | next.js | 8c5209efabdb800baf8c7612472be565a63bea01.json | Update typescript examples (#7867)
* Updated with-jest-typescript
* Updated the mobx-state-tree-typescript example
* Removed the sitemap with typescript example
* Updated the with css typings example | examples/with-typings-for-css-modules/package.json | @@ -10,14 +10,12 @@
},
"dependencies": {
"@zeit/next-css": "^1.0.1",
- "@zeit/next-typescript": "^1.1.1",
"next": "latest",
"react": "^16.7.0",
"react-dom": "^16.7.0",
"typings-for-css-modules-loader": "^1.7.0"
},
"devDependencies": {
- "@types/next": "7.0.2",
"@types/rea... | true |
Other | vercel | next.js | 8c5209efabdb800baf8c7612472be565a63bea01.json | Update typescript examples (#7867)
* Updated with-jest-typescript
* Updated the mobx-state-tree-typescript example
* Removed the sitemap with typescript example
* Updated the with css typings example | examples/with-typings-for-css-modules/tsconfig.json | @@ -1,18 +1,23 @@
{
"compilerOptions": {
- "target": "esnext",
- "module": "esnext",
+ "allowJs": true,
+ "alwaysStrict": true,
+ "esModuleInterop": true,
+ "forceConsistentCasingInFileNames": true,
+ "isolatedModules": true,
"jsx": "preserve",
"lib": ["dom", "es2017"],
+ "module":... | true |
Other | vercel | next.js | b430a4919e0b8611bc128f0c09ffef98b3a04899.json | Allow React.Fragment for Document styles (#7863)
* Allow React.Fragment for Document styles
Fixes https://github.com/zeit/next.js/issues/7784
Closes https://github.com/zeit/next.js/pull/7860
* Fix types
* Remove `Without` | packages/next-server/lib/utils.ts | @@ -120,7 +120,7 @@ export type DocumentContext = NextPageContext & {
}
export type DocumentInitialProps = RenderPageResult & {
- styles?: React.ReactElement[]
+ styles?: React.ReactElement[] | React.ReactFragment
}
export type DocumentProps = DocumentInitialProps & { | true |
Other | vercel | next.js | b430a4919e0b8611bc128f0c09ffef98b3a04899.json | Allow React.Fragment for Document styles (#7863)
* Allow React.Fragment for Document styles
Fixes https://github.com/zeit/next.js/issues/7784
Closes https://github.com/zeit/next.js/pull/7860
* Fix types
* Remove `Without` | packages/next/pages/_document.tsx | @@ -277,7 +277,9 @@ export class Head extends Component<
})
// try to parse styles from fragment for backwards compat
- const curStyles: React.ReactElement[] = Array.isArray(styles) ? styles : []
+ const curStyles: React.ReactElement[] = Array.isArray(styles)
+ ? (styles as React.ReactElement... | true |
Other | vercel | next.js | 437140a04831b977716ca58366882a2233e25014.json | Add UrlObject to router methods (#7859) | packages/next-server/lib/router/router.ts | @@ -2,7 +2,7 @@
// tslint:disable:no-console
import { ParsedUrlQuery } from 'querystring'
import { ComponentType } from 'react'
-import { parse } from 'url'
+import { parse, UrlObject } from 'url'
import mitt, { MittEmitter } from '../mitt'
import {
@@ -21,6 +21,8 @@ function toRoute(path: string): string {
r... | true |
Other | vercel | next.js | 437140a04831b977716ca58366882a2233e25014.json | Add UrlObject to router methods (#7859) | test/integration/typescript/pages/hello.tsx | @@ -3,6 +3,7 @@ import { hello } from '../components/hello'
import { World } from '../components/world'
export default function HelloPage(): JSX.Element {
+ // TEST: verify process.browser extension works
console.log(process.browser)
return (
<div> | true |
Other | vercel | next.js | 1d8fa3a9431af9667246cdfe2f7c7b9d1eef27fa.json | fix terminal links (cmd-click) on VSCode (#7849) | packages/next/build/output/store.ts | @@ -84,6 +84,6 @@ store.subscribe(state => {
Log.ready(
'compiled successfully' +
- (state.appUrl ? ` (ready on ${state.appUrl})` : '')
+ (state.appUrl ? ` - ready on ${state.appUrl}` : '')
)
}) | false |
Other | vercel | next.js | 66a03bf1ffe53bce24553ee40bdbdf4f674a2965.json | Add test for trailing slash on API route (#7851) | test/integration/api-support/test/index.test.js | @@ -55,7 +55,7 @@ function runTests (serverless = false) {
expect(data).toEqual([{ title: 'Nextjs' }])
})
- it('shuld return error with invalid JSON', async () => {
+ it('should return error with invalid JSON', async () => {
const data = await fetchViaHTTP(appPort, '/api/parse', null, {
method: ... | true |
Other | vercel | next.js | 66a03bf1ffe53bce24553ee40bdbdf4f674a2965.json | Add test for trailing slash on API route (#7851) | test/integration/serverless/test/index.test.js | @@ -8,6 +8,7 @@ import {
findPort,
nextBuild,
nextStart,
+ fetchViaHTTP,
renderViaHTTP
} from 'next-test-utils'
import fetch from 'node-fetch'
@@ -144,6 +145,11 @@ describe('Serverless', () => {
expect(post).toBe('post-1')
})
+ it('should 404 on API request with trailing slash', async () => {
... | true |
Other | vercel | next.js | ab0b2cf3da0c23c9041753fb86c64f6da8d4be9d.json | Add a test for module.exports from a page (#7842)
Closes https://github.com/zeit/next.js/issues/7835 | packages/next/build/utils.ts | @@ -269,7 +269,7 @@ export function isPageStatic(
try {
require('next-server/config').setConfig(runtimeEnvConfig)
const mod = require(serverBundle)
- const Comp = mod.default
+ const Comp = mod.default || mod
if (!Comp || !isValidElementType(Comp) || typeof Comp === 'string') {
throw ne... | true |
Other | vercel | next.js | ab0b2cf3da0c23c9041753fb86c64f6da8d4be9d.json | Add a test for module.exports from a page (#7842)
Closes https://github.com/zeit/next.js/issues/7835 | test/integration/auto-export/pages/[post].js | @@ -0,0 +1,7 @@
+import { useRouter } from 'next/router'
+
+export default () => {
+ const { query } = useRouter()
+
+ return <p>post: {query.post}</p>
+} | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.