-
Notifications
You must be signed in to change notification settings - Fork 27k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
121 changed files
with
4,196 additions
and
3,457 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
docs/02-app/02-api-reference/08-legacy-apis/unstable_cache.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
docs/02-app/02-api-reference/08-legacy-apis/unstable_noStore.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -209,19 +209,19 @@ | |
"pretty-bytes": "5.3.0", | ||
"pretty-ms": "7.0.0", | ||
"random-seed": "0.3.0", | ||
"react": "19.0.0-rc-1631855f-20241023", | ||
"react": "19.0.0-rc-02c0e824-20241028", | ||
"react-17": "npm:[email protected]", | ||
"react-builtin": "npm:[email protected]1631855f-20241023", | ||
"react-dom": "19.0.0-rc-1631855f-20241023", | ||
"react-builtin": "npm:[email protected]02c0e824-20241028", | ||
"react-dom": "19.0.0-rc-02c0e824-20241028", | ||
"react-dom-17": "npm:[email protected]", | ||
"react-dom-builtin": "npm:[email protected]1631855f-20241023", | ||
"react-dom-experimental-builtin": "npm:[email protected]1631855f-20241023", | ||
"react-experimental-builtin": "npm:[email protected]1631855f-20241023", | ||
"react-is-builtin": "npm:[email protected]1631855f-20241023", | ||
"react-server-dom-turbopack": "19.0.0-rc-1631855f-20241023", | ||
"react-server-dom-turbopack-experimental": "npm:[email protected]1631855f-20241023", | ||
"react-server-dom-webpack": "19.0.0-rc-1631855f-20241023", | ||
"react-server-dom-webpack-experimental": "npm:[email protected]1631855f-20241023", | ||
"react-dom-builtin": "npm:[email protected]02c0e824-20241028", | ||
"react-dom-experimental-builtin": "npm:[email protected]02c0e824-20241028", | ||
"react-experimental-builtin": "npm:[email protected]02c0e824-20241028", | ||
"react-is-builtin": "npm:[email protected]02c0e824-20241028", | ||
"react-server-dom-turbopack": "19.0.0-rc-02c0e824-20241028", | ||
"react-server-dom-turbopack-experimental": "npm:[email protected]02c0e824-20241028", | ||
"react-server-dom-webpack": "19.0.0-rc-02c0e824-20241028", | ||
"react-server-dom-webpack-experimental": "npm:[email protected]02c0e824-20241028", | ||
"react-ssr-prepass": "1.0.8", | ||
"react-virtualized": "9.22.3", | ||
"relay-compiler": "13.0.2", | ||
|
@@ -231,8 +231,8 @@ | |
"resolve-from": "5.0.0", | ||
"sass": "1.54.0", | ||
"satori": "0.10.9", | ||
"scheduler-builtin": "npm:[email protected]1631855f-20241023", | ||
"scheduler-experimental-builtin": "npm:[email protected]1631855f-20241023", | ||
"scheduler-builtin": "npm:[email protected]02c0e824-20241028", | ||
"scheduler-experimental-builtin": "npm:[email protected]02c0e824-20241028", | ||
"seedrandom": "3.0.5", | ||
"semver": "7.3.7", | ||
"shell-quote": "1.7.3", | ||
|
@@ -272,10 +272,10 @@ | |
"@babel/traverse": "7.22.5", | ||
"@types/react": "npm:[email protected]", | ||
"@types/react-dom": "npm:[email protected]", | ||
"react": "19.0.0-rc-1631855f-20241023", | ||
"react-dom": "19.0.0-rc-1631855f-20241023", | ||
"react-is": "19.0.0-rc-1631855f-20241023", | ||
"scheduler": "0.25.0-rc-1631855f-20241023" | ||
"react": "19.0.0-rc-02c0e824-20241028", | ||
"react-dom": "19.0.0-rc-02c0e824-20241028", | ||
"react-is": "19.0.0-rc-02c0e824-20241028", | ||
"scheduler": "0.25.0-rc-02c0e824-20241028" | ||
}, | ||
"patchedDependencies": { | ||
"[email protected]": "patches/[email protected]" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...d/transforms/__testfixtures__/next-async-request-api-dynamic-apis/async-api-11.output.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
import { headers, type UnsafeUnwrappedHeaders } from 'next/headers'; | ||
|
||
export function MyComp() { | ||
(headers() as unknown as UnsafeUnwrappedHeaders) | ||
void (headers() as unknown as UnsafeUnwrappedHeaders) | ||
} | ||
|
||
export function generateContentfulMetadata() { | ||
(headers() as unknown as UnsafeUnwrappedHeaders) | ||
void (headers() as unknown as UnsafeUnwrappedHeaders) | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
...od/transforms/__testfixtures__/next-async-request-api-dynamic-apis/async-api-25.input.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { cookies } from 'next/headers' | ||
|
||
export function myFunc() { | ||
const c = cookies() | ||
cookies() | ||
} |
6 changes: 6 additions & 0 deletions
6
...d/transforms/__testfixtures__/next-async-request-api-dynamic-apis/async-api-25.output.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { cookies, type UnsafeUnwrappedCookies } from 'next/headers'; | ||
|
||
export function myFunc() { | ||
const c = (cookies() as unknown as UnsafeUnwrappedCookies) | ||
void (cookies() as unknown as UnsafeUnwrappedCookies) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
93 changes: 93 additions & 0 deletions
93
packages/next/src/build/webpack/plugins/devtools-ignore-list-plugin.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
// Source: https://github.com/mondaychen/devtools-ignore-webpack-plugin/blob/e35ce41d9606a92a455ef247f509a1c2ccab5778/src/index.ts | ||
|
||
import { webpack } from 'next/dist/compiled/webpack/webpack' | ||
|
||
// Following the naming conventions from | ||
// https://tc39.es/source-map/#source-map-format | ||
const IGNORE_LIST = 'ignoreList' | ||
|
||
const PLUGIN_NAME = 'devtools-ignore-plugin' | ||
|
||
interface SourceMap { | ||
sources: string[] | ||
[IGNORE_LIST]: number[] | ||
} | ||
|
||
interface PluginOptions { | ||
shouldIgnorePath?: (path: string) => boolean | ||
isSourceMapAsset?: (name: string) => boolean | ||
} | ||
|
||
interface ValidatedOptions extends PluginOptions { | ||
shouldIgnorePath: Required<PluginOptions>['shouldIgnorePath'] | ||
isSourceMapAsset: Required<PluginOptions>['isSourceMapAsset'] | ||
} | ||
|
||
function defaultShouldIgnorePath(path: string): boolean { | ||
return path.includes('/node_modules/') || path.includes('/webpack/') | ||
} | ||
|
||
function defaultIsSourceMapAsset(name: string): boolean { | ||
return name.endsWith('.map') | ||
} | ||
|
||
/** | ||
* This plugin adds a field to source maps that identifies which sources are | ||
* vendored or runtime-injected (aka third-party) sources. These are consumed by | ||
* Chrome DevTools to automatically ignore-list sources. | ||
*/ | ||
export default class DevToolsIgnorePlugin { | ||
options: ValidatedOptions | ||
|
||
constructor(options: PluginOptions = {}) { | ||
this.options = { | ||
shouldIgnorePath: options.shouldIgnorePath ?? defaultShouldIgnorePath, | ||
isSourceMapAsset: options.isSourceMapAsset ?? defaultIsSourceMapAsset, | ||
} | ||
} | ||
|
||
apply(compiler: webpack.Compiler) { | ||
const { RawSource } = compiler.webpack.sources | ||
|
||
compiler.hooks.compilation.tap(PLUGIN_NAME, (compilation) => { | ||
compilation.hooks.processAssets.tap( | ||
{ | ||
name: PLUGIN_NAME, | ||
stage: webpack.Compilation.PROCESS_ASSETS_STAGE_DEV_TOOLING, | ||
additionalAssets: true, | ||
}, | ||
(assets) => { | ||
for (const [name, asset] of Object.entries(assets)) { | ||
// Instead of using `asset.map()` to fetch the source maps from | ||
// SourceMapSource assets, process them directly as a RawSource. | ||
// This is because `.map()` is slow and can take several seconds. | ||
if (!this.options.isSourceMapAsset(name)) { | ||
// Ignore non source map files. | ||
continue | ||
} | ||
|
||
const mapContent = asset.source().toString() | ||
if (!mapContent) { | ||
continue | ||
} | ||
|
||
const sourcemap = JSON.parse(mapContent) as SourceMap | ||
|
||
const ignoreList = [] | ||
for (const [index, path] of sourcemap.sources.entries()) { | ||
if (this.options.shouldIgnorePath(path)) { | ||
ignoreList.push(index) | ||
} | ||
} | ||
|
||
sourcemap[IGNORE_LIST] = ignoreList | ||
compilation.updateAsset( | ||
name, | ||
new RawSource(JSON.stringify(sourcemap)) | ||
) | ||
} | ||
} | ||
) | ||
}) | ||
} | ||
} |
Oops, something went wrong.