Skip to content

Conversation

@avivkeller
Copy link
Member

@avivkeller avivkeller commented Jul 17, 2025

This PR reduces our dependency count and size by:

  1. Replaces eslint-plugin-react with a smaller alternative.
  2. Replace lint-staged with nano-staged, see https://github.com/es-tooling/module-replacements/blob/main/docs/modules/lint-staged.md
  3. Remove @orama/data-persistance, since Orama's builtin save function has the same functionality

Copilot AI review requested due to automatic review settings July 17, 2025 18:20
@avivkeller avivkeller requested a review from a team as a code owner July 17, 2025 18:20
@vercel
Copy link

vercel bot commented Jul 17, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
api-docs-tooling ✅ Ready (Inspect) Visit Preview Jul 17, 2025 10:09pm

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR reduces the project's dependency footprint by removing unnecessary packages and replacing a larger dependency with a smaller alternative. The changes maintain the same functionality while improving bundle size and reducing the number of dependencies.

  • Replaces lint-staged with the lighter nano-staged alternative
  • Removes eslint-plugin-react and its associated ESLint rules
  • Removes @orama/plugin-data-persistence dependency and uses Orama's built-in save function instead

Reviewed Changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
package.json Updates dependencies, removes unused packages, adds nano-staged configuration
src/generators/orama-db/index.mjs Replaces persistence plugin with built-in save function and manual file writing
eslint.config.mjs Removes React plugin and associated rules
.lintstagedrc.json Removes lint-staged configuration file
.husky/pre-commit Updates pre-commit hook to use nano-staged

@codecov
Copy link

codecov bot commented Jul 17, 2025

Codecov Report

Attention: Patch coverage is 42.85714% with 4 lines in your changes missing coverage. Please review.

Project coverage is 70.79%. Comparing base (8e48f0c) to head (4ef4fac).
Report is 1 commits behind head on main.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/generators/orama-db/index.mjs 42.85% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #360      +/-   ##
==========================================
- Coverage   70.80%   70.79%   -0.01%     
==========================================
  Files         128      127       -1     
  Lines       11621    11623       +2     
  Branches      694      694              
==========================================
+ Hits         8228     8229       +1     
- Misses       3390     3391       +1     
  Partials        3        3              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@avivkeller
Copy link
Member Author

See https://npmgraph.js.org/?q=https%3A%2F%2Fgithub.com%2Fnodejs%2Fapi-docs-tooling%2Fblob%2Fmain%2Fpackage.json#deps=devDependencies&color=outdated&sizing=&hide= for the size of the before

@avivkeller avivkeller closed this Jul 17, 2025
@avivkeller avivkeller deleted the chore/small-deps branch July 17, 2025 18:25
@avivkeller avivkeller restored the chore/small-deps branch July 17, 2025 18:25
@avivkeller avivkeller reopened this Jul 17, 2025
@avivkeller
Copy link
Member Author

(Whoops!)

@avivkeller
Copy link
Member Author

Not sure why https://github.com/nodejs/api-docs-tooling/actions/runs/16353383603/job/46205598868?pr=360, the dependency shown was not added/removed in this PR, it was already a dependency, I believe.

Copy link
Member

@AugustinMauroy AugustinMauroy left a comment

Choose a reason for hiding this comment

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

LGMT !

Copy link
Member

@araujogui araujogui left a comment

Choose a reason for hiding this comment

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

I'm worried about these package replacements because eslint-plugin-react and lint-staged are more popular, have a more robust community, enterprise support, and after all, it's just dev dependencies, it doesn't affect the client bundle size anyway.
So I'm -1

@ovflowd
Copy link
Member

ovflowd commented Jul 17, 2025

I'm worried about these package replacements because eslint-plugin-react and lint-staged are more popular, have a more robust community, enterprise support, and after all, it's just dev dependencies, it doesn't affect the client bundle size anyway. So I'm -1

The replacements are also good, and smaller and faster, I believe it's a good change. eslint-plugin-react-x ok... But nano-staged seems abandoned.

@avivkeller
Copy link
Member Author

I can revert back to lint-staged. Reducing the react and orama plugins was the primary goal.

@avivkeller
Copy link
Member Author

Bump @nodejs/web-infra

@avivkeller avivkeller merged commit 5d8bb46 into main Jul 24, 2025
16 of 17 checks passed
@avivkeller avivkeller deleted the chore/small-deps branch July 24, 2025 10:48
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.

5 participants