chore(core): remove deadweight dependencies#3368
Open
orrgottlieb wants to merge 1 commit into
Open
Conversation
Removes three dependencies from `@vibe/core` that are not used directly
by core's source:
- `react-inlinesvg ^4.1.3` — 0 production imports in `packages/core/src/`.
Only mocked in `vitest.setup.ts`; the mock target still resolves
because `@vibe/icon` continues to depend on it.
- `style-inject ^0.3.0` — 0 imports anywhere in core source.
- `react-is ^16.9.0` — single usage (`isForwardRef`) in `MenuButton.tsx`,
inlined as a 3-line helper using
`Symbol.for("react.forward_ref")`. Also drops `@types/react-is`.
These three packages are still pulled in transitively where actually
needed, so `yarn.lock` does not change. The win is for downstream
consumers: dropping them from `@vibe/core`'s declared deps means a
consumer importing only Button/Avatar/etc. doesn't pay for them.
Estimated bundle savings: ~25-38 KB gz combined.
Audit finding #7.
Contributor
Code Review by Qodo
1. Undeclared mocked dependency
|
Contributor
|
📦 Bundle Size Analysis ✅ No bundle size changes detected. Unchanged Components
📊 Summary:
|
rivka-ungar
reviewed
May 25, 2026
| const REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"); | ||
| const isForwardRef = (component: unknown): boolean => | ||
| component != null && (component as { $$typeof?: symbol }).$$typeof === REACT_FORWARD_REF_TYPE; | ||
|
|
Contributor
There was a problem hiding this comment.
This seems a bit risky. We're saving ~1.5 KB gz but coupling to an undocumented React internal (Symbol.for("react.forward_ref")). If React changes this in a future major version, the inline helper silently breaks with no build-time error. I'd keep react-is and just remove the other two deps - that's still the majority of the savings with none of the risk.
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.
User description
Summary
Removes three dependencies from
@vibe/corethat core does not use directly:react-inlinesvg ^4.1.3style-inject ^0.3.0react-is ^16.9.0yarn.lockis unchanged because these packages are still pulled in transitively where actually needed (e.g.@vibe/iconbringsreact-inlinesvg).Why
From a performance audit (item #7): every dep declared in
@vibe/core/package.jsonships to consumers. Three of these are dead weight that we can drop without affecting runtime behavior.Estimated bundle savings: ~25-38 KB gz combined for consumers that previously walked the dep graph through core.
Test plan
@vibe/corebuilds (the inlineisForwardRefmatchesreact-is's implementation)@vibe/coretests pass (mock target forreact-inlinesvgstill resolves)forwardRefcomponents correctly🤖 Generated with Claude Code
PR Type
Enhancement
Description
Remove three unused dependencies from
@vibe/corepackageReplace
react-iswith inlineisForwardRefhelper functionReduce bundle size by ~25-38 KB gzip for downstream consumers
Dependencies still available transitively where needed
Diagram Walkthrough
File Walkthrough
package.json
Remove three unused package dependenciespackages/core/package.json
react-inlinesvgfrom dependencies (unused in core source)react-isfrom dependencies (replaced with inline helper)style-injectfrom dependencies (unused in core source)@types/react-isfrom devDependenciesMenuButton.tsx
Inline isForwardRef helper to replace react-ispackages/core/src/components/MenuButton/MenuButton.tsx
isForwardReffromreact-isisForwardRefhelper function usingSymbol.for("react.forward_ref")$$typeofmatches React's forward refsymbol