-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Introduce React Scanner for component usage stats #65463
Conversation
Size Change: 0 B Total Size: 1.81 MB ℹ️ View Unchanged
|
6ecd093
to
78cd111
Compare
78cd111
to
4116e4e
Compare
Flaky tests detected in f0d1022. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/11593170963
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
4116e4e
to
311ef37
Compare
crawlFrom: './', | ||
// Needed for properly reporting components with dot notation | ||
includeSubComponents: true, | ||
// Exclude usage in tests, stories, and React Native files. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, good catch. Seems like the globs
doesn't work as expected. Seems like under the hood it uses a custom tool for the globbing part with different syntax - I'll fine-tune it next week to make it work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be fixed in a39d4db.
280a473
to
a39d4db
Compare
Ready for a last review when you get a chance @ciampo. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀
A few extra thoughts:
- do we care about tracking experimental APIs ?
- what about non-component exports, like hooks, Context providers, etc?
Thanks @ciampo!
Potentially, as you recognized earlier.
Maybe in the future. I think limiting to component exports sounds good for a first pass. |
I'll proceed and ship, we can always tweak it further if necessary. |
What?
This PR introduces
react-scanner
to keep an eye on component usage stats.Why?
It can be useful to track the adoption of our components over time.
How?
Running
react-scanner
with the default config to count components and props yields a result like this:Testing Instructions
npm install
npm run component-usage-stats
Testing Instructions for Keyboard
Same
Screenshots or screencast
None