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

Remove dependency on rifraf and make 11ty 18% smaller #3622

Open
1 task done
jeffalo opened this issue Jan 17, 2025 · 5 comments
Open
1 task done

Remove dependency on rifraf and make 11ty 18% smaller #3622

jeffalo opened this issue Jan 17, 2025 · 5 comments
Labels
enhancement: favorite Vanity label! The maintainer likes this enhancement request a lot. enhancement housekeeping

Comments

@jeffalo
Copy link

jeffalo commented Jan 17, 2025

Is your feature request related to a problem? Please describe.

I love 11ty, it's fast and lightweight, but it's still relatively big - my simple blog has 50MB of files in node_modules/, which is insane!

Simplifying the dependency tree would help reduce the risk of supply chain attacks, makes installs faster and is better for the environment. I'd be happy to work on this, but I think it would require some coordination to make we don't break semver.

Describe the solution you'd like

Remove outdated dependencies like 'polyfills' and other long dependency chains in-line with 11ty's minimum node version of 18.

npmgraph is a great site to visualize the dependency tree, I see a few areas with easy wins.

Image

@11ty/recursive-copy depends on this package 'rimraf', which adds 4MB of dependencies, just to delete directories (this has been built in since NodeJS 12, which is way below the minimum Node version 18 required for 11ty today)

Image

Fixing this should just be swapping to fs.rmdir in 11ty/recursive-copy

This is the single largest dependency chain in 11ty, and also looks like it brings in the most unrelated packages. Considering how simple it looks to remove, I think it would definitely be worth trying to get rid of.

I've already done this so far:

Describe alternatives you've considered

This has a similar effect to #3360, but doesn't require a minimum NodeJS bump.

Additional context

No response

@Ryuno-Ki
Copy link
Contributor

Sounds like another item for housekeeping label :-)

You can vote on issues like #3167 to help prioritise these updates.

@jeffalo jeffalo changed the title Cleaning up 11ty's dependencies Remove dependency on rifraf and make 11ty 18% smaller Jan 17, 2025
@zachleat
Copy link
Member

Would welcome a PR to https://github.com/11ty/recursive-copy 🙌🏻 these suggestions are great!

@zachleat zachleat added the enhancement: favorite Vanity label! The maintainer likes this enhancement request a lot. label Jan 17, 2025
@zachleat
Copy link
Member

Notably, this would be a breaking change for 11ty/recursive-copy but not 11ty/eleventy 👍🏻

@zachleat
Copy link
Member

I think fs.rm is the one you want though? (not fs.rmdir)

@jeffalo
Copy link
Author

jeffalo commented Jan 17, 2025

Done! It looks like it works at a first glance (passes all 59 tests), but I'm not sure if there's anything else I can/should test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement: favorite Vanity label! The maintainer likes this enhancement request a lot. enhancement housekeeping
Projects
None yet
Development

No branches or pull requests

3 participants