Skip to content

chore: remove unused dependencies and exports - #746

Merged
harlan-zw merged 1 commit into
mainfrom
worktree-fallow-cleanup
Apr 22, 2026
Merged

harlan-zw merged 1 commit into
mainfrom
worktree-fallow-cleanup

Conversation

@harlan-zw

@harlan-zw harlan-zw commented Apr 21, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Cleanup pass based on npx fallow dead-code. All changes verified with pnpm build, pnpm vitest run, pnpm typecheck, and pnpm lint.

  • Unused deps removed
    • magic-string from unhead
    • oxc-parser from @unhead/react, @unhead/solid-js, @unhead/svelte (+ their build externals)
    • Root devDeps: fs-extra, @types/fs-extra, rollup-plugin-analyzer, utility-types
    • Solid-js devDeps: @solidjs/testing-library, vite-plugin-solid
    • Example deps: rollup-plugin-visualizer and vite-bundle-analyzer (vite-ssr-vue), react-router-dom (vite-ssr-react-ts)
    • Catalog (pnpm-workspace.yaml) entries for the above
  • Unlisted dep added: @rollup/plugin-node-resolve + rollup as explicit devDeps of packages/unhead (previously imported from build.config.ts with @ts-expect-error workarounds, now properly typed)
  • Unused exports unexported (kept as internal, not deleted)
    • NAMESPACES, MetaPackingSchema in packages/unhead/src/utils/meta.ts (only referenced in-file)
    • resolvedThenable, delayedPromise in examples/vite-ssr-react-streaming/src/utils/cache.ts

Kept (fallow false-positives):

  • packages/unhead/src/parser/index.ts exports (TagIdMap, parseAttributes, etc.) are public API, snapshotted in test/exports/unhead.yaml
  • packages/angular composables, exposed via public-api.ts which fallow couldn't resolve (ng-packagr)
  • Head.updateHead has direct test coverage
  • @vueuse/nuxt is registered in nuxt.config.ts modules
  • Angular example deps needed by Angular CLI/SSR at build time

Test plan

  • pnpm install
  • pnpm build
  • pnpm vitest run (1272 passed, 8 skipped)
  • pnpm typecheck
  • pnpm lint

Summary by CodeRabbit

  • Chores
    • Removed unused dependencies and optimized build configurations across packages.
    • Cleaned up internal module exports and TypeScript type declarations.
    • Updated dependency catalog with build tool improvements.

Findings from `npx fallow dead-code`:
- drop `magic-string` (unhead), `oxc-parser` (react/solid-js/svelte and
  their build externals), `fs-extra`, `@types/fs-extra`,
  `rollup-plugin-analyzer`, `utility-types` from root, plus unused
  example-only deps (`react-router-dom`, `rollup-plugin-visualizer`,
  `vite-bundle-analyzer`, `@solidjs/testing-library`, `vite-plugin-solid`)
- add `@rollup/plugin-node-resolve` and `rollup` as explicit devDeps of
  `packages/unhead` (previously imported from `build.config.ts` with
  `@ts-expect-error` workarounds)
- convert `NAMESPACES` and `MetaPackingSchema` in `unhead/utils/meta.ts`
  to internal (only used in-file)
- unexport helper thenables in the react-streaming example cache
@coderabbitai

coderabbitai Bot commented Apr 21, 2026 •

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: e06a9bb1-5088-45f0-b1ce-e282f4f3b5b6

📥 Commits

Reviewing files that changed from the base of the PR and between 0c0feee and fd6bf13.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (14)
  • examples/vite-ssr-react-streaming/src/utils/cache.ts
  • examples/vite-ssr-react-ts/package.json
  • examples/vite-ssr-vue/package.json
  • package.json
  • packages/react/build.config.ts
  • packages/react/package.json
  • packages/solid-js/build.config.ts
  • packages/solid-js/package.json
  • packages/svelte/build.config.ts
  • packages/svelte/package.json
  • packages/unhead/build.config.ts
  • packages/unhead/package.json
  • packages/unhead/src/utils/meta.ts
  • pnpm-workspace.yaml
💤 Files with no reviewable changes (6)
  • packages/react/package.json
  • packages/svelte/package.json
  • package.json
  • examples/vite-ssr-vue/package.json
  • examples/vite-ssr-react-ts/package.json
  • packages/unhead/build.config.ts

📝 Walkthrough

Walkthrough

This pull request removes the oxc-parser dependency across multiple packages, cleans up unused dependencies from example projects and the root workspace, moves some dependencies in the unhead package from runtime to devDependencies, and reduces the public API surface by making previously exported utility functions and constants file-scoped.

Changes

Cohort / File(s) Summary
oxc-parser Removal
packages/react/build.config.ts, packages/react/package.json, packages/solid-js/build.config.ts, packages/solid-js/package.json, packages/svelte/build.config.ts, packages/svelte/package.json
Removed oxc-parser from dependencies and build configuration externals across three framework packages.
Example Projects Cleanup
examples/vite-ssr-react-ts/package.json, examples/vite-ssr-vue/package.json
Removed unused runtime dependencies: react-router-dom from React example and rollup-plugin-visualizer, vite-bundle-analyzer from Vue example.
Root Workspace Dependencies
package.json, pnpm-workspace.yaml
Removed devDependencies (@types/fs-extra, fs-extra, rollup-plugin-analyzer, utility-types) from root package and workspace catalog; added @rollup/plugin-node-resolve@^16.0.3 to catalog.
Unhead Package Reorganization
packages/unhead/build.config.ts, packages/unhead/package.json
Moved @rollup/plugin-node-resolve and rollup from external dependencies to devDependencies; removed magic-string from runtime dependencies; eliminated TypeScript suppression comments in build config imports.
API Surface Reduction
examples/vite-ssr-react-streaming/src/utils/cache.ts, packages/unhead/src/utils/meta.ts
Made previously exported utility functions and constants non-exported: resolvedThenable, delayedPromise in cache module and NAMESPACES, MetaPackingSchema in meta utilities.
Solid-js Dependencies
packages/solid-js/package.json
Removed @solidjs/testing-library and vite-plugin-solid from devDependencies alongside oxc-parser removal.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 With hop and skip, we tidied up the shelf,
Removed what wasn't needed by itself,
Less oxc-parser, cleaner API,
The monorepo shines—hop, hop, hooray! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The description is comprehensive with detailed sections on what was removed, what was added, and what was intentionally kept. However, it does not follow the provided template structure with required sections like Type of Change. Use the provided PR template by checking the appropriate Type of Change box (likely Chore) and including the Linked issue section for completeness.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: removing unused dependencies and exports across the monorepo as part of a cleanup pass.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch worktree-fallow-cleanup

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@harlan-zw
harlan-zw merged commit afdf925 into main Apr 22, 2026
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant