Home / Function/ report() — tailwindcss Function Reference

report() — tailwindcss Function Reference

Architecture documentation for the report() function in instrumentation.ts from the tailwindcss codebase.

Entity Profile

Dependency Diagram

graph TD
  f47c57f6_c3e9_0d89_f276_2158dc0350b0["report()"]
  2b6cd468_4b76_718a_9e71_7bccbd357def["Symbol()"]
  2b6cd468_4b76_718a_9e71_7bccbd357def -->|calls| f47c57f6_c3e9_0d89_f276_2158dc0350b0
  bed21705_b820_6f10_d63b_c8f1c3245176["end()"]
  f47c57f6_c3e9_0d89_f276_2158dc0350b0 -->|calls| bed21705_b820_6f10_d63b_c8f1c3245176
  eac09f03_2681_3394_33de_3ba5152228e5["reset()"]
  f47c57f6_c3e9_0d89_f276_2158dc0350b0 -->|calls| eac09f03_2681_3394_33de_3ba5152228e5
  8cb20c90_d4ba_1a04_0164_a62f325e7d05["dim()"]
  f47c57f6_c3e9_0d89_f276_2158dc0350b0 -->|calls| 8cb20c90_d4ba_1a04_0164_a62f325e7d05
  b2ca18fe_1acd_049e_86dd_be244dfa19ec["blue()"]
  f47c57f6_c3e9_0d89_f276_2158dc0350b0 -->|calls| b2ca18fe_1acd_049e_86dd_be244dfa19ec
  0aa64a1c_efd8_a69d_48ed_649b7a86c854["get()"]
  f47c57f6_c3e9_0d89_f276_2158dc0350b0 -->|calls| 0aa64a1c_efd8_a69d_48ed_649b7a86c854
  style f47c57f6_c3e9_0d89_f276_2158dc0350b0 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/@tailwindcss-node/src/instrumentation.ts lines 57–100

  report(flush = this.defaultFlush) {
    let output: string[] = []
    let hasHits = false

    // Auto end any pending timers
    for (let i = this.#timerStack.length - 1; i >= 0; i--) {
      this.end(this.#timerStack[i].label)
    }

    for (let [label, { value: count }] of this.#hits.entries()) {
      if (this.#timers.has(label)) continue
      if (output.length === 0) {
        hasHits = true
        output.push('Hits:')
      }

      let depth = label.split('//').length
      output.push(`${'  '.repeat(depth)}${label} ${dim(blue(`× ${count}`))}`)
    }

    if (this.#timers.size > 0 && hasHits) {
      output.push('\nTimers:')
    }

    let max = -Infinity
    let computed = new Map<string, string>()
    for (let [label, { value }] of this.#timers) {
      let x = `${(Number(value) / 1e6).toFixed(2)}ms`
      computed.set(label, x)
      max = Math.max(max, x.length)
    }

    for (let label of this.#timers.keys()) {
      let depth = label.split('//').length
      output.push(
        `${dim(`[${computed.get(label)!.padStart(max, ' ')}]`)}${'  '.repeat(depth - 1)}${depth === 1 ? ' ' : dim(' ↳ ')}${label.split('//').pop()} ${
          this.#hits.get(label).value === 1 ? '' : dim(blue(`× ${this.#hits.get(label).value}`))
        }`.trimEnd(),
      )
    }

    flush(`\n${output.join('\n')}\n`)
    this.reset()
  }

Domain

Subdomains

Called By

Frequently Asked Questions

What does report() do?
report() is a function in the tailwindcss codebase.
What does report() call?
report() calls 5 function(s): blue, dim, end, get, reset.
What calls report()?
report() is called by 1 function(s): Symbol.

Analyze Your Own Codebase

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

Try Supermodel Free