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

Replace strip-ansi with native stripVTControlCharacters #122

Open
Namchee opened this issue Oct 2, 2024 · 11 comments
Open

Replace strip-ansi with native stripVTControlCharacters #122

Namchee opened this issue Oct 2, 2024 · 11 comments
Labels
umbrella issue This issue contains a list of dependents of a package and tracks the progress in each

Comments

@Namchee
Copy link

Namchee commented Oct 2, 2024

Overview

stripVTControlCharacters from Node core utilities provide the same functionality.

Do note that this utility function requires Node 16.11.0 or higher.

@benmccann
Copy link

Some big ones:

  • enquirer
  • eslint
  • string-width
  • wrap-ansi

The latter two are by the same author as strip-ansi, so TBD if they'd want to swap. Worth a shot though

@pralkarz
Copy link

pralkarz commented Oct 2, 2024

Also:

  • stylelint
  • lerna
  • ava
  • astro
  • some packages in the jest monorepo

@43081j
Copy link
Collaborator

43081j commented Oct 4, 2024

The latter two are by the same author as strip-ansi, so TBD if they'd want to swap. Worth a shot though

Maybe we can go one level higher and migrate away from the packages consuming it?

@Namchee
Copy link
Author

Namchee commented Oct 4, 2024

Would like to include:

  • cucumber
  • gatsby
  • cspell

Done:

In Progress:

@Namchee
Copy link
Author

Namchee commented Oct 4, 2024

As for lerna, I think it's better for us to do it on nx instead since the stewardship has passed from Lerna

stianjensen added a commit to stianjensen/metro that referenced this issue Oct 6, 2024
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 e18e/ecosystem-issues#122 for
similar efforts to replace this dependency in other projects.
@benmccann
Copy link

I noticed today that enquirer says it has only a single dependency. It's not true, but would be if this migration were done

@Namchee
Copy link
Author

Namchee commented Oct 15, 2024

I don't think we can remove strip-ansi from enquirer as enquirer sets the engine to >=8.6

facebook-github-bot pushed a commit to facebook/metro that referenced this issue Oct 16, 2024
Summary:
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 e18e/ecosystem-issues#122 for similar efforts to replace this dependency in other projects.

Pull Request resolved: #1366

Reviewed By: huntie

Differential Revision: D63957530

Pulled By: robhogan

fbshipit-source-id: 0b6b3a7e7b076b1ff664b717ce77e1dcc203b0c7
@Fuzzyma Fuzzyma added the umbrella issue This issue contains a list of dependents of a package and tracks the progress in each label Dec 18, 2024
@talentlessguy
Copy link

talentlessguy commented Jan 25, 2025

PR for pnpm: pnpm/pnpm#9009

@talentlessguy
Copy link

a few more:

callstack/linaria#1433
protofire/solhint#632

@pralkarz
Copy link

npx github:Fuzzyma/e18e-tools strip-ansi -n 20 -q -o md -U https://npm.devminer.xyz/registry

# Downloads Traffic Version Package
1 666.62M 1449.23 GB ^7.1.0 string-width
2 606.56M 1318.65 GB ^7.1.0 wrap-ansi
3 385.73M 838.57 GB ^6.0.1 cliui
4 118.93M 258.56 GB ^7.1.0 string-length
5 117.05M 254.46 GB ^7.1.0 ora
6 108.98M 236.91 GB ^7.0.1 @isaacs/cliui
7 97.88M 212.79 GB ^6.0.0 @jest/reporters
8 96.66M 210.14 GB ^6.0.0 @jest/core
9 81.11M 176.34 GB ^7.1.0 log-update
10 80.86M 175.80 GB ^6.0.1 gauge
11 73.15M 159.02 GB ^6.0.1 enquirer
12 65.06M 141.45 GB ^6.0.1 table
13 47.57M 103.43 GB ^6.0.1 renderkid
14 24.51M 53.29 GB ^6.0.1 @inquirer/core
15 21.93M 47.67 GB ^6.0.1 jest-junit
16 21.75M 47.29 GB ^7.0.1 jest-watch-typeahead
17 18.70M 40.66 GB ^6.0.0 webpack-hot-middleware
18 18.40M 40.00 GB ^6.0.1 react-dev-utils
19 14.28M 31.04 GB ^6.0.1 columnify
20 11.60M 25.22 GB ^6.0.0 metro

@talentlessguy
Copy link

string-width is supposed to work in browsers, and I suppose so is wrap-ansi, same with string-length

metro still depends on strip-ansi but it's removal has been merged, just wasn't published.

gauge is deprecated.

we might have a good chance removing it from jest though

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
umbrella issue This issue contains a list of dependents of a package and tracks the progress in each
Projects
None yet
Development

No branches or pull requests

6 participants