Home / Function/ report() — tailwindcss Function Reference

report() — tailwindcss Function Reference

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

Function typescript NodeBridge Compiler calls 5 called by 1

Entity Profile

Dependency Diagram

graph TD
  6dc1dd11_64c4_2049_6b20_5094d747fd15["report()"]
  f86cf69c_7c70_7a89_a666_593c4245917f["Instrumentation"]
  6dc1dd11_64c4_2049_6b20_5094d747fd15 -->|defined in| f86cf69c_7c70_7a89_a666_593c4245917f
  82d81cf8_f820_6c9d_8013_780eae3e5739["Symbol()"]
  82d81cf8_f820_6c9d_8013_780eae3e5739 -->|calls| 6dc1dd11_64c4_2049_6b20_5094d747fd15
  7f1a87a0_3ea8_7057_b711_5c7bdb1e0ce5["end()"]
  6dc1dd11_64c4_2049_6b20_5094d747fd15 -->|calls| 7f1a87a0_3ea8_7057_b711_5c7bdb1e0ce5
  c18b586a_a902_76e2_851b_7d243a526067["reset()"]
  6dc1dd11_64c4_2049_6b20_5094d747fd15 -->|calls| c18b586a_a902_76e2_851b_7d243a526067
  0d76a781_d7ba_58e6_725b_3d4bbfeb5185["dim()"]
  6dc1dd11_64c4_2049_6b20_5094d747fd15 -->|calls| 0d76a781_d7ba_58e6_725b_3d4bbfeb5185
  bca3941b_76ab_e9d5_d310_c2bf7c133f40["blue()"]
  6dc1dd11_64c4_2049_6b20_5094d747fd15 -->|calls| bca3941b_76ab_e9d5_d310_c2bf7c133f40
  5bcf4886_1230_a8ff_7302_a26cc5a9a525["get()"]
  6dc1dd11_64c4_2049_6b20_5094d747fd15 -->|calls| 5bcf4886_1230_a8ff_7302_a26cc5a9a525
  style 6dc1dd11_64c4_2049_6b20_5094d747fd15 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, defined in packages/@tailwindcss-node/src/instrumentation.ts.
Where is report() defined?
report() is defined in packages/@tailwindcss-node/src/instrumentation.ts at line 57.
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