Repository: vercel/next.js
File: packages/next/src/cli/next-dev.ts (TypeScript)

Code before:
  }

  // If neither --port nor PORT were specified, it's okay to retry new ports.
  const allowRetry = portSource === 'default'

  // We do not set a default host value here to prevent breaking
  // some set-ups that rely on listening on other interfaces
  const host = options.hostname

  if (
    options.experimentalUploadTrace &&
    !process.env.NEXT_TRACE_UPLOAD_DISABLED
  ) {
    traceUploadUrl = options.experimentalUploadTrace
  }

  const experimentalFlags = Object.fromEntries(
    Object.entries({
      experimentalServerFastRefresh: options.experimentalServerFastRefresh,
      experimentalCpuProf: options.experimentalCpuProf,
    }).filter(([_, value]) => value !== undefined && value !== false)
  )

  for (const [key, value] of Object.entries(experimentalFlags)) {
    sessionSpan.setAttribute(key, value)
  }

  initializeTraceState({
    ...exportTraceState(),
    defaultParentSpanId: sessionSpan.getId(),
  })

  const devServerOptions: StartServerOptions = {
    dir,
    port,
    allowRetry,
    isDev: true,
    hostname: host,
    experimentalServerFastRefresh: options.experimentalServerFastRefresh,
  }

  const startServerPath = require.resolve('../server/lib/start-server')

  async function startServer(startServerOptions: StartServerOptions) {
    return new Promise<void>((resolve) => {
      let resolved = false
      const defaultEnv = (initialEnv || process.env) as typeof process.env

      const nodeOptions = getParsedNodeOptions()

      let maxOldSpaceSize: string | number | undefined = getMaxOldSpaceSize()

Review comment (suggestion):
```suggestion
  const experimentalFlags = 
    Object.entries({
      experimentalServerFastRefresh: options.experimentalServerFastRefresh,
      experimentalCpuProf: options.experimentalCpuProf,
    }).filter(([_, value]) => value !== undefined && value !== false)
  

  for (const [key, value] of experimentalFlags) {
    sessionSpan.setAttribute(key, value)
  }
```



Code after:
  }

  // If neither --port nor PORT were specified, it's okay to retry new ports.
  const allowRetry = portSource === 'default'

  // We do not set a default host value here to prevent breaking
  // some set-ups that rely on listening on other interfaces
  const host = options.hostname

  if (
    options.experimentalUploadTrace &&
    !process.env.NEXT_TRACE_UPLOAD_DISABLED
  ) {
    traceUploadUrl = options.experimentalUploadTrace
  }

  const enabledFeatures = Object.fromEntries(
    Object.entries({
      experimentalServerFastRefresh: options.experimentalServerFastRefresh,
      experimentalCpuProf: options.experimentalCpuProf,
    }).filter(([_, value]) => value)
  )

  for (const [key, value] of Object.entries(enabledFeatures)) {
    sessionSpan.setAttribute(`feature.${key}`, value)
  }

  initializeTraceState({
    ...exportTraceState(),
    defaultParentSpanId: sessionSpan.getId(),
  })

  const devServerOptions: StartServerOptions = {
    dir,
    port,
    allowRetry,
    isDev: true,
    hostname: host,
    experimentalServerFastRefresh: options.experimentalServerFastRefresh,
  }

  const startServerPath = require.resolve('../server/lib/start-server')

  async function startServer(startServerOptions: StartServerOptions) {
    return new Promise<void>((resolve) => {
      let resolved = false
      const defaultEnv = (initialEnv || process.env) as typeof process.env

      const nodeOptions = getParsedNodeOptions()

      let maxOldSpaceSize: string | number | undefined = getMaxOldSpaceSize()