Skip to content

The colors package used by the CLI pollutes the String prototype #5707

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

Closed
3 tasks done
rigor789 opened this issue Dec 7, 2022 · 0 comments · Fixed by #5722
Closed
3 tasks done

The colors package used by the CLI pollutes the String prototype #5707

rigor789 opened this issue Dec 7, 2022 · 0 comments · Fixed by #5722

Comments

@rigor789
Copy link
Member

rigor789 commented Dec 7, 2022

Issue Description

The colors module pollutes the string prototype (so it can do "text".bold etc), however this has a huge impact on strings. The issue mostly surfaces in webpack, since we are including the CLI library in it's utils to be able to read config values from nativescript.config.ts. That means, the string prototype is altered and affects the webpack compilation which relies on strings quite a lot, in the example case, it adds about 15 seconds to the build time.

More context:
NativeScript/NativeScript#10124

Proposal

Remove colors and switch to a light-weight library like ansi-colors and refactor any calls that use the prototype color modifiers.

Reproduction

No response

Relevant log output (if applicable)

No response

Environment

No response

Please accept these terms

@rigor789 rigor789 added bug-pending-triage Reported bug, pending triage to confirm. and removed bug-pending-triage Reported bug, pending triage to confirm. labels Dec 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant