diff --git a/packages/next/src/build/analysis/extract-const-value.ts b/packages/next/src/build/analysis/extract-const-value.ts index 53fd739beb49d..cd8f8aa841a9f 100644 --- a/packages/next/src/build/analysis/extract-const-value.ts +++ b/packages/next/src/build/analysis/extract-const-value.ts @@ -191,7 +191,7 @@ function extractValue(node: Node, path?: string[]): any { // Because when parsing TemplateLiteral, the parser yields the first quasi, // then the first expression, then the next quasi, then the next expression, etc., // until the last quasi. - // Thus if there is no expression, the parser ends at the frst and also last quasis + // Thus if there is no expression, the parser ends at the first and also last quasis // // A "cooked" interpretation where backslashes have special meaning, while a // "raw" interpretation where backslashes do not have special meaning diff --git a/packages/next/src/build/normalize-catchall-routes.ts b/packages/next/src/build/normalize-catchall-routes.ts index ff8c43d8b0067..bd5a7a93320f4 100644 --- a/packages/next/src/build/normalize-catchall-routes.ts +++ b/packages/next/src/build/normalize-catchall-routes.ts @@ -88,7 +88,7 @@ function isMatchableSlot(segment: string): boolean { const catchAllRouteRegex = /\[?\[\.\.\./ function isCatchAllRoute(pathname: string): boolean { - // Optional catch-all slots are not currently supported, and as such they are not considered when checking for match compatability. + // Optional catch-all slots are not currently supported, and as such they are not considered when checking for match compatibility. return !isOptionalCatchAll(pathname) && isCatchAll(pathname) } diff --git a/packages/next/src/build/swc/index.ts b/packages/next/src/build/swc/index.ts index 28e1fcb32e294..3bd549dcdad93 100644 --- a/packages/next/src/build/swc/index.ts +++ b/packages/next/src/build/swc/index.ts @@ -1151,7 +1151,7 @@ async function loadWasm(importPath = '') { return newObj } - // Note wasm binary does not support async intefaces yet, all async + // Note wasm binary does not support async interfaces yet, all async // interface coereces to sync interfaces. wasmBindings = { css: { diff --git a/packages/next/src/build/webpack-config.ts b/packages/next/src/build/webpack-config.ts index d5bfae6d13e22..8fce3cedfd01b 100644 --- a/packages/next/src/build/webpack-config.ts +++ b/packages/next/src/build/webpack-config.ts @@ -1186,7 +1186,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: isRspack - ? // using a function here causes noticable slowdown + ? // using a function here causes noticeable slowdown // in rspack /(?!polyfills|main|pages\/_app)/ : (chunk: any) => diff --git a/packages/next/src/build/webpack/loaders/next-font-loader/postcss-next-font.ts b/packages/next/src/build/webpack/loaders/next-font-loader/postcss-next-font.ts index 11b083a6433c6..ead8018c4fb2f 100644 --- a/packages/next/src/build/webpack/loaders/next-font-loader/postcss-next-font.ts +++ b/packages/next/src/build/webpack/loaders/next-font-loader/postcss-next-font.ts @@ -164,14 +164,14 @@ const postcssNextFontPlugin = ({ // Add CSS class that defines a variable with the font families if (variable) { - const varialbeRule = new postcss.Rule({ selector: '.variable' }) - varialbeRule.nodes = [ + const variableRule = new postcss.Rule({ selector: '.variable' }) + variableRule.nodes = [ new postcss.Declaration({ prop: variable, value: formattedFontFamilies, }), ] - root.nodes.push(varialbeRule) + root.nodes.push(variableRule) } // Export @font-face values as is diff --git a/packages/next/src/build/webpack/plugins/flight-manifest-plugin.ts b/packages/next/src/build/webpack/plugins/flight-manifest-plugin.ts index 25a317e7194ce..fd4f4eb23533e 100644 --- a/packages/next/src/build/webpack/plugins/flight-manifest-plugin.ts +++ b/packages/next/src/build/webpack/plugins/flight-manifest-plugin.ts @@ -132,7 +132,7 @@ function getAppPathRequiredChunks( const chunkId = '' + chunk.id chunk.files.forEach((file) => { // It's possible that a chunk also emits CSS files, that will - // be handled separatedly. + // be handled separately. if (!file.endsWith('.js')) return null if (file.endsWith('.hot-update.js')) return null if (excludedFiles.has(file)) return null diff --git a/packages/next/src/build/webpack/plugins/middleware-plugin.ts b/packages/next/src/build/webpack/plugins/middleware-plugin.ts index 3f36ac8b09026..a56d0676450c0 100644 --- a/packages/next/src/build/webpack/plugins/middleware-plugin.ts +++ b/packages/next/src/build/webpack/plugins/middleware-plugin.ts @@ -476,7 +476,7 @@ function getCodeAnalyzer(params: { } /** - * This expression handler allows to wrap a WebAssembly.instatiate invocation with a + * This expression handler allows to wrap a WebAssembly.instantiate invocation with a * function call where we can warn about WASM code generation not being allowed * but actually execute the expression. * diff --git a/packages/next/src/build/webpack/plugins/wellknown-errors-plugin/parseScss.ts b/packages/next/src/build/webpack/plugins/wellknown-errors-plugin/parseScss.ts index 308f801e2d664..e3a8472fc28f7 100644 --- a/packages/next/src/build/webpack/plugins/wellknown-errors-plugin/parseScss.ts +++ b/packages/next/src/build/webpack/plugins/wellknown-errors-plugin/parseScss.ts @@ -15,8 +15,8 @@ export function getScssError( const res = regexScssError.exec(err.message) if (res) { - const [, reason, _lineNumer, backupFrame, columnString] = res - const lineNumber = Math.max(1, parseInt(_lineNumer, 10)) + const [, reason, _lineNumber, backupFrame, columnString] = res + const lineNumber = Math.max(1, parseInt(_lineNumber, 10)) const column = columnString?.length ?? 1 let frame: string | undefined diff --git a/packages/next/src/cli/next-info.ts b/packages/next/src/cli/next-info.ts index b04a51370cfc8..9939575b26c01 100755 --- a/packages/next/src/cli/next-info.ts +++ b/packages/next/src/cli/next-info.ts @@ -278,7 +278,7 @@ async function printVerboseInfo() { scripts: { default: async () => { // Node.js diagnostic report contains basic information, i.e OS version, CPU architecture, etc. - // Only collect few addtional details here. + // Only collect few additional details here. const isWsl = require('next/dist/compiled/is-wsl') as typeof import('next/dist/compiled/is-wsl') const ciInfo = diff --git a/packages/next/src/client/app-build-id.ts b/packages/next/src/client/app-build-id.ts index edf66cfb4d863..aa97224b92a92 100644 --- a/packages/next/src/client/app-build-id.ts +++ b/packages/next/src/client/app-build-id.ts @@ -10,7 +10,7 @@ // during initialization before hydration starts, this will always get // reassigned to the actual build ID before it's ever needed by a navigation. // If for some reasons it didn't, due to a bug or race condition, then on -// navigation the build comparision would fail and trigger an MPA navigation. +// navigation the build comparison would fail and trigger an MPA navigation. let globalBuildId: string = '' export function setAppBuildId(buildId: string) { diff --git a/packages/next/src/client/app-index.tsx b/packages/next/src/client/app-index.tsx index b8f243b9e2390..41132cd27d90b 100644 --- a/packages/next/src/client/app-index.tsx +++ b/packages/next/src/client/app-index.tsx @@ -205,7 +205,7 @@ function Root({ children }: React.PropsWithChildren<{}>) { } function onDefaultTransitionIndicator() { - // TODO: Compose default with user-configureable (e.g. nprogress) + // TODO: Compose default with user-configurable (e.g. nprogress) // TODO: Use React's default once we figure out hanging indicators: https://codesandbox.io/p/sandbox/charming-moon-hktkp6?file=%2Fsrc%2Findex.js%3A106%2C30 return () => {} } diff --git a/packages/next/src/client/components/router-reducer/ppr-navigations.ts b/packages/next/src/client/components/router-reducer/ppr-navigations.ts index 16d1e7c6bc770..bbf19376f4fba 100644 --- a/packages/next/src/client/components/router-reducer/ppr-navigations.ts +++ b/packages/next/src/client/components/router-reducer/ppr-navigations.ts @@ -42,7 +42,7 @@ type SPANavigationTask = { // A special type used to bail out and trigger a full-page navigation. type MPANavigationTask = { - // MPA tasks are distinguised from SPA tasks by having a null `route`. + // MPA tasks are distinguished from SPA tasks by having a null `route`. route: null node: null dynamicRequestTree: null @@ -1211,7 +1211,7 @@ export function updateCacheNodeOnPopstateRestoration( // Only show prefetched data if the dynamic data is still pending. // - // Tehnically, what we're actually checking is whether the dynamic network + // Technically, what we're actually checking is whether the dynamic network // response was received. But since it's a streaming response, this does not // mean that all the dynamic data has fully streamed in. It just means that // _some_ of the dynamic data was received. But as a heuristic, we assume that diff --git a/packages/next/src/client/components/router-reducer/prefetch-cache-utils.ts b/packages/next/src/client/components/router-reducer/prefetch-cache-utils.ts index ad58763260cb0..1f8287591f0e7 100644 --- a/packages/next/src/client/components/router-reducer/prefetch-cache-utils.ts +++ b/packages/next/src/client/components/router-reducer/prefetch-cache-utils.ts @@ -325,7 +325,7 @@ function createLazyPrefetchEntry({ nextUrl, prefetchKind: kind, }).then((prefetchResponse) => { - // TODO: `fetchServerResponse` should be more tighly coupled to these prefetch cache operations + // TODO: `fetchServerResponse` should be more tightly coupled to these prefetch cache operations // to avoid drift between this cache key prefixing logic // (which is currently directly influenced by the server response) let newCacheKey diff --git a/packages/next/src/client/components/router-reducer/refetch-inactive-parallel-segments.ts b/packages/next/src/client/components/router-reducer/refetch-inactive-parallel-segments.ts index 17c0d4ef83260..776c215663275 100644 --- a/packages/next/src/client/components/router-reducer/refetch-inactive-parallel-segments.ts +++ b/packages/next/src/client/components/router-reducer/refetch-inactive-parallel-segments.ts @@ -88,7 +88,7 @@ async function refreshInactiveParallelSegmentsImpl({ } else { // When flightData is a string, it suggests that the server response should have triggered an MPA navigation // I'm not 100% sure of this decision, but it seems unlikely that we'd want to introduce a redirect side effect - // when refreshing on-screen data, so handling this has been ommitted. + // when refreshing on-screen data, so handling this has been omitted. } }) diff --git a/packages/next/src/client/components/segment-cache-impl/cache.ts b/packages/next/src/client/components/segment-cache-impl/cache.ts index c41a4a2dbff57..14337c837e795 100644 --- a/packages/next/src/client/components/segment-cache-impl/cache.ts +++ b/packages/next/src/client/components/segment-cache-impl/cache.ts @@ -1721,7 +1721,7 @@ export async function fetchSegmentPrefetchesUsingDynamicRequest( closed.resolve, function onResponseSizeUpdate(totalBytesReceivedSoFar) { // When processing a dynamic response, we don't know how large each - // individual segment is, so approximate by assiging each segment + // individual segment is, so approximate by assigning each segment // the average of the total response size. if (fulfilledEntries === null) { // Haven't received enough data yet to know which segments diff --git a/packages/next/src/client/components/segment-cache-impl/scheduler.ts b/packages/next/src/client/components/segment-cache-impl/scheduler.ts index b4b71e5565dbf..f1b90aa7bf0cd 100644 --- a/packages/next/src/client/components/segment-cache-impl/scheduler.ts +++ b/packages/next/src/client/components/segment-cache-impl/scheduler.ts @@ -167,7 +167,7 @@ const enum PrefetchTaskExitStatus { /** * Prefetch tasks are processed in two phases: first the route tree is fetched, - * then the segments. We use this to priortize tasks that have not yet fetched + * then the segments. We use this to prioritize tasks that have not yet fetched * the route tree. */ const enum PrefetchPhase { @@ -267,7 +267,7 @@ export function reschedulePrefetchTask( // task. This is essentially the same as canceling the task and scheduling // a new one, except it reuses the original object. // - // The primary use case is to increase the priority of a Link-initated + // The primary use case is to increase the priority of a Link-initiated // prefetch on hover. // Un-cancel the task, in case it was previously canceled. @@ -745,7 +745,7 @@ function diffRouteTreeAgainstCurrent( // Only routes that include a loading boundary can be prefetched in // this way. // - // This is simlar to a "full" prefetch, but we're much more + // This is similar to a "full" prefetch, but we're much more // conservative about which segments to include in the request. // // The server will only render up to the first loading boundary @@ -841,10 +841,10 @@ function pingPPRDisabledRouteTreeUpToLoadingBoundary( // This function is similar to pingRouteTreeAndIncludeDynamicData, except the // server is only going to return a minimal loading state — it will stop // rendering at the first loading boundary. Whereas a Full prefetch is - // intentionally aggressive and tries to pretfetch all the data that will be + // intentionally aggressive and tries to prefetch all the data that will be // needed for a navigation, a LoadingBoundary prefetch is much more // conservative. For example, it will omit from the request tree any segment - // that is already cached, regardles of whether it's partial or full. By + // that is already cached, regardless of whether it's partial or full. By // contrast, a Full prefetch will refetch partial segments. // "inside-shared-layout" tells the server where to start looking for a diff --git a/packages/next/src/client/link.tsx b/packages/next/src/client/link.tsx index 58d55153e8094..cfd3577195af3 100644 --- a/packages/next/src/client/link.tsx +++ b/packages/next/src/client/link.tsx @@ -120,7 +120,7 @@ type InternalLinkProps = { // `RouteInferType` is a stub here to avoid breaking `typedRoutes` when the type // isn't generated yet. It will be replaced when the webpack plugin runs. // WARNING: This should be an interface to prevent TypeScript from inlining it -// in declarations of libraries dependending on Next.js. +// in declarations of libraries depending on Next.js. // Not trivial to reproduce so only convert to an interface when needed. // eslint-disable-next-line @typescript-eslint/no-unused-vars export interface LinkProps extends InternalLinkProps {} diff --git a/packages/next/src/lib/metadata/types/extra-types.ts b/packages/next/src/lib/metadata/types/extra-types.ts index ca825b3b98a1d..a02c15ba32438 100644 --- a/packages/next/src/lib/metadata/types/extra-types.ts +++ b/packages/next/src/lib/metadata/types/extra-types.ts @@ -117,7 +117,7 @@ export type ResolvedPinterest = { // Format Detection // This is a poorly specified metadata export type that is supposed to -// control whether the device attempts to conver text that matches +// control whether the device attempts to convert text that matches // certain formats into links for action. The most supported example // is how mobile devices detect phone numbers and make them into links // that can initiate a phone call diff --git a/packages/next/src/lib/metadata/types/metadata-interface.ts b/packages/next/src/lib/metadata/types/metadata-interface.ts index 27b60ce4d249a..2defbcd2450a2 100644 --- a/packages/next/src/lib/metadata/types/metadata-interface.ts +++ b/packages/next/src/lib/metadata/types/metadata-interface.ts @@ -638,7 +638,7 @@ interface ResolvedMetadata extends DeprecatedMetadataFields { // meta name="abstract" // A brief description of what this web-page is about. - // Not recommended, superceded by description. + // Not recommended, superseded by description. // https://www.metatags.org/all-meta-tags-overview/meta-name-abstract/ abstract: null | string diff --git a/packages/next/src/next-devtools/README.md b/packages/next/src/next-devtools/README.md index b04c77f521c6b..ec6bed8dde5f2 100644 --- a/packages/next/src/next-devtools/README.md +++ b/packages/next/src/next-devtools/README.md @@ -31,7 +31,7 @@ This will start the Storybook server at `http://localhost:6006`. ### Styling -Next.js direcly injects CSS into the DOM via `