refine: remove no-op reportWebVitals from playground - #6233
Merged
Conversation
`reportWebVitals()` is called with no argument, and its body is guarded on that argument being a function, so the dynamic `import("web-vitals")` inside it never ran. Remove the module, its call site, and the `web-vitals` dependency it was the sole reachable importer of.
vanillajonathan
approved these changes
Aug 26, 2026
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.
Found during the nightly survey of
web/playground/src/.reportWebVitals()is called with no argument inmain.jsx, and its body is guarded onif (onPerfEntry && onPerfEntry instanceof Function)— so the guard is always false and the dynamicimport("web-vitals")inside it never runs. The module is Create React App boilerplate (note the stalebit.ly/CRA-vitalslink) that outlived the migration to Vite. This removes the module, its single call site, and theweb-vitalsdependency, which nothing else in the repo reaches.The dependency is worth removing rather than leaving inert: Dependabot watches
/web/playgroundfor npm, soweb-vitalsgenerates PRs that a maintainer reviews and merges for code that cannot execute.Verification
web-vitalsis referenced nowhere else — repo-wide grep over*.js,*.jsx,*.json,*.yaml,*.md(excludingnode_modules) returns onlyreportWebVitals.js, themain.jsximport/call, and thepackage.jsonentry, all of which this PR removes.package-lock.jsonwas edited surgically rather than regenerated: the runner's npm (10.9.8) is older than the one that wrote the lockfile and stripslibcmetadata from ~10 optional-dependency entries, which would be unrelated churn. The edit was cross-checked by runningnpm install --package-lock-only --ignore-scriptson a copy and diffing the resultingpackageskey set against the hand-edited file — the sets are identical, so the removal matches npm's own resolution.prettier --checkpasses onCHANGELOG.md,main.jsx, andpackage.json. Prettier fully parses the JSX, so the editedmain.jsxis syntactically valid.No regression test: the change deletes code that provably never executed, so there is no behavior to pin. The playground build in CI is the check that the removed import broke nothing.