Expose timing information in debug mode#14553
Merged
Merged
Conversation
DEBUG=1
philipp-spiess
approved these changes
Sep 30, 2024
philipp-spiess
left a comment
Contributor
There was a problem hiding this comment.
Good stuff! one thought inline
Contributor
There was a problem hiding this comment.
What are your thoughts of moving this into the node specific library instead? This way we don't need to be too defensive with accessing process.env and we can use a proper export for the three clients instead of having to rely on private bundled imports:
import * as env from '../../tailwindcss/src/env'
Could also be maybe a tailwindcss-shared private package that we only use for this. It just seems strange that this file is in the tailwindcss package but not part of the released tailwindcss npm package at all
thecrypticace
approved these changes
Sep 30, 2024
This allows us to: 1. Not worry about `process` being available, because we are already in a node-like environment. 2. Use a proper import from the package
f10391a to
6017362
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR exposes when using the the
DEBUGenvironment variable. This follows theDEBUGconventions where:DEBUG=1DEBUG=trueDEBUG=*DEBUG=tailwindcssWill enable the debug information, but when using:
DEBUG=0DEBUG=falseDEBUG=-tailwindcssIt will not.
This currently only exposes some timings related to:
We can implement a more advanced version of this where we also expose more fine grained information such as the files we scanned, the amount of candidates we found and so on. But I believe that this will be enough to start triaging performance related issues.