-
Notifications
You must be signed in to change notification settings - Fork 311
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Richer debugging information that can power a dev-tools extension #723
Comments
data-style-src
attribute
FYI I also came across a Chrome extension that claims to improve StyleX debugging: https://github.com/astahmer/atomic-css-devtools.
Maybe some of this needs to be built into styleq, since it's another type of merge across style objects. In StyleX, we can find soureMap file/line info like RSD does and add it to a compiled style as a specially-named prop (e.g., |
Yup I've seen it and installed it. It's a cleaner version of the "styles" panel, but it doesn't help track down the originating
I've been thinking about this as well. I actually have |
We currently generate a unique className for every
stylex.create
call the identifies the file, constant name and rule name. We should have a more rich system for adding debugging informationthat can then be used by a dev-tools extension.
What we would like is a list of all Style Objects applied with fileNames and line numbers, such as:
here the
data-style-src
attribute contains a list with the following information:package.json
file to find thename
of the package)All of this information should provide a future dev-tools extension to pull up the actual source for all the styles that are applied to an element in the order they are applied.
How it would need to work
It should be easy to find the needed metadata for this feature, but we would also need to find a way to attach the relevant metadata each compiled style rule.
stylex.props
data-style-src
attribute whenever{...stylex.props}
is used.Possible pitfalls
If the end developer uses
stylex.props
separately from the markup to then applyclassName
andstyle
manually, the compiler may not be able to reliably set thedata-
attribute.We should have a separate lint rule that discourages this pattern.
Alt: Richer information in classNames
The text was updated successfully, but these errors were encountered: