Skip to content

chore: remove rimraf#11913

Merged
petebacondarwin merged 2 commits intocloudflare:mainfrom
43081j:rimraf-purge
Feb 4, 2026
Merged

chore: remove rimraf#11913
petebacondarwin merged 2 commits intocloudflare:mainfrom
43081j:rimraf-purge

Conversation

@43081j
Copy link
Copy Markdown
Contributor

@43081j 43081j commented Jan 14, 2026

Part of #11854.

Summary of changes:

  • jest-image-snapshot dropped rimraf in 6.5.x. Updating means we can
    stop pulling it in across the board
  • miniflare now uses premove
  • pages-shared didn't use rimraf, so it has been removed
  • workers-shared didn't use rimraf, so it has been removed
  • workflows-shared now uses premove

This means rimraf is totally gone:

> pnpm why -r rimraf
(blank)

  • Tests
    • Tests included/updated
    • Automated tests not possible - manual testing has been completed as follows:
    • Additional testing not necessary because: Infra change only
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: Infra change only

Open with Devin

@43081j 43081j requested a review from a team as a code owner January 14, 2026 11:07
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Jan 14, 2026

⚠️ No Changeset found

Latest commit: 260d236

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Jan 14, 2026

create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@11913

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@11913

miniflare

npm i https://pkg.pr.new/miniflare@11913

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@11913

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@11913

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@11913

@cloudflare/vitest-pool-workers

npm i https://pkg.pr.new/@cloudflare/vitest-pool-workers@11913

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@11913

@cloudflare/workers-utils

npm i https://pkg.pr.new/@cloudflare/workers-utils@11913

wrangler

npm i https://pkg.pr.new/wrangler@11913

commit: 260d236

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 3 additional flags.

Open in Devin Review

@petebacondarwin
Copy link
Copy Markdown
Contributor

Can you explain why premove is a better dependency than rimraf?

@43081j
Copy link
Copy Markdown
Contributor Author

43081j commented Feb 2, 2026

sorry, the info is in the related issue

rimraf is ~3MB for what's basically a fs.rm call.

we can use premove (wrapper around fs.rm), or we can use fs.rm (via node -e or a script). either works but it doesn't make sense to pull a 3MB, 9 dependency package in to do it

@NuroDev
Copy link
Copy Markdown
Member

NuroDev commented Feb 2, 2026

rimraf is ~3MB for what's basically a fs.rm call.

Since we're only using rimraf as a dev dependency I think the size impact here is minimal.

Also baring in mind that premove has not been updated in 4 years. While that could be seen as "It's so simple it never needs to change", there is a few issues open for it so I'm unsure if it would be considered abandoned?

@43081j
Copy link
Copy Markdown
Contributor Author

43081j commented Feb 2, 2026

Since we're only using rimraf as a dev dependency I think the size impact here is minimal

and this is how we end up with bloated dependency trees. this stuff matters, even dev dependencies. if you can avoid pulling in 3MB of bloat to do something as simple as an fs.rm call, why wouldn't you? is there something in rimraf you need that you don't get through fs.rm?

im looking at the wider picture here, far beyond this repo. if we stop using it here, and every other significant repo, we've saved the world from petabytes worth of dead code. you can see my efforts of this on e18e.dev (the community i run which focuses on this).

premove is very much maintained. it genuinely hasn't needed changing in 5 years is all, and that is fine i think.

Copy link
Copy Markdown
Contributor

@petebacondarwin petebacondarwin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only uses of premove appear to be in package.json scripts where we want to clean up directories. Let's just write a tiny node.js script that does this with native APIs and then avoid this dependency too!

@github-project-automation github-project-automation Bot moved this from Untriaged to In Review in workers-sdk Feb 4, 2026
@43081j
Copy link
Copy Markdown
Contributor Author

43081j commented Feb 4, 2026

that makes sense to me too 👍

i'll rework it soon

@petebacondarwin
Copy link
Copy Markdown
Contributor

Would you like me to do it?

@43081j
Copy link
Copy Markdown
Contributor Author

43081j commented Feb 4, 2026

sure if you have time! i am stretched across a lot of things right now so it'd probably take me longer

Part of cloudflare#11854.

Summary of changes:

- `jest-image-snapshot` dropped `rimraf` in 6.5.x. Updating means we can
  stop pulling it in across the board
- miniflare now uses `premove`
- pages-shared didn't use `rimraf`, so it has been removed
- workers-shared didn't use `rimraf`, so it has been removed
- workflows-shared now uses `premove`

This means `rimraf` is totally gone:

```sh
> pnpm why -r rimraf
(blank)
```
@petebacondarwin
Copy link
Copy Markdown
Contributor

On it.

Create a simple cross-platform TypeScript utility in tools/clean/ that
uses Node.js's built-in fs.rmSync with recursive and force options.
This removes the premove dependency from wrangler, miniflare, and
workflows-shared packages.
@petebacondarwin petebacondarwin force-pushed the rimraf-purge branch 2 times, most recently from 89849dd to 260d236 Compare February 4, 2026 13:38
@github-project-automation github-project-automation Bot moved this from In Review to Approved in workers-sdk Feb 4, 2026
@petebacondarwin petebacondarwin merged commit 22c40ba into cloudflare:main Feb 4, 2026
38 of 40 checks passed
@github-project-automation github-project-automation Bot moved this from Approved to Done in workers-sdk Feb 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants