-
Notifications
You must be signed in to change notification settings - Fork 10k
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
Conversation
…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>
/botio-linux preview |
From: Bot.io (Linux m4)ReceivedCommand cmd_preview from @timvandermeij received. Current queue size: 0 Live output at: http://54.241.84.105:8877/4531430de428dbc/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.241.84.105:8877/4531430de428dbc/output.txt Total script time: 1.18 mins Published |
/botio unittest |
From: Bot.io (Windows)ReceivedCommand cmd_unittest from @timvandermeij received. Current queue size: 0 Live output at: http://54.193.163.58:8877/766a874389a3110/output.txt |
From: Bot.io (Linux m4)ReceivedCommand cmd_unittest from @timvandermeij received. Current queue size: 0 Live output at: http://54.241.84.105:8877/cbc3f4e7bdee982/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.241.84.105:8877/cbc3f4e7bdee982/output.txt Total script time: 2.57 mins
|
From: Bot.io (Windows)SuccessFull output at http://54.193.163.58:8877/766a874389a3110/output.txt Total script time: 11.50 mins
|
There was a problem hiding this 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!
In Node.js 14.14.0 the
fs.rmSync
function was added that removes files and directories. Therecursive
option is used to remove directories and their contents, making it a drop-in replacement for therimraf
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 (usingdiff -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.