react-native-community / discussions-and-proposals

Discussions and proposals related to the main React Native project
https://reactnative.dev
1.68k stars 126 forks source link

Replace `mkdirp` with `fs.mkdirSync(path, { recursive: true })` #815

Closed trivikr closed 1 month ago

trivikr commented 2 months ago

Introduction

Replace mkdirp with fs.mkdirSync(path, { recursive: true })

Details

The mkdirp utility is used at multiple places in react-native https://github.com/search?q=repo%3Afacebook%2Freact-native%20mkdirp&type=code

It can be replaced with Node.js native fs.mkdirSync added recursive option in Node.js v10.12.0 published on Oct 10, 2018.

Discussion points

The mkdirp currently uses these native APIs:

cortinico commented 2 months ago

It can be replaced with Node.js native fs.mkdirSync added recursive option in Node.js v10.12.0 published on Oct 10, 2018.

Feel free to send us a PR for that 👍

anirudhdream11 commented 1 month ago

I have replaced mkdirp with the native fs.mkdirSync(path, { recursive: true }). @cortinico Here's the PR for your review: https://github.com/facebook/react-native/pull/46388

Looking forward to your thoughts and let me know if you'd like to make any adjustments.

trivikr commented 1 month ago

Fixed in https://github.com/facebook/react-native/pull/46388