You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
minor #1303 Replace pkg-up by an inlined solution (Kocal)
This PR was squashed before being merged into the main branch.
Discussion
----------
Replace `pkg-up` by an inlined solution
[`pkg-up`](https://www.npmjs.com/package/pkg-up) is deprecated, and has been replaced by [`package-up`](https://www.npmjs.com/package/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`](https://www.npmjs.com/package/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)
```
Commits
-------
d9cfde3 Replace `pkg-up` by an inlined solution
thrownewError('Cannot determine webpack context. (Are you executing webpack from a directory outside of your project?). Try passing the --context option.');
0 commit comments