Skip to content

chore: remove unused dependencies#37468

Merged
ggazzo merged 3 commits into
developfrom
chore/remove-deps
Nov 11, 2025
Merged

chore: remove unused dependencies#37468
ggazzo merged 3 commits into
developfrom
chore/remove-deps

Conversation

@rodrigok

@rodrigok rodrigok commented Nov 10, 2025

Copy link
Copy Markdown
Member

Reduces container image size

Proposed changes (including videos or screenshots)

Issue(s)

Steps to test or reproduce

Further comments

Summary by CodeRabbit

  • Chores
    • Updated dependency patch management configuration for improved stability
    • Removed unused build tool dependency from livechat package
    • Simplified SVG asset processing in build configuration

@dionisio-bot

dionisio-bot Bot commented Nov 10, 2025

Copy link
Copy Markdown
Contributor

Looks like this PR is ready to merge! 🎉
If you have any trouble, please check the PR guidelines

@changeset-bot

changeset-bot Bot commented Nov 10, 2025

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 83d3eab

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai

coderabbitai Bot commented Nov 10, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

Dependencies are removed from the PDF worker and livechat packages. A Yarn patch resolution is added for @sematext/gc-stats. The livechat webpack configuration is updated to remove image optimization from SVG asset handling.

Changes

Cohort / File(s) Summary
Dependency removals
ee/packages/pdf-worker/package.json, packages/livechat/package.json
Removed emoji-assets and image-webpack-loader devDependency respectively from package dependencies
Webpack SVG configuration
packages/livechat/webpack.config.ts
Removed image-webpack-loader from SVG rule, retaining only svg-component-loader and svg-loader for asset processing
Yarn patch resolution
package.json
Added new patch resolution for @sematext/gc-stats@npm:^1.5.9 pointing to a local patch file

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

  • Straightforward dependency removals across two packages
  • Single patch resolution addition following existing pattern
  • Webpack configuration change is localized and minimal
  • No complex logic or behavioral changes involved

Poem

🐰 Dependencies fall like autumn leaves,
Patches stack where gc-stats retrieves,
SVG loaders trimmed with care,
Lighter bundles float through air! ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and accurately summarizes the main change: removing unused dependencies to reduce container image size.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/remove-deps

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.

@codecov

codecov Bot commented Nov 10, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.10%. Comparing base (511a59e) to head (83d3eab).
⚠️ Report is 11 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #37468      +/-   ##
===========================================
- Coverage    68.13%   68.10%   -0.03%     
===========================================
  Files         3364     3364              
  Lines       115749   115755       +6     
  Branches     20907    20906       -1     
