Unverified Commit c98db81b authored by JJ Kasper's avatar JJ Kasper Committed by GitHub

Remove import type syntax from core files (#20379)

This removes `import type` usage from our core files since `import type` requires a higher TypeScript version than currently expected.

Fixes: https://github.com/vercel/next.js/issues/19300
parent aacb529f
...@@ -26,7 +26,7 @@ import { GetStaticPaths } from 'next/types' ...@@ -26,7 +26,7 @@ import { GetStaticPaths } from 'next/types'
import { denormalizePagePath } from '../next-server/server/normalize-page-path' import { denormalizePagePath } from '../next-server/server/normalize-page-path'
import { BuildManifest } from '../next-server/server/get-page-files' import { BuildManifest } from '../next-server/server/get-page-files'
import { removePathTrailingSlash } from '../client/normalize-trailing-slash' import { removePathTrailingSlash } from '../client/normalize-trailing-slash'
import type { UnwrapPromise } from '../lib/coalesced-function' import { UnwrapPromise } from '../lib/coalesced-function'
import { normalizeLocalePath } from '../next-server/lib/i18n/normalize-locale-path' import { normalizeLocalePath } from '../next-server/lib/i18n/normalize-locale-path'
const fileGzipStats: { [k: string]: Promise<number> } = {} const fileGzipStats: { [k: string]: Promise<number> } = {}
......
...@@ -8,7 +8,7 @@ import semver from 'next/dist/compiled/semver' ...@@ -8,7 +8,7 @@ import semver from 'next/dist/compiled/semver'
import TerserPlugin from './webpack/plugins/terser-webpack-plugin/src/index.js' import TerserPlugin from './webpack/plugins/terser-webpack-plugin/src/index.js'
import path from 'path' import path from 'path'
import webpack from 'webpack' import webpack from 'webpack'
import type { Configuration } from 'webpack' import { Configuration } from 'webpack'
import { import {
DOT_NEXT_ALIAS, DOT_NEXT_ALIAS,
NEXT_PROJECT_ROOT, NEXT_PROJECT_ROOT,
......
...@@ -5,8 +5,8 @@ import ReactDOM from 'react-dom' ...@@ -5,8 +5,8 @@ import ReactDOM from 'react-dom'
import { HeadManagerContext } from '../next-server/lib/head-manager-context' import { HeadManagerContext } from '../next-server/lib/head-manager-context'
import mitt from '../next-server/lib/mitt' import mitt from '../next-server/lib/mitt'
import { RouterContext } from '../next-server/lib/router-context' import { RouterContext } from '../next-server/lib/router-context'
import type Router from '../next-server/lib/router/router' import Router from '../next-server/lib/router/router'
import type { import {
AppComponent, AppComponent,
AppProps, AppProps,
PrivateRouteInfo, PrivateRouteInfo,
...@@ -15,7 +15,7 @@ import { delBasePath, hasBasePath } from '../next-server/lib/router/router' ...@@ -15,7 +15,7 @@ import { delBasePath, hasBasePath } from '../next-server/lib/router/router'
import { isDynamicRoute } from '../next-server/lib/router/utils/is-dynamic' import { isDynamicRoute } from '../next-server/lib/router/utils/is-dynamic'
import * as querystring from '../next-server/lib/router/utils/querystring' import * as querystring from '../next-server/lib/router/utils/querystring'
import * as envConfig from '../next-server/lib/runtime-config' import * as envConfig from '../next-server/lib/runtime-config'
import type { NEXT_DATA } from '../next-server/lib/utils' import { NEXT_DATA } from '../next-server/lib/utils'
import { getURL, loadGetInitialProps, ST } from '../next-server/lib/utils' import { getURL, loadGetInitialProps, ST } from '../next-server/lib/utils'
import initHeadManager from './head-manager' import initHeadManager from './head-manager'
import PageLoader, { StyleSheetTuple } from './page-loader' import PageLoader, { StyleSheetTuple } from './page-loader'
......
import { ComponentType } from 'react' import { ComponentType } from 'react'
import type { ClientSsgManifest } from '../build' import { ClientSsgManifest } from '../build'
import { import {
addBasePath, addBasePath,
addLocale, addLocale,
......
import { ComponentType } from 'react' import { ComponentType } from 'react'
import type { ClientBuildManifest } from '../build/webpack/plugins/build-manifest-plugin' import { ClientBuildManifest } from '../build/webpack/plugins/build-manifest-plugin'
import getAssetPathFromRoute from '../next-server/lib/router/utils/get-asset-path-from-route' import getAssetPathFromRoute from '../next-server/lib/router/utils/get-asset-path-from-route'
import requestIdleCallback from './request-idle-callback' import requestIdleCallback from './request-idle-callback'
......
...@@ -43,7 +43,7 @@ import { ...@@ -43,7 +43,7 @@ import {
} from '../next-server/server/normalize-page-path' } from '../next-server/server/normalize-page-path'
import { loadEnvConfig } from '@next/env' import { loadEnvConfig } from '@next/env'
import { PrerenderManifest } from '../build' import { PrerenderManifest } from '../build'
import type exportPage from './worker' import exportPage from './worker'
import { PagesManifest } from '../build/webpack/plugins/pages-manifest-plugin' import { PagesManifest } from '../build/webpack/plugins/pages-manifest-plugin'
import { getPagePath } from '../next-server/server/require' import { getPagePath } from '../next-server/server/require'
......
...@@ -21,8 +21,8 @@ ...@@ -21,8 +21,8 @@
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, // CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
import type webpack from 'webpack' import webpack from 'webpack'
import type http from 'http' import http from 'http'
export class WebpackHotMiddleware { export class WebpackHotMiddleware {
eventStream: EventStream eventStream: EventStream
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment