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 | 9a0fc42d5689ca4ee9d44ef46be4ac7c461758e1.json | Fix ie11 support with webpack 5 (#25014)
This fixes ie11 compatibility that broke in https://github.com/vercel/next.js/pull/24656 from the polyfills not being loaded first, our existing ie11 test caught this but was failing, this ensures the test is passing again. This also updates the `hrefValue` optional chaining in... | packages/eslint-plugin-next/lib/rules/google-font-display.js | @@ -23,9 +23,9 @@ module.exports = {
}
const hrefValue = attributes.value('href')
- const isGoogleFont = hrefValue?.startsWith(
- 'https://fonts.googleapis.com/css'
- )
+ const isGoogleFont =
+ typeof hrefValue === 'string' &&
+ hrefValue.startsWith('h... | true |
Other | vercel | next.js | 9a0fc42d5689ca4ee9d44ef46be4ac7c461758e1.json | Fix ie11 support with webpack 5 (#25014)
This fixes ie11 compatibility that broke in https://github.com/vercel/next.js/pull/24656 from the polyfills not being loaded first, our existing ie11 test caught this but was failing, this ensures the test is passing again. This also updates the `hrefValue` optional chaining in... | packages/eslint-plugin-next/lib/rules/google-font-preconnect.js | @@ -26,7 +26,8 @@ module.exports = {
attributes.value('rel') !== 'preconnect'
if (
- hrefValue?.startsWith('https://fonts.gstatic.com') &&
+ typeof hrefValue === 'string' &&
+ hrefValue.startsWith('https://fonts.gstatic.com') &&
preconnectMissing
) {
... | true |
Other | vercel | next.js | 9a0fc42d5689ca4ee9d44ef46be4ac7c461758e1.json | Fix ie11 support with webpack 5 (#25014)
This fixes ie11 compatibility that broke in https://github.com/vercel/next.js/pull/24656 from the polyfills not being loaded first, our existing ie11 test caught this but was failing, this ensures the test is passing again. This also updates the `hrefValue` optional chaining in... | packages/eslint-plugin-next/lib/rules/no-page-custom-font.js | @@ -38,9 +38,9 @@ module.exports = {
}
const hrefValue = attributes.value('href')
- const isGoogleFont = hrefValue?.startsWith(
- 'https://fonts.googleapis.com/css'
- )
+ const isGoogleFont =
+ typeof hrefValue === 'string' &&
+ hrefValue.startsWith('h... | true |
Other | vercel | next.js | 9a0fc42d5689ca4ee9d44ef46be4ac7c461758e1.json | Fix ie11 support with webpack 5 (#25014)
This fixes ie11 compatibility that broke in https://github.com/vercel/next.js/pull/24656 from the polyfills not being loaded first, our existing ie11 test caught this but was failing, this ensures the test is passing again. This also updates the `hrefValue` optional chaining in... | packages/next/build/webpack-config.ts | @@ -503,7 +503,7 @@ export default async function getBaseWebpackConfig(
// and all other chunk depend on them so there is no
// duplication that need to be pulled out.
chunks: isWebpack5
- ? (chunk) => !/^(main|pages\/_app)$/.test(chunk.name)
+ ? (chunk) => !/^(polyfills|main|pages\/_... | true |
Other | vercel | next.js | b43e996e3fb75e64dc180b94f10a5cc67a027406.json | Update windows tests to use node 12 (#25015)
Since node v10 is now officially EOL this updates our windows tests to use v12 instead | azure-pipelines.yml | @@ -34,7 +34,7 @@ pr:
variables:
YARN_CACHE_FOLDER: $(Pipeline.Workspace)/.yarn
NEXT_TELEMETRY_DISABLED: '1'
- node_version: ^10.10.0
+ node_version: ^12.0.0
stages:
- stage: Build | false |
Other | vercel | next.js | 2f142b622f599dfab674dde9805c952abd783321.json | fix typo in path (#24978) | errors/no-page-custom-font.md | @@ -6,7 +6,7 @@ A custom font was added to a page and not with a custom `Document`. This only ad
### Possible Ways to Fix It
-Create the file `./pages/document.js` and add the font to a custom Document:
+Create the file `./pages/_document.js` and add the font to a custom Document:
```jsx
// pages/_document.js | false |
Other | vercel | next.js | 6d0150f02e750a71a3cf1c8d570f380008d68f2f.json | ESLint Plugin: Prevent bad imports of next/document and next/head (#24832)
Adds lint rules to the Next.js ESLint plugin to:
- Disallow importing `next/head` inside `pages/_document.js`
- Disallow importing `next/document` outside of `pages/_document.js`
Both rules will be surfaced as **errors** within the recommende... | errors/manifest.json | @@ -255,6 +255,10 @@
},
{ "title": "no-cache", "path": "/errors/no-cache.md" },
{ "title": "no-css-tags", "path": "/errors/no-css-tags.md" },
+ {
+ "title": "no-document-import-in-page",
+ "path": "/errors/no-document-import-in-page.md"
+ },
{
... | true |
Other | vercel | next.js | 6d0150f02e750a71a3cf1c8d570f380008d68f2f.json | ESLint Plugin: Prevent bad imports of next/document and next/head (#24832)
Adds lint rules to the Next.js ESLint plugin to:
- Disallow importing `next/head` inside `pages/_document.js`
- Disallow importing `next/document` outside of `pages/_document.js`
Both rules will be surfaced as **errors** within the recommende... | errors/no-document-import-in-page.md | @@ -0,0 +1,24 @@
+# No Document Import in Page
+
+### Why This Error Occurred
+
+`next/document` was imported in a page outside of `pages/_document.js`. This can cause unexpected issues in your application.
+
+### Possible Ways to Fix It
+
+Only import and use `next/document` within `pages/_document.js` to override the... | true |
Other | vercel | next.js | 6d0150f02e750a71a3cf1c8d570f380008d68f2f.json | ESLint Plugin: Prevent bad imports of next/document and next/head (#24832)
Adds lint rules to the Next.js ESLint plugin to:
- Disallow importing `next/head` inside `pages/_document.js`
- Disallow importing `next/document` outside of `pages/_document.js`
Both rules will be surfaced as **errors** within the recommende... | errors/no-head-import-in-document.md | @@ -0,0 +1,34 @@
+# No Head Import in Document
+
+### Why This Error Occurred
+
+`next/head` was imported in `pages/_document.js`. This can cause unexpected issues in your application.
+
+### Possible Ways to Fix It
+
+Only import and use `next/document` within `pages/_document.js` to override the default `Document` co... | true |
Other | vercel | next.js | 6d0150f02e750a71a3cf1c8d570f380008d68f2f.json | ESLint Plugin: Prevent bad imports of next/document and next/head (#24832)
Adds lint rules to the Next.js ESLint plugin to:
- Disallow importing `next/head` inside `pages/_document.js`
- Disallow importing `next/document` outside of `pages/_document.js`
Both rules will be surfaced as **errors** within the recommende... | packages/eslint-plugin-next/lib/index.js | @@ -9,6 +9,8 @@ module.exports = {
'google-font-display': require('./rules/google-font-display'),
'google-font-preconnect': require('./rules/google-font-preconnect'),
'link-passhref': require('./rules/link-passhref'),
+ 'no-document-import-in-page': require('./rules/no-document-import-in-page'),
+ ... | true |
Other | vercel | next.js | 6d0150f02e750a71a3cf1c8d570f380008d68f2f.json | ESLint Plugin: Prevent bad imports of next/document and next/head (#24832)
Adds lint rules to the Next.js ESLint plugin to:
- Disallow importing `next/head` inside `pages/_document.js`
- Disallow importing `next/document` outside of `pages/_document.js`
Both rules will be surfaced as **errors** within the recommende... | packages/eslint-plugin-next/lib/rules/no-document-import-in-page.js | @@ -0,0 +1,30 @@
+const path = require('path')
+
+module.exports = {
+ meta: {
+ docs: {
+ description:
+ 'Disallow importing next/document outside of pages/document.js',
+ recommended: true,
+ },
+ },
+ create: function (context) {
+ return {
+ ImportDeclaration(node) {
+ if (n... | true |
Other | vercel | next.js | 6d0150f02e750a71a3cf1c8d570f380008d68f2f.json | ESLint Plugin: Prevent bad imports of next/document and next/head (#24832)
Adds lint rules to the Next.js ESLint plugin to:
- Disallow importing `next/head` inside `pages/_document.js`
- Disallow importing `next/document` outside of `pages/_document.js`
Both rules will be surfaced as **errors** within the recommende... | packages/eslint-plugin-next/lib/rules/no-head-import-in-document.js | @@ -0,0 +1,29 @@
+const path = require('path')
+
+module.exports = {
+ meta: {
+ docs: {
+ description: 'Disallow importing next/head in pages/document.js',
+ recommended: true,
+ },
+ },
+ create: function (context) {
+ return {
+ ImportDeclaration(node) {
+ if (node.source.value !== ... | true |
Other | vercel | next.js | 6d0150f02e750a71a3cf1c8d570f380008d68f2f.json | ESLint Plugin: Prevent bad imports of next/document and next/head (#24832)
Adds lint rules to the Next.js ESLint plugin to:
- Disallow importing `next/head` inside `pages/_document.js`
- Disallow importing `next/document` outside of `pages/_document.js`
Both rules will be surfaced as **errors** within the recommende... | test/eslint-plugin-next/no-document-import-in-page.unit.test.js | @@ -0,0 +1,66 @@
+const rule = require('@next/eslint-plugin-next/lib/rules/no-document-import-in-page')
+
+const RuleTester = require('eslint').RuleTester
+
+RuleTester.setDefaultConfig({
+ parserOptions: {
+ ecmaVersion: 2018,
+ sourceType: 'module',
+ ecmaFeatures: {
+ modules: true,
+ jsx: true,
... | true |
Other | vercel | next.js | 6d0150f02e750a71a3cf1c8d570f380008d68f2f.json | ESLint Plugin: Prevent bad imports of next/document and next/head (#24832)
Adds lint rules to the Next.js ESLint plugin to:
- Disallow importing `next/head` inside `pages/_document.js`
- Disallow importing `next/document` outside of `pages/_document.js`
Both rules will be surfaced as **errors** within the recommende... | test/eslint-plugin-next/no-head-import-in-document.unit.test.js | @@ -0,0 +1,88 @@
+const rule = require('@next/eslint-plugin-next/lib/rules/no-head-import-in-document')
+
+const RuleTester = require('eslint').RuleTester
+
+RuleTester.setDefaultConfig({
+ parserOptions: {
+ ecmaVersion: 2018,
+ sourceType: 'module',
+ ecmaFeatures: {
+ modules: true,
+ jsx: true,
... | true |
Other | vercel | next.js | 14eee3d091f1878ed5cb2ac1b425b017fe961c1c.json | Add label for chrome automatically to PR | .github/labeler.json | @@ -8,6 +8,14 @@
"packages/react-dev-overlay/**",
"packages/react-refresh-utils/**",
"packages/next-codemod/**"
+ ],
+ "type: chrome": [
+ { "type": "user", "pattern": "spanicker" },
+ { "type": "user", "pattern": "housseindjirdeh" },
+ { "type": "user", "pattern": "devknoll" }... | false |
Other | vercel | next.js | 7f1c8a9bbe440e50190f0c3b287f62266a0debe5.json | fix: handle compression for custom-server render calls (#16378) (#18891)
Co-authored-by: Radosław Grochowski <radoslaw.grochowski@grupawp.pl>
Co-authored-by: Tim Neutkens <timneutkens@me.com> | packages/next/next-server/server/next-server.ts | @@ -1315,6 +1315,11 @@ export default class Server {
return this.handleRequest(req, res, parsedUrl)
}
+ // Custom server users can run `app.render()` which needs compression.
+ if (this.renderOpts.customServer) {
+ this.handleCompression(req, res)
+ }
+
if (isBlockedPage(pathname)) {
... | true |
Other | vercel | next.js | 7f1c8a9bbe440e50190f0c3b287f62266a0debe5.json | fix: handle compression for custom-server render calls (#16378) (#18891)
Co-authored-by: Radosław Grochowski <radoslaw.grochowski@grupawp.pl>
Co-authored-by: Tim Neutkens <timneutkens@me.com> | test/integration/custom-server/test/index.test.js | @@ -183,4 +183,17 @@ describe('Custom Server', () => {
expect(stderr).toContain('Cannot render page with path "dashboard"')
})
})
+
+ describe('compression handling', function () {
+ beforeAll(() => startServer())
+ afterAll(() => killApp(server))
+
+ it.each(['/', '/no-query'])(
+ 'should... | true |
Other | vercel | next.js | e84537f88e8d2209e858591e9711521ee6777b1c.json | add NextWebVitalsMetric type for reportWebVitals (#14675)
Fixes: #13512
Defined and exported type for `metric` used in [reportWebVitals](https://nextjs.org/docs/advanced-features/measuring-performance)
```
export function reportWebVitals(metric) {
if (metric.label === 'custom') {
console.log(metric) // The met... | docs/advanced-features/measuring-performance.md | @@ -170,3 +170,23 @@ export function reportWebVitals(metric) {
> ```
>
> Read more about sending results to Google Analytics [here](https://github.com/GoogleChrome/web-vitals#send-the-results-to-google-analytics).
+
+## TypeScript
+
+If you are using TypeScript, you can use the built-in type `NextWebVitalsMetric`:
+... | true |
Other | vercel | next.js | e84537f88e8d2209e858591e9711521ee6777b1c.json | add NextWebVitalsMetric type for reportWebVitals (#14675)
Fixes: #13512
Defined and exported type for `metric` used in [reportWebVitals](https://nextjs.org/docs/advanced-features/measuring-performance)
```
export function reportWebVitals(metric) {
if (metric.label === 'custom') {
console.log(metric) // The met... | packages/next/next-server/lib/utils.ts | @@ -45,6 +45,18 @@ export type AppTreeType = ComponentType<
AppInitialProps & { [name: string]: any }
>
+/**
+ * Web vitals provided to _app.reportWebVitals by Core Web Vitals plugin developed by Google Chrome team.
+ * https://nextjs.org/blog/next-9-4#integrated-web-vitals-reporting
+ */
+export type NextWebVita... | true |
Other | vercel | next.js | e84537f88e8d2209e858591e9711521ee6777b1c.json | add NextWebVitalsMetric type for reportWebVitals (#14675)
Fixes: #13512
Defined and exported type for `metric` used in [reportWebVitals](https://nextjs.org/docs/advanced-features/measuring-performance)
```
export function reportWebVitals(metric) {
if (metric.label === 'custom') {
console.log(metric) // The met... | packages/next/pages/_app.tsx | @@ -5,11 +5,14 @@ import {
AppContextType,
AppInitialProps,
AppPropsType,
+ NextWebVitalsMetric,
} from '../next-server/lib/utils'
import { Router } from '../client/router'
export { AppInitialProps }
+export { NextWebVitalsMetric }
+
export type AppContext = AppContextType<Router>
export type AppPr... | true |
Other | vercel | next.js | a0c683208abdce84934061f6efd2b90de52d99b9.json | Fix URL being updated with basePath for 404 page (#14740)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> | packages/next/client/index.js | @@ -49,7 +49,19 @@ envConfig.setConfig({
publicRuntimeConfig: runtimeConfig || {},
})
-const asPath = delBasePath(getURL())
+let asPath = getURL()
+
+// make sure not to attempt stripping basePath for 404s
+if (
+ page !== '/404' &&
+ !(
+ page === '/_error' &&
+ hydrateProps &&
+ hydrateProps.pageProp... | true |
Other | vercel | next.js | a0c683208abdce84934061f6efd2b90de52d99b9.json | Fix URL being updated with basePath for 404 page (#14740)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> | packages/next/next-server/lib/router/router.ts | @@ -241,10 +241,11 @@ export default class Router implements BaseRouter {
if (as.substr(0, 2) !== '//') {
// in order for `e.state` to work on the `onpopstate` event
// we have to register the initial route upon initialization
+
this.changeState(
'replaceState',
f... | true |
Other | vercel | next.js | a0c683208abdce84934061f6efd2b90de52d99b9.json | Fix URL being updated with basePath for 404 page (#14740)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> | test/integration/basepath/test/index.test.js | @@ -116,6 +116,12 @@ const runTests = (context, dev = false) => {
})
}
+ it('should not update URL for a 404', async () => {
+ const browser = await webdriver(context.appPort, '/missing')
+ const pathname = await browser.eval(() => window.location.pathname)
+ expect(pathname).toBe('/missing')
+ })
... | true |
Other | vercel | next.js | dd97c984b2627be87a0bb37aab88fbcd037621fc.json | Convert link to function component (#14633)
Convert `Link` to a function component. Prefetch logic and memoized url formatting now meshes nicely with React hooks. Class methods were hoisted to module scope to preserve performance characteristics. | packages/next/client/link.tsx | @@ -1,6 +1,6 @@
declare const __NEXT_DATA__: any
-import React, { Children, Component } from 'react'
+import React, { Children } from 'react'
import { parse, resolve, UrlObject } from 'url'
import { PrefetchOptions } from '../next-server/lib/router/router'
import {
@@ -22,24 +22,6 @@ function isLocal(href: string... | false |
Other | vercel | next.js | 098d77c3163fe9792e8367f51d2a7f1a323910e3.json | fix extra char in readme cms-sanity (#14725)
Fix super minor typo in cms-sanity example readme | examples/cms-sanity/README.md | @@ -23,7 +23,7 @@ Once you have access to [the environment variables you'll need](#step-4-set-up-e
- [Agility CMS](/examples/cms-agilitycms)
- [Cosmic](/examples/cms-cosmic)
- [ButterCMS](/examples/cms-buttercms)
-- [Storyblok](/examples/cms-storyblok)f
+- [Storyblok](/examples/cms-storyblok)
- [GraphCMS](/examples... | false |
Other | vercel | next.js | 2ad0b5ba4aa7e66b71b616b94893609bc58e8160.json | Fix NextSeo example (#14643) | examples/with-next-seo/pages/index.js | @@ -5,31 +5,29 @@ export default function Home() {
return (
<div>
<NextSeo
- config={{
- title: 'Page Meta Title',
- description: 'This will be the page meta description',
- canonical: 'https://www.canonicalurl.ie/',
- openGraph: {
- url: 'https://www... | false |
Other | vercel | next.js | ac5b2acd12f061c2a7cfeee414bad4f80212c7c6.json | Fix dynamic route encoding for NextLinks (#14281) | packages/next/package.json | @@ -90,7 +90,7 @@
"loader-utils": "2.0.0",
"mini-css-extract-plugin": "0.8.0",
"mkdirp": "0.5.3",
- "native-url": "0.3.3",
+ "native-url": "0.3.4",
"neo-async": "2.6.1",
"pnp-webpack-plugin": "1.6.4",
"postcss": "7.0.29", | true |
Other | vercel | next.js | ac5b2acd12f061c2a7cfeee414bad4f80212c7c6.json | Fix dynamic route encoding for NextLinks (#14281) | test/integration/link-with-encoding/pages/index.js | @@ -0,0 +1,36 @@
+import Link from 'next/link'
+
+const Home = () => (
+ <div>
+ <Link href="/single/[slug]" as={encodeURI('/single/hello world ')}>
+ <a id="single-spaces">Single: Spaces</a>
+ </Link>
+ <br />
+ <Link href="/single/[slug]" as={encodeURI('/single/hello%world')}>
+ <a id="single-p... | true |
Other | vercel | next.js | ac5b2acd12f061c2a7cfeee414bad4f80212c7c6.json | Fix dynamic route encoding for NextLinks (#14281) | test/integration/link-with-encoding/pages/single/[slug].js | @@ -0,0 +1,7 @@
+export function getServerSideProps({ params: { slug } }) {
+ return { props: { slug } }
+}
+
+export default function Single(props) {
+ return <pre id="query-content">{JSON.stringify(props)}</pre>
+} | true |
Other | vercel | next.js | ac5b2acd12f061c2a7cfeee414bad4f80212c7c6.json | Fix dynamic route encoding for NextLinks (#14281) | test/integration/link-with-encoding/test/index.test.js | @@ -0,0 +1,299 @@
+/* eslint-env jest */
+
+import { findPort, killApp, launchApp, waitFor, check } from 'next-test-utils'
+import webdriver from 'next-webdriver'
+import { join } from 'path'
+
+jest.setTimeout(1000 * 60 * 2)
+
+const appDir = join(__dirname, '..')
+
+let appPort
+let app
+
+describe('Link Component wi... | true |
Other | vercel | next.js | ac5b2acd12f061c2a7cfeee414bad4f80212c7c6.json | Fix dynamic route encoding for NextLinks (#14281) | yarn.lock | @@ -10648,10 +10648,10 @@ native-or-bluebird@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/native-or-bluebird/-/native-or-bluebird-1.2.0.tgz#39c47bfd7825d1fb9ffad32210ae25daadf101c9"
-native-url@0.3.3:
- version "0.3.3"
- resolved "https://registry.yarnpkg.com/native-url/-/native-url-0.3.3.tg... | true |
Other | vercel | next.js | 1aed9eaac18bced087ac36f9916409ee09c271e9.json | Introduce react profiling production flag (#13873)
Closes [13709](https://github.com/vercel/next.js/issues/13709).
The solution works, **(tested and confirmed with true and false flags with the latest next version)** though I am quite sure this is not the most elegant and proper way to implement it. I have spent the ... | packages/next/build/webpack-config.ts | @@ -272,6 +272,15 @@ export default async function getBaseWebpackConfig(
resolvedBaseUrl = path.resolve(dir, jsConfig.compilerOptions.baseUrl)
}
+ function getReactProfilingInProduction() {
+ if (config.reactProductionProfiling) {
+ return {
+ 'react-dom$': 'react-dom/profiling',
+ 'sch... | true |
Other | vercel | next.js | 1aed9eaac18bced087ac36f9916409ee09c271e9.json | Introduce react profiling production flag (#13873)
Closes [13709](https://github.com/vercel/next.js/issues/13709).
The solution works, **(tested and confirmed with true and false flags with the latest next version)** though I am quite sure this is not the most elegant and proper way to implement it. I have spent the ... | packages/next/next-server/server/config.ts | @@ -50,6 +50,7 @@ const defaultConfig: { [key: string]: any } = {
profiling: false,
sprFlushToDisk: true,
reactMode: 'legacy',
+ reactProductionProfiling: false,
workerThreads: false,
pageEnv: false,
productionBrowserSourceMaps: false, | true |
Other | vercel | next.js | 1aed9eaac18bced087ac36f9916409ee09c271e9.json | Introduce react profiling production flag (#13873)
Closes [13709](https://github.com/vercel/next.js/issues/13709).
The solution works, **(tested and confirmed with true and false flags with the latest next version)** though I am quite sure this is not the most elegant and proper way to implement it. I have spent the ... | test/integration/react-profiling-mode/pages/index.js | @@ -0,0 +1,17 @@
+import React from 'react'
+
+const Index = () => {
+ return (
+ <React.Profiler
+ id="hello"
+ onRender={(...res) => {
+ window.profileResults = window.profileResults || []
+ window.profileResults.push(res)
+ }}
+ >
+ <p>hello world</p>
+ </React.Profiler>
+... | true |
Other | vercel | next.js | 1aed9eaac18bced087ac36f9916409ee09c271e9.json | Introduce react profiling production flag (#13873)
Closes [13709](https://github.com/vercel/next.js/issues/13709).
The solution works, **(tested and confirmed with true and false flags with the latest next version)** though I am quite sure this is not the most elegant and proper way to implement it. I have spent the ... | test/integration/react-profiling-mode/test/index.test.js | @@ -0,0 +1,60 @@
+/* eslint-env jest */
+
+import fs from 'fs-extra'
+import { join } from 'path'
+import webdriver from 'next-webdriver'
+import { nextBuild, nextStart, findPort, killApp } from 'next-test-utils'
+
+jest.setTimeout(1000 * 60 * 2)
+
+const appDir = join(__dirname, '..')
+const nextConfig = join(appDir, ... | true |
Other | vercel | next.js | b4b68c0b853d11beb23c6520011fe05fc169dced.json | Use assetEmitted hook instead of afterEmit (#14626)
Makes sure this works correctly with webpack 5. | packages/next/build/webpack/plugins/nextjs-require-cache-hot-reloader.ts | @@ -1,6 +1,8 @@
-import { Compiler, Plugin } from 'webpack'
+import { Compiler, Plugin, version } from 'webpack'
import { realpathSync } from 'fs'
+const isWebpack5 = parseInt(version!) === 5
+
function deleteCache(path: string) {
try {
delete require.cache[realpathSync(path)]
@@ -11,30 +13,56 @@ function d... | false |
Other | vercel | next.js | 166834e578461de1400ae145f2a20f050f8130ec.json | Update the passHref link (#14584)
Keeping up with section headers in markdown is fun :)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> | docs/api-reference/next/link.md | @@ -44,7 +44,7 @@ export default Home
- `href` - The path inside `pages` directory. This is the only required prop
- `as` - The path that will be rendered in the browser URL bar. Used for dynamic routes
-- [`passHref`](#forcing-Link-to-expose-href-to-its-child) - Forces `Link` to send the `href` property to its chi... | false |
Other | vercel | next.js | 87bb11c98cc288c4fbeb6d9da09808a8c8eaa40e.json | Remove next-cookies and prop-types (#14579) | examples/with-firebase-authentication/package.json | @@ -7,15 +7,13 @@
"start": "next start"
},
"dependencies": {
- "firebase": "^7.6.1",
- "firebase-admin": "^8.9.0",
+ "firebase": "^7.15.5",
+ "firebase-admin": "^8.12.1",
"js-cookie": "2.2.1",
"next": "latest",
- "next-cookies": "2.0.3",
- "prop-types": "15.7.2",
- "react": "^1... | false |
Other | vercel | next.js | ae542b852533551f1f59028cd5f454046172e5b1.json | Use entry option instead of custom make hook (#14527)
Simplifies on-demand-entries a bit. | packages/next/build/webpack-config.ts | @@ -694,11 +694,15 @@ export default async function getBaseWebpackConfig(
: {}),
}
},
+ watchOptions: {
+ ignored: ['.git/**', 'node_modules/**', '.git/**'],
+ },
output: {
path: outputPath,
// On the server we don't use the chunkhash
filename: dev || isServer... | true |
Other | vercel | next.js | ae542b852533551f1f59028cd5f454046172e5b1.json | Use entry option instead of custom make hook (#14527)
Simplifies on-demand-entries a bit. | packages/next/build/webpack/plugins/build-manifest-plugin.ts | @@ -41,7 +41,8 @@ function generateClientManifest(
}
function isJsFile(file: string): boolean {
- return file.endsWith('.js')
+ // We don't want to include `.hot-update.js` files into the initial page
+ return !file.endsWith('.hot-update.js') && file.endsWith('.js')
}
// This plugin creates a build-manifest.... | true |
Other | vercel | next.js | ae542b852533551f1f59028cd5f454046172e5b1.json | Use entry option instead of custom make hook (#14527)
Simplifies on-demand-entries a bit. | packages/next/build/webpack/plugins/unlink-removed-pages-plugin.ts | @@ -1,36 +0,0 @@
-import { join } from 'path'
-import { promises } from 'fs'
-import { Compiler } from 'webpack'
-import getRouteFromEntrypoint from '../../../next-server/server/get-route-from-entrypoint'
-// Makes sure removed pages are removed from `.next` in development
-export class UnlinkRemovedPagesPlugin {
- pr... | true |
Other | vercel | next.js | ae542b852533551f1f59028cd5f454046172e5b1.json | Use entry option instead of custom make hook (#14527)
Simplifies on-demand-entries a bit. | packages/next/compiled/webpack-dev-middleware/LICENSE | @@ -1,20 +0,0 @@
-Copyright JS Foundation and other contributors
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-'Software'), to deal in the Software without restriction, including
-without limitation the rights to use, copy, mod... | true |
Other | vercel | next.js | ae542b852533551f1f59028cd5f454046172e5b1.json | Use entry option instead of custom make hook (#14527)
Simplifies on-demand-entries a bit. | packages/next/compiled/webpack-dev-middleware/index.js | @@ -1 +0,0 @@
-module.exports=function(e,i){"use strict";var t={};function __webpack_require__(i){if(t[i]){return t[i].exports}var n=t[i]={i:i,l:false,exports:{}};e[i].call(n.exports,n,n.exports,__webpack_require__);n.l=true;return n.exports}__webpack_require__.ab=__dirname+"/";function startup(){return __webpack_requi... | true |
Other | vercel | next.js | ae542b852533551f1f59028cd5f454046172e5b1.json | Use entry option instead of custom make hook (#14527)
Simplifies on-demand-entries a bit. | packages/next/compiled/webpack-dev-middleware/package.json | @@ -1 +0,0 @@
-{"name":"webpack-dev-middleware","main":"index.js","author":"Tobias Koppers @sokra","license":"MIT"} | true |
Other | vercel | next.js | ae542b852533551f1f59028cd5f454046172e5b1.json | Use entry option instead of custom make hook (#14527)
Simplifies on-demand-entries a bit. | packages/next/package.json | @@ -151,7 +151,6 @@
"@types/styled-jsx": "2.2.8",
"@types/terser-webpack-plugin": "2.2.0",
"@types/text-table": "0.2.1",
- "@types/webpack-dev-middleware": "2.0.3",
"@types/webpack-hot-middleware": "2.16.5",
"@types/webpack-sources": "0.1.5",
"@zeit/ncc": "0.22.0",
@@ -213,7 +212,6 @@
... | true |
Other | vercel | next.js | ae542b852533551f1f59028cd5f454046172e5b1.json | Use entry option instead of custom make hook (#14527)
Simplifies on-demand-entries a bit. | packages/next/server/hot-reloader.ts | @@ -1,7 +1,6 @@
import { getOverlayMiddleware } from '@next/react-dev-overlay/lib/middleware'
import { NextHandleFunction } from 'connect'
import { IncomingMessage, ServerResponse } from 'http'
-import WebpackDevMiddleware from 'next/dist/compiled/webpack-dev-middleware'
import WebpackHotMiddleware from 'next/dist/... | true |
Other | vercel | next.js | ae542b852533551f1f59028cd5f454046172e5b1.json | Use entry option instead of custom make hook (#14527)
Simplifies on-demand-entries a bit. | packages/next/server/next-dev-server.ts | @@ -471,6 +471,7 @@ export default class DevServer extends Server {
pathname: string,
query: { [key: string]: string }
): Promise<string | null> {
+ await this.devReady
const compilationErr = await this.getCompilationError(pathname)
if (compilationErr) {
res.statusCode = 500
@@ -520,6 +... | true |
Other | vercel | next.js | ae542b852533551f1f59028cd5f454046172e5b1.json | Use entry option instead of custom make hook (#14527)
Simplifies on-demand-entries a bit. | packages/next/server/on-demand-entry-handler.ts | @@ -1,15 +1,9 @@
import { EventEmitter } from 'events'
import { IncomingMessage, ServerResponse } from 'http'
-import WebpackDevMiddleware from 'next/dist/compiled/webpack-dev-middleware'
import { join, posix } from 'path'
-import { stringify } from 'querystring'
import { parse } from 'url'
import webpack from 'we... | true |
Other | vercel | next.js | ae542b852533551f1f59028cd5f454046172e5b1.json | Use entry option instead of custom make hook (#14527)
Simplifies on-demand-entries a bit. | packages/next/taskfile.js | @@ -43,7 +43,6 @@ const externals = {
// Webpack indirect and direct dependencies:
webpack: 'webpack',
'webpack-sources': 'webpack-sources',
- // dependents: webpack-dev-middleware
'webpack/lib/node/NodeOutputFileSystem':
'webpack/lib/node/NodeOutputFileSystem',
// dependents: terser-webpack-plugin... | true |
Other | vercel | next.js | ae542b852533551f1f59028cd5f454046172e5b1.json | Use entry option instead of custom make hook (#14527)
Simplifies on-demand-entries a bit. | packages/next/types/misc.d.ts | @@ -210,10 +210,7 @@ declare module 'next/dist/compiled/unistore' {
import m from 'unistore'
export = m
}
-declare module 'next/dist/compiled/webpack-dev-middleware' {
- import m from 'webpack-dev-middleware'
- export = m
-}
+
declare module 'next/dist/compiled/webpack-hot-middleware' {
import m from 'webp... | true |
Other | vercel | next.js | ae542b852533551f1f59028cd5f454046172e5b1.json | Use entry option instead of custom make hook (#14527)
Simplifies on-demand-entries a bit. | packages/react-dev-overlay/src/middleware.ts | @@ -27,6 +27,20 @@ export type OriginalStackFrameResponse = {
type Source = { map: () => RawSourceMap } | null
+function getSourcePath(source: string) {
+ // Webpack prefixes certain source paths with this path
+ if (source.startsWith('webpack:///')) {
+ return source.substring(11)
+ }
+
+ // Make sure libr... | true |
Other | vercel | next.js | ae542b852533551f1f59028cd5f454046172e5b1.json | Use entry option instead of custom make hook (#14527)
Simplifies on-demand-entries a bit. | test/integration/ondemand/test/index.test.js | @@ -1,8 +1,7 @@
/* eslint-env jest */
import webdriver from 'next-webdriver'
-import { join, resolve } from 'path'
-import { existsSync } from 'fs'
+import { join } from 'path'
import AbortController from 'abort-controller'
import {
renderViaHTTP,
@@ -14,6 +13,7 @@ import {
check,
getBrowserBodyText,
... | true |
Other | vercel | next.js | ae542b852533551f1f59028cd5f454046172e5b1.json | Use entry option instead of custom make hook (#14527)
Simplifies on-demand-entries a bit. | yarn.lock | @@ -2770,12 +2770,6 @@
version "5.1.0"
resolved "https://registry.yarnpkg.com/@types/lru-cache/-/lru-cache-5.1.0.tgz#57f228f2b80c046b4a1bd5cac031f81f207f4f03"
-"@types/memory-fs@*":
- version "0.3.2"
- resolved "https://registry.yarnpkg.com/@types/memory-fs/-/memory-fs-0.3.2.tgz#5d4753f9b390cb077c8c8af97bc964... | true |
Other | vercel | next.js | 574e9d285ac79b98f74e53ae6c5f2099fc8f1f80.json | Remove deprecated plugin in favor of the option (#14503)
Not sure if it's still there for a reason, but from the types for `NoEmitOnErrorsPlugin`
```js
/* @deprecated use config.optimization.noEmitOnErrors */
``` | packages/next/build/webpack-config.ts | @@ -634,6 +634,7 @@ export default async function getBaseWebpackConfig(
'@ampproject/toolbox-optimizer', // except this one
],
optimization: {
+ noEmitOnErrors: dev,
checkWasmTypes: false,
nodeEnv: false,
splitChunks: isServer ? false : splitChunksConfig,
@@ -887,7 +88... | false |
Other | vercel | next.js | be2a63238a64867f458a50158d27ccd8ef87969e.json | Webpack 5 build compat (#14498)
Initial PR to make `next build` work with webpack 5, still needs more work to make sure runtimeChunk and such are shared between pages.
- No longer needs the custom ChunkNamesPlugin as the default behavior was changed
- Dropping AMP First client page bundles is now compatible | packages/next/build/webpack-config.ts | @@ -358,7 +358,7 @@ export default async function getBaseWebpackConfig(
defaultVendors: false,
framework: {
chunks: 'all',
- name: 'framework',
+ name: isWebpack5 ? 'static/chunks/framework' : 'framework',
// This regex ignores nested copies of framework librari... | true |
Other | vercel | next.js | be2a63238a64867f458a50158d27ccd8ef87969e.json | Webpack 5 build compat (#14498)
Initial PR to make `next build` work with webpack 5, still needs more work to make sure runtimeChunk and such are shared between pages.
- No longer needs the custom ChunkNamesPlugin as the default behavior was changed
- Dropping AMP First client page bundles is now compatible | packages/next/build/webpack/plugins/next-drop-client-page-plugin.ts | @@ -1,63 +1,92 @@
-import { Compiler, compilation as CompilationType, Plugin } from 'webpack'
+import {
+ Compiler,
+ compilation as CompilationType,
+ Plugin,
+ version,
+} from 'webpack'
import { STRING_LITERAL_DROP_BUNDLE } from '../../../next-server/lib/constants'
+const isWebpack5 = parseInt(version!) === 5... | true |
Other | vercel | next.js | be2a63238a64867f458a50158d27ccd8ef87969e.json | Webpack 5 build compat (#14498)
Initial PR to make `next build` work with webpack 5, still needs more work to make sure runtimeChunk and such are shared between pages.
- No longer needs the custom ChunkNamesPlugin as the default behavior was changed
- Dropping AMP First client page bundles is now compatible | packages/next/client/dev/error-overlay/format-webpack-messages.js | @@ -32,6 +32,10 @@ function isLikelyASyntaxError(message) {
// Cleans up webpack error messages.
function formatMessage(message) {
+ // TODO: Replace this once webpack 5 is stable
+ if (typeof message === 'object' && message.message) {
+ message = message.message
+ }
let lines = message.split('\n')
//... | true |
Other | vercel | next.js | 6c2ce706086cc2b6ffbbbf6dfbc8f39aa7c73722.json | Remove buildId from server-side files (#14413)
Gets rid of the custom function for naming files by removing buildId from the file paths. | packages/next/build/entries.ts | @@ -101,7 +101,7 @@ export function createEntrypoints(
const isApiRoute = page.match(API_ROUTE)
const clientBundlePath = join('static', 'pages', bundleFile)
- const serverBundlePath = join('static', 'BUILD_ID', 'pages', bundleFile)
+ const serverBundlePath = join('pages', bundleFile)
const isLi... | true |
Other | vercel | next.js | 6c2ce706086cc2b6ffbbbf6dfbc8f39aa7c73722.json | Remove buildId from server-side files (#14413)
Gets rid of the custom function for naming files by removing buildId from the file paths. | packages/next/build/webpack-config.ts | @@ -679,24 +679,8 @@ export default async function getBaseWebpackConfig(
},
output: {
path: outputPath,
- filename: isServer
- ? ({ chunk }: { chunk: { name: string } }) => {
- // Use `[name]-[contenthash].js` in production
- if (chunk.name.includes('BUILD_ID')) {
- ... | true |
Other | vercel | next.js | 6c2ce706086cc2b6ffbbbf6dfbc8f39aa7c73722.json | Remove buildId from server-side files (#14413)
Gets rid of the custom function for naming files by removing buildId from the file paths. | packages/next/export/index.ts | @@ -41,6 +41,7 @@ import { loadEnvConfig } from '../lib/load-env-config'
import { PrerenderManifest } from '../build'
import type exportPage from './worker'
import { PagesManifest } from '../build/webpack/plugins/pages-manifest-plugin'
+import { getPagePath } from '../next-server/server/require'
const exists = pr... | true |
Other | vercel | next.js | 6c2ce706086cc2b6ffbbbf6dfbc8f39aa7c73722.json | Remove buildId from server-side files (#14413)
Gets rid of the custom function for naming files by removing buildId from the file paths. | packages/next/next-server/server/get-route-from-entrypoint.ts | @@ -1,9 +1,9 @@
import { denormalizePagePath } from './normalize-page-path'
// matches static/<buildid>/pages/:page*.js
-const ROUTE_NAME_REGEX = /^static[/\\][^/\\]+[/\\]pages[/\\](.*)$/
+// const SERVER_ROUTE_NAME_REGEX = /^static[/\\][^/\\]+[/\\]pages[/\\](.*)$/
// matches pages/:page*.js
-const SERVERLESS_ROUT... | true |
Other | vercel | next.js | 6c2ce706086cc2b6ffbbbf6dfbc8f39aa7c73722.json | Remove buildId from server-side files (#14413)
Gets rid of the custom function for naming files by removing buildId from the file paths. | packages/next/next-server/server/next-server.ts | @@ -220,9 +220,7 @@ export default class Server {
distDir: this.distDir,
pagesDir: join(
this.distDir,
- this._isLikeServerless
- ? SERVERLESS_DIRECTORY
- : `${SERVER_DIRECTORY}/static/${this.buildId}`,
+ this._isLikeServerless ? SERVERLESS_DIRECTORY : SERVER_DIREC... | true |
Other | vercel | next.js | 6c2ce706086cc2b6ffbbbf6dfbc8f39aa7c73722.json | Remove buildId from server-side files (#14413)
Gets rid of the custom function for naming files by removing buildId from the file paths. | packages/next/server/hot-reloader.ts | @@ -380,7 +380,7 @@ export default class HotReloader {
// We only watch `_document` for changes on the server compilation
// the rest of the files will be triggered by the client compilation
const documentChunk = compilation.chunks.find(
- (c) => c.name === normalize(`static/BUILD_ID... | true |
Other | vercel | next.js | 6c2ce706086cc2b6ffbbbf6dfbc8f39aa7c73722.json | Remove buildId from server-side files (#14413)
Gets rid of the custom function for naming files by removing buildId from the file paths. | packages/next/server/on-demand-entry-handler.ts | @@ -228,7 +228,7 @@ export default function onDemandEntryHandler(
pageUrl = pageUrl === '' ? '/' : pageUrl
const bundleFile = normalizePagePath(pageUrl)
- const serverBundlePath = join('static', 'BUILD_ID', 'pages', bundleFile)
+ const serverBundlePath = join('pages', bundleFile)
const ... | true |
Other | vercel | next.js | 6c2ce706086cc2b6ffbbbf6dfbc8f39aa7c73722.json | Remove buildId from server-side files (#14413)
Gets rid of the custom function for naming files by removing buildId from the file paths. | test/integration/404-page-app/next.config.js | @@ -0,0 +1 @@
+module.exports = {} | true |
Other | vercel | next.js | 6c2ce706086cc2b6ffbbbf6dfbc8f39aa7c73722.json | Remove buildId from server-side files (#14413)
Gets rid of the custom function for naming files by removing buildId from the file paths. | test/integration/404-page-app/pages/404.js | @@ -0,0 +1,5 @@
+const page = (props) => {
+ return <h1 id="404-title">{props.extraProp}</h1>
+}
+
+export default page | true |
Other | vercel | next.js | 6c2ce706086cc2b6ffbbbf6dfbc8f39aa7c73722.json | Remove buildId from server-side files (#14413)
Gets rid of the custom function for naming files by removing buildId from the file paths. | test/integration/404-page-app/pages/_app.js | @@ -0,0 +1,18 @@
+import App from 'next/app'
+
+function MyApp({ Component, pageProps, extraProp }) {
+ return <Component {...pageProps} extraProp={extraProp} />
+}
+
+// Only uncomment this method if you have blocking data requirements for
+// every single page in your application. This disables the ability to
+// pe... | true |
Other | vercel | next.js | 6c2ce706086cc2b6ffbbbf6dfbc8f39aa7c73722.json | Remove buildId from server-side files (#14413)
Gets rid of the custom function for naming files by removing buildId from the file paths. | test/integration/404-page-app/pages/err.js | @@ -0,0 +1,5 @@
+const page = () => 'custom 404 page'
+page.getInitialProps = () => {
+ throw new Error('oops')
+}
+export default page | true |
Other | vercel | next.js | 6c2ce706086cc2b6ffbbbf6dfbc8f39aa7c73722.json | Remove buildId from server-side files (#14413)
Gets rid of the custom function for naming files by removing buildId from the file paths. | test/integration/404-page-app/pages/index.js | @@ -0,0 +1 @@
+export default () => 'hello from index' | true |
Other | vercel | next.js | 6c2ce706086cc2b6ffbbbf6dfbc8f39aa7c73722.json | Remove buildId from server-side files (#14413)
Gets rid of the custom function for naming files by removing buildId from the file paths. | test/integration/404-page-app/test/index.test.js | @@ -0,0 +1,89 @@
+/* eslint-env jest */
+
+import fs from 'fs-extra'
+import { join } from 'path'
+import {
+ killApp,
+ findPort,
+ launchApp,
+ nextStart,
+ nextBuild,
+ fetchViaHTTP,
+} from 'next-test-utils'
+import webdriver from 'next-webdriver'
+import cheerio from 'cheerio'
+
+jest.setTimeout(1000 * 60 * ... | true |
Other | vercel | next.js | 6c2ce706086cc2b6ffbbbf6dfbc8f39aa7c73722.json | Remove buildId from server-side files (#14413)
Gets rid of the custom function for naming files by removing buildId from the file paths. | test/integration/404-page-custom-error/test/index.test.js | @@ -10,6 +10,7 @@ import {
nextBuild,
renderViaHTTP,
fetchViaHTTP,
+ getPageFileFromPagesManifest,
} from 'next-test-utils'
jest.setTimeout(1000 * 60 * 2)
@@ -18,7 +19,6 @@ const appDir = join(__dirname, '../')
const nextConfig = join(appDir, 'next.config.js')
let appPort
-let buildId
let app
cons... | true |
Other | vercel | next.js | 6c2ce706086cc2b6ffbbbf6dfbc8f39aa7c73722.json | Remove buildId from server-side files (#14413)
Gets rid of the custom function for naming files by removing buildId from the file paths. | test/integration/404-page/test/index.test.js | @@ -11,18 +11,17 @@ import {
renderViaHTTP,
fetchViaHTTP,
waitFor,
+ getPageFileFromPagesManifest,
} from 'next-test-utils'
jest.setTimeout(1000 * 60 * 2)
const appDir = join(__dirname, '../')
const pages404 = join(appDir, 'pages/404.js')
-const appPage = join(appDir, 'pages/_app.js')
const nextConfi... | true |
Other | vercel | next.js | 6c2ce706086cc2b6ffbbbf6dfbc8f39aa7c73722.json | Remove buildId from server-side files (#14413)
Gets rid of the custom function for naming files by removing buildId from the file paths. | test/integration/amphtml-ssg/test/index.test.js | @@ -117,13 +117,8 @@ describe('AMP SSG Support', () => {
await nextBuild(appDir)
appPort = await findPort()
app = await nextStart(appDir, appPort)
- const buildId = await fs.readFile(join(appDir, '.next/BUILD_ID'), 'utf8')
- builtServerPagesDir = join(
- appDir,
- '.next/ser... | true |
Other | vercel | next.js | 6c2ce706086cc2b6ffbbbf6dfbc8f39aa7c73722.json | Remove buildId from server-side files (#14413)
Gets rid of the custom function for naming files by removing buildId from the file paths. | test/integration/amphtml/pages/nav.js | @@ -0,0 +1,17 @@
+import Link from 'next/link'
+
+if (typeof window !== 'undefined') {
+ window.NAV_PAGE_LOADED = true
+}
+
+export default function Nav() {
+ return (
+ <ul>
+ <li>
+ <Link href="/only-amp">
+ <a id="only-amp-link">AMP First Page</a>
+ </Link>
+ </li>
+ </ul>
+ ... | true |
Other | vercel | next.js | 6c2ce706086cc2b6ffbbbf6dfbc8f39aa7c73722.json | Remove buildId from server-side files (#14413)
Gets rid of the custom function for naming files by removing buildId from the file paths. | test/integration/amphtml/test/index.test.js | @@ -2,13 +2,7 @@
import { validateAMP } from 'amp-test-utils'
import cheerio from 'cheerio'
-import {
- accessSync,
- readFile,
- readFileSync,
- writeFile,
- writeFileSync,
-} from 'fs-extra'
+import { readFile, readFileSync, writeFile, writeFileSync } from 'fs-extra'
import {
check,
findPort,
@@ -72,3... | true |
Other | vercel | next.js | 6c2ce706086cc2b6ffbbbf6dfbc8f39aa7c73722.json | Remove buildId from server-side files (#14413)
Gets rid of the custom function for naming files by removing buildId from the file paths. | test/integration/chunking/next.config.js | @@ -1,7 +1,6 @@
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer')
.BundleAnalyzerPlugin
module.exports = {
- assetPrefix: '/foo/',
webpack(config) {
config.plugins = config.plugins || []
config.plugins.push( | true |
Other | vercel | next.js | 6c2ce706086cc2b6ffbbbf6dfbc8f39aa7c73722.json | Remove buildId from server-side files (#14413)
Gets rid of the custom function for naming files by removing buildId from the file paths. | test/integration/chunking/test/index.test.js | @@ -1,21 +1,25 @@
/* eslint-env jest */
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'
+import { readdir, readFile, unlink } from 'fs-ex... | true |
Other | vercel | next.js | 6c2ce706086cc2b6ffbbbf6dfbc8f39aa7c73722.json | Remove buildId from server-side files (#14413)
Gets rid of the custom function for naming files by removing buildId from the file paths. | test/integration/client-navigation/test/rendering.js | @@ -4,9 +4,6 @@ import cheerio from 'cheerio'
import { BUILD_MANIFEST, REACT_LOADABLE_MANIFEST } from 'next/constants'
import { join } from 'path'
import url from 'url'
-import { getPageFileFromBuildManifest } from 'next-test-utils'
-
-const appDir = join(__dirname, '../')
export default function (render, fetch) ... | true |
Other | vercel | next.js | 6c2ce706086cc2b6ffbbbf6dfbc8f39aa7c73722.json | Remove buildId from server-side files (#14413)
Gets rid of the custom function for naming files by removing buildId from the file paths. | test/integration/externalize-next-server/test/index.test.js | @@ -1,26 +1,19 @@
/* eslint-env jest */
-
-import fs from 'fs-extra'
import path from 'path'
-import { nextBuild } from 'next-test-utils'
+import { nextBuild, readNextBuildServerPageFile } from 'next-test-utils'
import escapeStringRegexp from 'escape-string-regexp'
jest.setTimeout(1000 * 60 * 1)
const appDir =... | true |
Other | vercel | next.js | 6c2ce706086cc2b6ffbbbf6dfbc8f39aa7c73722.json | Remove buildId from server-side files (#14413)
Gets rid of the custom function for naming files by removing buildId from the file paths. | test/integration/non-next-dist-exclude/test/index.test.js | @@ -1,25 +1,18 @@
/* eslint-env jest */
-
-import fs from 'fs-extra'
import path from 'path'
-import { nextBuild } from 'next-test-utils'
+import { nextBuild, readNextBuildServerPageFile } from 'next-test-utils'
jest.setTimeout(1000 * 60 * 1)
const appDir = path.join(__dirname, '../app')
-let buildId
describ... | true |
Other | vercel | next.js | 6c2ce706086cc2b6ffbbbf6dfbc8f39aa7c73722.json | Remove buildId from server-side files (#14413)
Gets rid of the custom function for naming files by removing buildId from the file paths. | test/integration/prerender-no-revalidate/test/index.test.js | @@ -8,6 +8,7 @@ import {
nextStart,
renderViaHTTP,
waitFor,
+ getPageFileFromPagesManifest,
} from 'next-test-utils'
import { join } from 'path'
@@ -23,9 +24,9 @@ function runTests(route, routePath, serverless) {
it(`[${route}] should not revalidate when set to false`, async () => {
const fileName... | true |
Other | vercel | next.js | 6c2ce706086cc2b6ffbbbf6dfbc8f39aa7c73722.json | Remove buildId from server-side files (#14413)
Gets rid of the custom function for naming files by removing buildId from the file paths. | test/integration/prerender/test/index.test.js | @@ -1541,7 +1541,8 @@ describe('SSG Prerender', () => {
},
})
buildId = await fs.readFile(join(appDir, '.next/BUILD_ID'), 'utf8')
- distPagesDir = join(appDir, '.next/server/static', buildId, 'pages')
+ // TODO: Don't rely on this path
+ distPagesDir = join(appDir, '.next', 'server... | true |
Other | vercel | next.js | 6c2ce706086cc2b6ffbbbf6dfbc8f39aa7c73722.json | Remove buildId from server-side files (#14413)
Gets rid of the custom function for naming files by removing buildId from the file paths. | test/integration/production/test/index.test.js | @@ -1,14 +1,15 @@
/* eslint-env jest */
/* global browserName */
import cheerio from 'cheerio'
-import { existsSync, readFileSync } from 'fs'
+import { existsSync } from 'fs'
import {
nextServer,
renderViaHTTP,
runNextCommand,
startApp,
stopApp,
waitFor,
+ getPageFileFromPagesManifest,
} from 'n... | true |
Other | vercel | next.js | 6c2ce706086cc2b6ffbbbf6dfbc8f39aa7c73722.json | Remove buildId from server-side files (#14413)
Gets rid of the custom function for naming files by removing buildId from the file paths. | test/integration/serverless-trace/test/index.test.js | @@ -11,6 +11,7 @@ import {
fetchViaHTTP,
renderViaHTTP,
readNextBuildClientPageFile,
+ getPageFileFromPagesManifest,
} from 'next-test-utils'
import fetch from 'node-fetch'
@@ -117,21 +118,23 @@ describe('Serverless Trace', () => {
})
it('should replace static pages with HTML files', async () => {... | true |
Other | vercel | next.js | 6c2ce706086cc2b6ffbbbf6dfbc8f39aa7c73722.json | Remove buildId from server-side files (#14413)
Gets rid of the custom function for naming files by removing buildId from the file paths. | test/integration/serverless/test/index.test.js | @@ -13,6 +13,7 @@ import {
fetchViaHTTP,
renderViaHTTP,
getPageFileFromBuildManifest,
+ getPageFileFromPagesManifest,
} from 'next-test-utils'
import qs from 'querystring'
import path from 'path'
@@ -186,18 +187,21 @@ describe('Serverless', () => {
})
it('should replace static pages with HTML files... | true |
Other | vercel | next.js | 6c2ce706086cc2b6ffbbbf6dfbc8f39aa7c73722.json | Remove buildId from server-side files (#14413)
Gets rid of the custom function for naming files by removing buildId from the file paths. | test/integration/static-404/test/index.test.js | @@ -13,10 +13,8 @@ import {
jest.setTimeout(1000 * 60 * 2)
const appDir = join(__dirname, '..')
const nextConfig = join(appDir, 'next.config.js')
-const static404 = join(appDir, '.next/server/static/test-id/pages/404.html')
const appPage = join(appDir, 'pages/_app.js')
const errorPage = join(appDir, 'pages/_error.... | true |
Other | vercel | next.js | 6c2ce706086cc2b6ffbbbf6dfbc8f39aa7c73722.json | Remove buildId from server-side files (#14413)
Gets rid of the custom function for naming files by removing buildId from the file paths. | test/lib/next-test-utils.js | @@ -493,8 +493,12 @@ export function normalizeRegEx(src) {
return new RegExp(src).source.replace(/\^\//g, '^\\/')
}
+function readJson(path) {
+ return JSON.parse(readFileSync(path))
+}
+
export function getBuildManifest(dir) {
- return JSON.parse(readFileSync(path.join(dir, '.next/build-manifest.json')))
+ r... | true |
Other | spring-projects | spring-framework | 8e9a553517de71a21415f5d3e44b87e6024b609a.json | Update Javadoc regarding JUnit versions | spring-test/src/main/java/org/springframework/test/context/junit4/SpringJUnit4ClassRunner.java | @@ -59,7 +59,7 @@
* <em>Spring TestContext Framework</em> to standard JUnit tests by means of the
* {@link TestContextManager} and associated support classes and annotations.
*
- * <p>To use this class, simply annotate a JUnit 4 based test class with
+ * <p>To use this class, annotate a JUnit 4 based test class w... | true |
Other | spring-projects | spring-framework | 8e9a553517de71a21415f5d3e44b87e6024b609a.json | Update Javadoc regarding JUnit versions | spring-test/src/main/java/org/springframework/test/context/junit4/SpringRunner.java | @@ -1,5 +1,5 @@
/*
- * Copyright 2002-2016 the original author or authors.
+ * Copyright 2002-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -21,7 +21,7 @@
/**
* {@code SpringRunner}... | true |
Other | spring-projects | spring-framework | 8e9a553517de71a21415f5d3e44b87e6024b609a.json | Update Javadoc regarding JUnit versions | spring-test/src/main/java/org/springframework/test/context/junit4/rules/SpringClassRule.java | @@ -1,5 +1,5 @@
/*
- * Copyright 2002-2018 the original author or authors.
+ * Copyright 2002-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -72,7 +72,7 @@
* <li>{@link org.springfram... | true |
Other | spring-projects | spring-framework | 8e9a553517de71a21415f5d3e44b87e6024b609a.json | Update Javadoc regarding JUnit versions | spring-test/src/main/java/org/springframework/test/context/junit4/rules/SpringMethodRule.java | @@ -1,5 +1,5 @@
/*
- * Copyright 2002-2021 the original author or authors.
+ * Copyright 2002-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -76,7 +76,7 @@
* <li>{@link org.springfram... | true |
Other | spring-projects | spring-framework | 8e9a553517de71a21415f5d3e44b87e6024b609a.json | Update Javadoc regarding JUnit versions | spring-test/src/main/java/org/springframework/test/context/junit4/statements/RunBeforeTestExecutionCallbacks.java | @@ -1,5 +1,5 @@
/*
- * Copyright 2002-2018 the original author or authors.
+ * Copyright 2002-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -28,6 +28,8 @@
* JUnit 4 execution chain b... | true |
Other | spring-projects | spring-framework | 8e9a553517de71a21415f5d3e44b87e6024b609a.json | Update Javadoc regarding JUnit versions | spring-test/src/test/java/org/springframework/test/context/TestContextManagerSuppressedExceptionsTests.java | @@ -1,5 +1,5 @@
/*
- * Copyright 2002-2019 the original author or authors.
+ * Copyright 2002-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,7 +25,7 @@
import static org.assertj.co... | true |
Other | spring-projects | spring-framework | 8e9a553517de71a21415f5d3e44b87e6024b609a.json | Update Javadoc regarding JUnit versions | spring-test/src/test/java/org/springframework/test/context/TestContextManagerTests.java | @@ -1,5 +1,5 @@
/*
- * Copyright 2002-2019 the original author or authors.
+ * Copyright 2002-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,15 +18,14 @@
import java.lang.reflect... | true |
Other | spring-projects | spring-framework | 8e9a553517de71a21415f5d3e44b87e6024b609a.json | Update Javadoc regarding JUnit versions | spring-test/src/test/java/org/springframework/test/context/junit/jupiter/ComposedSpringExtensionTests.java | @@ -1,5 +1,5 @@
/*
- * Copyright 2002-2019 the original author or authors.
+ * Copyright 2002-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,7 +25,6 @@
import org.springframework.b... | true |
Other | spring-projects | spring-framework | 8e9a553517de71a21415f5d3e44b87e6024b609a.json | Update Javadoc regarding JUnit versions | spring-test/src/test/java/org/springframework/test/context/junit/jupiter/DisabledIfConditionTests.java | @@ -1,5 +1,5 @@
/*
- * Copyright 2002-2019 the original author or authors.
+ * Copyright 2002-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -26,7 +26,6 @@
import org.springframework... | true |
Other | spring-projects | spring-framework | 8e9a553517de71a21415f5d3e44b87e6024b609a.json | Update Javadoc regarding JUnit versions | spring-test/src/test/java/org/springframework/test/context/junit/jupiter/DisabledIfTests.java | @@ -1,5 +1,5 @@
/*
- * Copyright 2002-2019 the original author or authors.
+ * Copyright 2002-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -22,7 +22,6 @@
import org.springframework.c... | true |
Other | spring-projects | spring-framework | 8e9a553517de71a21415f5d3e44b87e6024b609a.json | Update Javadoc regarding JUnit versions | spring-test/src/test/java/org/springframework/test/context/junit/jupiter/EnabledIfTests.java | @@ -1,5 +1,5 @@
/*
- * Copyright 2002-2019 the original author or authors.
+ * Copyright 2002-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -22,7 +22,6 @@
import org.springframework.c... | true |
Other | spring-projects | spring-framework | 8e9a553517de71a21415f5d3e44b87e6024b609a.json | Update Javadoc regarding JUnit versions | spring-test/src/test/java/org/springframework/test/context/junit/jupiter/FailingBeforeAndAfterMethodsSpringExtensionTests.java | @@ -1,5 +1,5 @@
/*
- * Copyright 2002-2020 the original author or authors.
+ * Copyright 2002-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -32,7 +32,6 @@
import org.springframework.t... | true |
Other | spring-projects | spring-framework | 8e9a553517de71a21415f5d3e44b87e6024b609a.json | Update Javadoc regarding JUnit versions | spring-test/src/test/java/org/springframework/test/context/junit/jupiter/RegisterExtensionSpringExtensionTests.java | @@ -31,7 +31,6 @@
import org.springframework.context.support.GenericApplicationContext;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.TestPropertySource;
-import org.springframework.test.context.junit.SpringJUnitJupiterTestSuite;
import org.springframework.tes... | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.