Home / Function/ warnFutureDeprecation() — vite Function Reference

warnFutureDeprecation() — vite Function Reference

Architecture documentation for the warnFutureDeprecation() function in deprecations.ts from the vite codebase.

Entity Profile

Dependency Diagram

graph TD
  43459d27_10c2_86a0_84b1_ecf5663dca68["warnFutureDeprecation()"]
  8e764982_4d15_ae9b_89fa_c657779af0c5["deprecations.ts"]
  43459d27_10c2_86a0_84b1_ecf5663dca68 -->|defined in| 8e764982_4d15_ae9b_89fa_c657779af0c5
  8d2a4ec7_9ff4_4748_5388_bbb3eedb7eb2["injectSsrFlag()"]
  8d2a4ec7_9ff4_4748_5388_bbb3eedb7eb2 -->|calls| 43459d27_10c2_86a0_84b1_ecf5663dca68
  8f73b680_d5b9_383c_f695_c906b80fb1e6["handleHMRUpdate()"]
  8f73b680_d5b9_383c_f695_c906b80fb1e6 -->|calls| 43459d27_10c2_86a0_84b1_ecf5663dca68
  24ecf2a1_3c09_d451_76f3_9485b4e993f8["_createServer()"]
  24ecf2a1_3c09_d451_76f3_9485b4e993f8 -->|calls| 43459d27_10c2_86a0_84b1_ecf5663dca68
  c3f72447_6ade_7e1a_5913_f1b30ae4a31f["resolveId()"]
  c3f72447_6ade_7e1a_5913_f1b30ae4a31f -->|calls| 43459d27_10c2_86a0_84b1_ecf5663dca68
  bff62ce1_58a6_b7b5_ef28_a3e2a2bc0779["load()"]
  bff62ce1_58a6_b7b5_ef28_a3e2a2bc0779 -->|calls| 43459d27_10c2_86a0_84b1_ecf5663dca68
  dcf6f9d5_316b_0287_6984_8729d3e6c0aa["transform()"]
  dcf6f9d5_316b_0287_6984_8729d3e6c0aa -->|calls| 43459d27_10c2_86a0_84b1_ecf5663dca68
  style 43459d27_10c2_86a0_84b1_ecf5663dca68 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/vite/src/node/deprecations.ts lines 55–97

export function warnFutureDeprecation(
  config: ResolvedConfig,
  type: keyof FutureOptions,
  extraMessage?: string,
  stacktrace = true,
): void {
  if (
    _ignoreDeprecationWarnings ||
    !config.future ||
    config.future[type] !== 'warn'
  )
    return

  let msg = `[vite future] ${deprecationMessages[type]}`
  if (extraMessage) {
    msg += ` ${extraMessage}`
  }
  msg = colors.yellow(msg)

  const docs = `${docsURL}/changes/${deprecationCode[type].toLowerCase()}`
  msg +=
    colors.gray(`\n  ${stacktrace ? '├' : '└'}─── `) +
    colors.underline(docs) +
    '\n'

  if (stacktrace) {
    const stack = new Error().stack
    if (stack) {
      let stacks = stack
        .split('\n')
        .slice(3)
        .filter((i) => !i.includes('/node_modules/vite/dist/'))
      if (stacks.length === 0) {
        stacks.push('No stack trace found.')
      }
      stacks = stacks.map(
        (i, idx) => `  ${idx === stacks.length - 1 ? '└' : '│'} ${i.trim()}`,
      )
      msg += colors.dim(stacks.join('\n')) + '\n'
    }
  }
  config.logger.warnOnce(msg)
}

Domain

Subdomains

Frequently Asked Questions

What does warnFutureDeprecation() do?
warnFutureDeprecation() is a function in the vite codebase, defined in packages/vite/src/node/deprecations.ts.
Where is warnFutureDeprecation() defined?
warnFutureDeprecation() is defined in packages/vite/src/node/deprecations.ts at line 55.
What calls warnFutureDeprecation()?
warnFutureDeprecation() is called by 6 function(s): _createServer, handleHMRUpdate, injectSsrFlag, load, resolveId, transform.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free