Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace pkg-up by an inlined solution #1303

Merged
merged 1 commit into from
Aug 25, 2024
Merged

Conversation

Kocal
Copy link
Contributor

@Kocal Kocal commented Aug 24, 2024

pkg-up is deprecated, and has been replaced by package-up. This one is more lightweight, but is only available as ESM format, which is not compatible with Encore.

So, I've dropped pkg-up and inlined package-up and its single dependency find-up-simple, with some tests.

Removing pkg-up remove a lot of sub-dependencies aswell, which is better in term of security, but also in term of bandwidth and size on disk.

Here, you can see the impact without pkg-up and with package-up, we reduce the bandwidth consumption by ~500 GB (but note that our inlined solution is smaller than package-up):

Package size report
===================

Package info for "@symfony/webpack-encore@4.6.1": 61 MB
  Released: 2024-01-25 17:18:00.95 +0000 UTC (30w1d ago)
  Downloads last week: 48,107 (32.02%)
  Estimated traffic last week: 2.9 TB
  Subdependencies: 634

Removed dependencies:
  - pkg-up@3.1.0: 36 kB (0.05%)
    Downloads last week: 6,317,196 (N/A% from 3.1.0)
    Downloads last week from "@symfony/webpack-encore@4.6.1": 48,107 (N/A%)
    Traffic last week: N/A
    Traffic from "@symfony/webpack-encore@4.6.1": 2.9 TB (N/A%)
    Subdependencies: 6 (0.94%)

Added dependencies:
  + package-up@5.0.0: 13 kB (0.02%)
    Downloads last week: 31,071 (N/A% from 5.0.0)
    Estimated traffic last week: N/A
    Subdependencies: 1 (0.15%)

Estimated new statistics:
  Package size: 61 MB → 51 MB (83.07%)
  Subdependencies: 634 → 486 (-148)
  Traffic with last week's downloads:
    For current version: 2.9 TB → 2.4 TB (498 GB saved)
    For all versions: 9.2 TB → 7.6 TB (1.6 TB saved)

@Kocal Kocal requested a review from stof August 24, 2024 07:05
@Kocal Kocal changed the title Replace pkg-up by an inlined solution Replace pkg-up by an inlined solution Aug 24, 2024
@Kocal Kocal added this to the 4.17 milestone Aug 24, 2024
@Kocal Kocal merged commit f22c114 into symfony:main Aug 25, 2024
@Kocal Kocal deleted the feat/drop-pkg-up branch August 25, 2024 07:02
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