===========================================
- Hits         78866    78838      -28     
- Misses       34194    34229      +35     
+ Partials      2689     2688       -1     
Flag Coverage Δ
e2e 57.47% <ø> (+<0.01%) ⬆️
e2e-api 40.60% <ø> (+0.03%) ⬆️
unit 72.12% <ø> (-0.07%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@rodrigok rodrigok marked this pull request as ready for review November 11, 2025 16:12
@rodrigok rodrigok requested review from a team as code owners November 11, 2025 16:12
@ggazzo ggazzo added this to the 7.13.0 milestone Nov 11, 2025
@ggazzo ggazzo added the stat: QA assured Means it has been tested and approved by a company insider label Nov 11, 2025
@dionisio-bot dionisio-bot Bot added the stat: ready to merge PR tested and approved waiting for merge label Nov 11, 2025
@ggazzo ggazzo merged commit 2498e51 into develop Nov 11, 2025
65 of 66 checks passed
@ggazzo ggazzo deleted the chore/remove-deps branch November 11, 2025 16:15

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between a05b8f7 and 83d3eab.

⛔ Files ignored due to path filters (2)
  • .yarn/patches/@sematext-gc-stats-npm-1.5.9-01e77be4d0.patch is excluded by !**/.yarn/**
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (4)
  • ee/packages/pdf-worker/package.json (0 hunks)
  • package.json (1 hunks)
  • packages/livechat/package.json (0 hunks)
  • packages/livechat/webpack.config.ts (1 hunks)
💤 Files with no reviewable changes (2)
  • packages/livechat/package.json
  • ee/packages/pdf-worker/package.json
🔇 Additional comments (1)
packages/livechat/webpack.config.ts (1)

62-64: Change verified and approved.

The removal of image-webpack-loader is correct and safe. The custom svg-component-loader handles SVG-to-component conversion (the core functionality), while image-webpack-loader was only providing image optimization. Since SVG content is embedded directly in component code rather than served as separate image files, the loss of optimization is negligible and does not impact functionality.

Comment thread package.json
Comment on lines +82 to +83
"drachtio-srf": "patch:drachtio-srf@npm%3A5.0.12#~/.yarn/patches/drachtio-srf-npm-5.0.12-b0b1afaad6.patch",
"@sematext/gc-stats@npm:^1.5.9": "patch:@sematext/gc-stats@npm%3A1.5.9#~/.yarn/patches/@sematext-gc-stats-npm-1.5.9-01e77be4d0.patch"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Clarify the purpose of adding the @sematext/gc-stats patch.

The PR objective is to remove unused dependencies, but this change adds a new patch resolution for @sematext/gc-stats. Please clarify:

  1. Is this patch related to removing the dependency, or is it a separate fix?
  2. What does the patch do?
  3. Is @sematext/gc-stats still being used in the codebase after this PR?

Verify if @sematext/gc-stats is actually used in the codebase and inspect the patch contents:


🏁 Script executed:

#!/bin/bash
# Check if @sematext/gc-stats is used as a dependency
echo "=== Checking package.json files for @sematext/gc-stats dependency ==="
fd -e json package.json -x grep -l "@sematext/gc-stats" {}

echo -e "\n=== Checking for imports or requires of gc-stats in the codebase ==="
rg -nP --type=ts --type=js -C3 "(require|import).*gc-stats|gc-stats"

echo -e "\n=== Inspecting the patch file contents ==="
cat .yarn/patches/@sematext-gc-stats-npm-1.5.9-01e77be4d0.patch 2>/dev/null || echo "Patch file not found in current branch"

Length of output: 1152


</parameter>
</invoke>

---

🏁 Script executed:

```shell
#!/bin/bash
# Check if @sematext/gc-stats appears in dependencies section (not just resolutions)
echo "=== Checking for @sematext/gc-stats in dependencies section ==="
cat package.json | jq '.dependencies | has("@sematext/gc-stats")'

echo -e "\n=== Checking for @sematext/gc-stats in patchedDependencies section ==="
cat package.json | jq '.patchedDependencies | has("@sematext/gc-stats@npm:1.5.9") // "not found"'

echo -e "\n=== Checking if prometheus-gc-stats depends on @sematext/gc-stats ==="
rg -nP "prometheus-gc-stats" package.json -A2 -B2

echo -e "\n=== Checking patch resolutions section ==="
cat package.json | jq '.resolutions'

Length of output: 438



🏁 Script executed:

#!/bin/bash
# Check if @sematext/gc-stats appears in dependencies section (not just resolutions)
echo "=== Checking for @sematext/gc-stats in dependencies section ==="
cat package.json | jq '.dependencies | has("@sematext/gc-stats")'

echo -e "\n=== Checking for @sematext/gc-stats in patchedDependencies section ==="
cat package.json | jq '.patchedDependencies | keys[]' | grep -i sematext

echo -e "\n=== Checking resolutions section for @sematext/gc-stats ==="
cat package.json | jq '.resolutions | keys[]' | grep -i sematext

echo -e "\n=== Full patch resolutions section ==="
cat package.json | jq '.resolutions | to_entries[] | select(.key | contains("sematext"))'

echo -e "\n=== Checking prometheus-gc-stats entry in package.json ==="
cat package.json | jq '.dependencies | to_entries[] | select(.key | contains("prometheus"))'

Length of output: 543



🏁 Script executed:

#!/bin/bash
# Check all dependencies that remain
echo "=== All remaining dependencies ==="
cat package.json | jq '.dependencies | keys[]'

echo -e "\n=== All remaining devDependencies ==="
cat package.json | jq '.devDependencies | keys[]' | head -20

echo -e "\n=== Check for prometheus references in dependencies ==="
cat package.json | jq '.dependencies | keys[]' | grep -i prometheus

echo -e "\n=== Check for prometheus in devDependencies ==="
cat package.json | jq '.devDependencies | keys[]' | grep -i prometheus

echo -e "\n=== Check if patch file exists ==="
if [ -f .yarn/patches/@sematext-gc-stats-npm-1.5.9-01e77be4d0.patch ]; then
  echo "Patch file exists. Size:"
  wc -l .yarn/patches/@sematext-gc-stats-npm-1.5.9-01e77be4d0.patch
else
  echo "Patch file does not exist"
fi

Length of output: 436



🏁 Script executed:

#!/bin/bash
# View the patch file contents
echo "=== Patch file contents ==="
cat .yarn/patches/@sematext-gc-stats-npm-1.5.9-01e77be4d0.patch

echo -e "\n=== Check if collectMetrics.ts import is still present ==="
rg -nP "prometheus-gc-stats" apps/meteor/app/metrics/server/lib/collectMetrics.ts

echo -e "\n=== Check for any gc-stats usage in the entire codebase ==="
rg -nP "prometheus-gc-stats|gc-stats" apps/ --type=ts --type=js | head -20

echo -e "\n=== Check if metrics file or collectMetrics is removed ==="
fd -e ts -e js metrics collectMetrics | head -10

Length of output: 790


Remove patch resolution and fix broken prometheus-gc-stats import or restore the dependency.

The patch resolution for @sematext/gc-stats should not be added. Critical issue discovered:

  1. prometheus-gc-stats was removed from dependencies, but code still imports it at apps/meteor/app/metrics/server/lib/collectMetrics.ts:10
  2. The patch file content (removes "depcheck") is unrelated to @sematext/gc-stats
  3. The patch resolution is orphaned with no parent dependency to patch

Either restore prometheus-gc-stats as a dependency, or remove the import and associated code from collectMetrics.ts.

🤖 Prompt for AI Agents
In package.json around lines 82-83, a patch resolution for @sematext/gc-stats
was added but the project removed prometheus-gc-stats (which collectMetrics.ts
still imports) and the patch file content is unrelated, leaving an orphaned
patch; either restore prometheus-gc-stats as a dependency so the patch applies,
or remove the import and related GC metrics usage from
apps/meteor/app/metrics/server/lib/collectMetrics.ts. To fix: decide whether to
keep GC metrics—if yes, add prometheus-gc-stats back to package.json at the
correct version and remove the stray patch or update the patch to actually
target @sematext/gc-stats; if no, remove the import line and all references to
prometheus-gc-stats from collectMetrics.ts and delete the @sematext/gc-stats
patch resolution from package.json so there are no orphaned patches.

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

Labels

stat: QA assured Means it has been tested and approved by a company insider stat: ready to merge PR tested and approved waiting for merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants