-
Notifications
You must be signed in to change notification settings - Fork 370
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
chore: replace @ungap/from-entries with own helper #3491
Conversation
📊 Benchmark resultsComparing with 6d6022e Package size: 353 MB(no change)
Legend
|
I am not convinced using our own small modules instead of re-using others would be an improvement, for several reasons:
Small installation size is good, but we should also consider maintenance cost, security and stability, which are more important IMHO Overall, I don't think this would be an improvement and might distract us from other engineering initiatives. The installation size of cc @erezrokah @eduardoboucas @JGAntunes What do you all think? |
I agree with @ehmicky. There's no data the suggested approach helps with installation size. Closing the PR. We can further discuss in an issue if we chose to. |
- Summary
In the spirit of #3445, I took a look at our
package.json
to identify other modules we could likely bring into the repository to reduce installation time (which correlates more with number of packages, that with their individual size).@ungap/from-entries
is one of them: It's a polyfill forObject.fromEntries
, meaning a naive version can easily be rebuilt oneself. This PR introduces a naive replacement.Bringing it into the repository, however, brings a bigger maintance burden (writing tests, catching edge cases).
It's a good thing that there are specialised packages for this - but since
npm install
doesn't scale well with number of packages installed, it has a negative impact on CLI's install time.In order to bring down install time, we could think about bundling together oft-used modules in a netlify/utils package. Other candidates for that would be
@sindresorhus/slugify
andis-plain-obj
, both of which are used across CLI, Build, and Config. By bundling these dependencies at build-time ofnetlify/utils
(aka: shipping them as part of the own dist files, don#t include them in dependencies), we could bring down number of packages installed somewhat.OTOH, Netlify-controlled dependencies are most likely a drop in the sea, as long as packages that we don't want to bundle bring in these helper packages. So we likely won't see a noteworthy improvement from introducing
netlify/utils
.(this PR is not meant to be merged, but as an argument to the
read-pkg-up
debate)- Test plan
- A picture of a cute animal (not mandatory but encouraged)