Skip to content

Commit 982fff3

Browse files
authored
Always display version indicator (vercel#74774)
### What Remove the condition to check when version indicator can be displayed as it doesn't have to be coupled with test mode or telemetry
1 parent 4ef926b commit 982fff3

File tree

2 files changed

+5
-19
lines changed

2 files changed

+5
-19
lines changed

packages/next/src/server/dev/hot-reloader-turbopack.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -631,9 +631,7 @@ export async function createHotReloaderTurbopack(
631631
getNextErrorFeedbackMiddleware(opts.telemetry),
632632
]
633633

634-
const versionInfoPromise = getVersionInfo(
635-
isTestMode || opts.telemetry.isEnabled
636-
)
634+
const versionInfoPromise = getVersionInfo()
637635

638636
let devtoolsFrontendUrl: string | undefined
639637
const nodeDebugType = getNodeDebugType()

packages/next/src/server/dev/hot-reloader-webpack.ts

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,6 @@ import { getNodeDebugType } from '../lib/utils'
8686
import { getNextErrorFeedbackMiddleware } from '../../client/components/react-dev-overlay/server/get-next-error-feedback-middleware'
8787

8888
const MILLISECONDS_IN_NANOSECOND = BigInt(1_000_000)
89-
const isTestMode = !!(
90-
process.env.NEXT_TEST_MODE ||
91-
process.env.__NEXT_TEST_MODE ||
92-
process.env.DEBUG
93-
)
9489

9590
function diff(a: Set<any>, b: Set<any>) {
9691
return new Set([...a].filter((v) => !b.has(v)))
@@ -196,13 +191,9 @@ function erroredPages(compilation: webpack.Compilation) {
196191
return failedPages
197192
}
198193

199-
export async function getVersionInfo(enabled: boolean): Promise<VersionInfo> {
194+
export async function getVersionInfo(): Promise<VersionInfo> {
200195
let installed = '0.0.0'
201196

202-
if (!enabled) {
203-
return { installed, staleness: 'unknown' }
204-
}
205-
206197
try {
207198
installed = require('next/package.json').version
208199

@@ -751,21 +742,18 @@ export default class HotReloaderWebpack implements NextJsHotReloaderInterface {
751742
})
752743
}
753744

754-
private async tracedGetVersionInfo(span: Span, enabled: boolean) {
745+
private async tracedGetVersionInfo(span: Span) {
755746
const versionInfoSpan = span.traceChild('get-version-info')
756747
return versionInfoSpan.traceAsyncFn<VersionInfo>(async () =>
757-
getVersionInfo(enabled)
748+
getVersionInfo()
758749
)
759750
}
760751

761752
public async start(): Promise<void> {
762753
const startSpan = this.hotReloaderSpan.traceChild('start')
763754
startSpan.stop() // Stop immediately to create an artificial parent span
764755

765-
this.versionInfo = await this.tracedGetVersionInfo(
766-
startSpan,
767-
isTestMode || this.telemetry.isEnabled
768-
)
756+
this.versionInfo = await this.tracedGetVersionInfo(startSpan)
769757

770758
const nodeDebugType = getNodeDebugType()
771759
if (nodeDebugType && !this.devtoolsFrontendUrl) {

0 commit comments

Comments
 (0)