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 the rimraf dependency in favor of the built-in Node.js fs.rmSync #18106

Merged
merged 1 commit into from
May 16, 2024

Conversation

timvandermeij
Copy link
Contributor

In Node.js 14.14.0 the fs.rmSync function was added that removes files and directories. The recursive option is used to remove directories and their contents, making it a drop-in replacement for the rimraf dependency we use.

Given that PDF.js now requires Node.js 18+ we can be sure that this option is available, so we can safely remove rimraf and reduce the number of project dependencies.

Fixes #16337.

Thanks to @wojtekmaj, obviously credited as co-author of the commit, for providing the original implementation in #17696! For this patch, similar to what we did for the previous part in #17938, I have extracted the rimraf-only parts of that PR, with some changes to make sure that all Gulp targets work exactly as before, and tested all affected Gulp targets (using diff -r on the old/new build directories to recursively diff the contents of all directories and files) to make sure the output before/after this patch is identical.

…mSync`

In Node.js 14.14.0 the `fs.rmSync` function was added that removes files
and directories. The `recursive` option is used to remove directories
and their contents, making it a drop-in replacement for the `rimraf`
dependency we use.

Given that PDF.js now requires Node.js 18+ we can be sure that this
option is available, so we can safely remove `rimraf` and reduce the
number of project dependencies.

Co-authored-by: Wojciech Maj <kontakt@wojtekmaj.pl>
@timvandermeij
Copy link
Contributor Author

/botio-linux preview

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Received

Command cmd_preview from @timvandermeij received. Current queue size: 0

Live output at: http://54.241.84.105:8877/4531430de428dbc/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Success

Full output at http://54.241.84.105:8877/4531430de428dbc/output.txt

Total script time: 1.18 mins

Published

@timvandermeij
Copy link
Contributor Author

/botio unittest

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Received

Command cmd_unittest from @timvandermeij received. Current queue size: 0

Live output at: http://54.193.163.58:8877/766a874389a3110/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Received

Command cmd_unittest from @timvandermeij received. Current queue size: 0

Live output at: http://54.241.84.105:8877/cbc3f4e7bdee982/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Success

Full output at http://54.241.84.105:8877/cbc3f4e7bdee982/output.txt

Total script time: 2.57 mins

  • Unit Tests: Passed

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Success

Full output at http://54.193.163.58:8877/766a874389a3110/output.txt

Total script time: 11.50 mins

  • Unit Tests: Passed

Copy link
Collaborator

@Snuffleupagus Snuffleupagus left a comment

Choose a reason for hiding this comment

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

r=me, thank you for finishing this task!

@timvandermeij timvandermeij merged commit e8e9a3e into mozilla:master May 16, 2024
9 checks passed
@timvandermeij timvandermeij deleted the rimraf branch May 16, 2024 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Upgrade rimraf to version 5.0.0+
3 participants