Remove unused build:profile-types and component-usage-stats scripts#79113
Conversation
|
Size Change: 0 B Total Size: 8.59 MB |
|
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. |
aduth
left a comment
There was a problem hiding this comment.
LGTM 👍 These may be useful in niche cases, but based on current brokenness and lack of documentation or other integration, it's likely more burden than it helps at the moment. I'm interested in the original ideas from #65463 to monitor component usage stats, though this would need to be updated to account for new design system packages.
Surfacing my comments in Slack for visibililty:
Something like react-scanner feels like a tool that someone could be installed globally on their own machine if they want to use it, or we could encourage people to use as an npx command one-liner rather than permanently installed as a dependency, particularly if we don't have any custom configuration or otherwise integrate it into the project
I don't know much about the context behind the profile-types one, but assuming it's broken and not referenced anywhere else, seems like it could be reasonable to delete.
Ah, I missed that we do have a custom configuration for react-scanner. Still, I think it's telling if we don't actually document these commands anywhere that they may be niche enough to not warrant burdening everyone with that dependency. It feels like the risk of removing is low and the effort of restoring is easy if they are truly needed
I traced its inclusion to #65463, and I still agree with the motivation. Coincidentally I was looking just yesterday at ways to track component adoption, possibly using react-scanner, but not necessarily embedded in the project in the same way.
|
Late to confirm, but I'm fine with removing this. Thanks! |
What?
Removes two unused npm scripts from the root
package.jsonalong with their supporting files and dependencies:build:profile-types— profiles TypeScript builds and generates traces (added in Add npm script to profile TypeScript builds #68533).component-usage-stats— runsreact-scannerto collect@wordpress/componentsusage stats (added in Introduce React Scanner for component usage stats #65463).Why?
Neither script appears to be in use:
build:profile-typesis broken on trunk, likely for a long time, and nobody noticed.component-usage-statsemits a bunch of parsing errors when run, and there is no documentation about it anywhere in the repo.I asked in #core on Make WordPress Slack whether anyone still uses these, and there were no takers. Removing them trims an unused devDependency (
react-scannerand its transitive dependencies) and reduces maintenance surface.How?
build:profile-typesandcomponent-usage-statsscripts frompackage.json.react-scannerdevDependency and regeneratedpackage-lock.json(removesreact-scannerand its transitive dependencies:astray,dlv,dset,fdir,mri,sade,ts-api-utils).react-scanner.config.js.resultsand/ts-traces.gitignoreentries, which only existed for the output of these two scripts.The other tools referenced by
build:profile-types(rimraf,tsgovia@typescript/native-preview) are still used by other scripts and remain untouched.@typescript/analyze-tracewas invoked vianpx --yes, so it was never a dependency.Testing Instructions
npm ciand verify the install completes cleanly.npm run lint:lockfileandnpm run lint:pkg-jsonpass.grep -ri "react-scanner\|profile-types\|component-usage-stats" --exclude-dir=node_modules --exclude=package-lock.json .returns no results.Testing Instructions for Keyboard
N/A — no UI changes.
Use of AI Tools
This PR was authored with the assistance of Claude Code; all changes were reviewed by the PR author.