facebook / metro

🚇 The JavaScript bundler for React Native
https://metrobundler.dev
MIT License
5.24k stars 626 forks source link

Replace strip-ansi with native module #1366

Closed stianjensen closed 1 month ago

stianjensen commented 1 month ago

stripVTControlCharacters from Node core utilities provide the same functionality, and is available since Node 16.11. This project currently requires minimum Node 18.18.

See https://github.com/es-tooling/ecosystem-cleanup/issues/122 for similar efforts to replace this dependency in other projects.

facebook-github-bot commented 1 month ago

@robhogan has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

robhogan commented 1 month ago

Thanks for this @stianjensen! Always nice to remove a dependency.

stianjensen commented 1 month ago

I'm not so familiar with flow, so I'm not quite sure where the typings for util that are failing now come from.

robhogan commented 1 month ago

They're mostly compiled in to Flow, and can fall behind for newer APIs.

You can locally suppress with // $FlowIssue, but I'm happy to take care of that when I import.

stianjensen commented 1 month ago

I also managed to get type support merged into flow, but ignoring the types for now probably also works: https://github.com/facebook/flow/commit/19ca1f251e17cf7230ea8fee365d085d57c4e938

I'll leave it up to you!

facebook-github-bot commented 1 month ago

@robhogan merged this pull request in facebook/metro@0f8cabdf9d79c8fe6245276d8c73f8e401189168.