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
  3568c474_624e_066e_07ef_ed5bb1f93d4a["report()"]
  03e4298d_97be_716c_7ac2_ba21b535cf59["Symbol()"]
  03e4298d_97be_716c_7ac2_ba21b535cf59 -->|calls| 3568c474_624e_066e_07ef_ed5bb1f93d4a
  54f94230_6b90_dc87_08f9_66289e5b299d["end()"]
  3568c474_624e_066e_07ef_ed5bb1f93d4a -->|calls| 54f94230_6b90_dc87_08f9_66289e5b299d
  b5bcea8c_63d5_549c_8c7a_791740f2e1b3["reset()"]
  3568c474_624e_066e_07ef_ed5bb1f93d4a -->|calls| b5bcea8c_63d5_549c_8c7a_791740f2e1b3
  45a1211a_0f49_f94e_7ab9_cb0ea97784fa["dim()"]
  3568c474_624e_066e_07ef_ed5bb1f93d4a -->|calls| 45a1211a_0f49_f94e_7ab9_cb0ea97784fa
  b5e272ae_7cd9_bef8_9b59_c0d24bdc0ac9["blue()"]
  3568c474_624e_066e_07ef_ed5bb1f93d4a -->|calls| b5e272ae_7cd9_bef8_9b59_c0d24bdc0ac9
  4cd99e59_ac1e_2a1f_0946_33cc1afd2532["get()"]
  3568c474_624e_066e_07ef_ed5bb1f93d4a -->|calls| 4cd99e59_ac1e_2a1f_0946_33cc1afd2532
  style 3568c474_624e_066e_07ef_ed5bb1f93d4a 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()
  }

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