Some huge @eleventy core package size wins today from a few small changes after analyzing the package using @antfu’s Node Modules Inspector
Retiring unnecessary Node.js version back-compat is a good thing!
Also posted to Bluesky.
27 replies
@zachleat @eleventy @antfu sweet! some other observations:
- `var Promise = global.Promise;` is this still needed? i think `Promise` is already available in the global scope by itself 🤔
- why do `var EventEmitter = require('node:events').EventEmitter;` instead of `var { EventEmitter } = require('node:events');`? (why we are using `var` is another question entirely...)
- i would think you can use node's `path.posix` methods instead of relying on the `slash` package? see https://nodejs.org/api/path.html#windows-vs-posix.@uncenter yeah! I did start with #1 but punted after I couldn’t get the repo’s linter to agree with it 😬 #2 and #3 would make good contributions! (this is a fork of an old dependency repo, fwiw, see https://github.com/11ty/eleventy/issues/3299)
@zachleat > I couldn’t get the repo’s linter to agree with it
probably because eslint is on version 2! 😅
@uncenter I didn’t upgrade the dev deps — that package will go away in the future: https://github.com/11ty/eleventy/issues/3360
🤓👉👉
I… don’t know what this means 😅
This is the kind of analysis everyone should be doing 🥹
thanks James!
This is the one: bsky.app/profile/11ty...
With a special nod to this PR to GitHub user Jeffalo (not on bsky): github.com/11ty/elevent...
Absolutely love this. One of my first really large node projects (coincidentally inspired by 11ty’s appproach to many things) accumulated an ugly dependency count during its initial exploratory alpha stage and paring that down is slow, ugly, but rewarding work.
Yeah!! I love these kinds of improvements — they make installs faster and you can feel a little bit of the maintenance burden lift which is always lovely
No rifraf takes on new meaning 😀
we’ll take rif or raf but will absolutely not tolerate them together
This is a common one we've been cleaning up in @e18e.dev too. For anyone interested, if you need a cli, use premove. Otherwise, use fs.rm
You can probably switch to tinyglobby, yaml (slightly bigger but maintained, more correct), and a few others too 👀
Thank you very much! I’ve added those recs to our issue tracker:
I sent this thread to the community too and they picked out a few other things. Would you be happy for them to open issues? Or one umbrella issue to track all of the suggestions until they're accepted?
We will probably add an issue to the e18e issue tracker too to keep track of these contribs
just a side question: is there a CLI or package.json linter for github.com/es-tooling/m... ?
This lint plugin uses the manifests from the replacements repo to report usages
tyvm!
Oh wow that’d be amazing — an umbrella issue might be the easiest so I can triage the easiest! Thank you!
I’ve realized that I’ve linked to the issue and not the PR and am very embarrassed — what a gaffe, here is the PR: github.com/11ty/recursi...
This is the one: https://fosstodon.org/@eleventy/114110182403525096
With a special nod to GitHub user Jeffalo! (not on Mastodon)