Skip to content

Remove unused build:profile-types and component-usage-stats scripts#79113

Merged
manzoorwanijk merged 1 commit into
trunkfrom
remove/unused-profile-types-and-react-scanner-scripts
Jun 11, 2026
Merged

Remove unused build:profile-types and component-usage-stats scripts#79113
manzoorwanijk merged 1 commit into
trunkfrom
remove/unused-profile-types-and-react-scanner-scripts

Conversation

@manzoorwanijk

Copy link
Copy Markdown
Member

What?

Removes two unused npm scripts from the root package.json along with their supporting files and dependencies:

Why?

Neither script appears to be in use:

  • build:profile-types is broken on trunk, likely for a long time, and nobody noticed.
  • component-usage-stats emits 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-scanner and its transitive dependencies) and reduces maintenance surface.

How?

  • Removed the build:profile-types and component-usage-stats scripts from package.json.
  • Removed the react-scanner devDependency and regenerated package-lock.json (removes react-scanner and its transitive dependencies: astray, dlv, dset, fdir, mri, sade, ts-api-utils).
  • Deleted react-scanner.config.js.
  • Removed the results and /ts-traces .gitignore entries, which only existed for the output of these two scripts.

The other tools referenced by build:profile-types (rimraf, tsgo via @typescript/native-preview) are still used by other scripts and remain untouched. @typescript/analyze-trace was invoked via npx --yes, so it was never a dependency.

Testing Instructions

  1. Run npm ci and verify the install completes cleanly.
  2. Verify npm run lint:lockfile and npm run lint:pkg-json pass.
  3. Confirm 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.

@github-actions

Copy link
Copy Markdown

Size Change: 0 B

Total Size: 8.59 MB

compressed-size-action

@manzoorwanijk manzoorwanijk added the [Type] Build Tooling Issues or PRs related to build tooling label Jun 11, 2026
@manzoorwanijk manzoorwanijk marked this pull request as ready for review June 11, 2026 12:50
@github-actions

github-actions Bot commented Jun 11, 2026

Copy link
Copy Markdown

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 props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: manzoorwanijk <[email protected]>
Co-authored-by: aduth <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@aduth aduth left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@manzoorwanijk manzoorwanijk merged commit d83ec0f into trunk Jun 11, 2026
59 of 60 checks passed
@manzoorwanijk manzoorwanijk deleted the remove/unused-profile-types-and-react-scanner-scripts branch June 11, 2026 13:58
@github-actions github-actions Bot added this to the Gutenberg 23.5 milestone Jun 11, 2026
@tyxla

tyxla commented Jun 11, 2026

Copy link
Copy Markdown
Member

Late to confirm, but I'm fine with removing this. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Type] Build Tooling Issues or PRs related to build tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants