Skip to content

perf: remove string-width#7105

Open
43081j wants to merge 2 commits into
netlify:mainfrom
43081j:jg/the-purge-string-width
Open

perf: remove string-width#7105
43081j wants to merge 2 commits into
netlify:mainfrom
43081j:jg/the-purge-string-width

Conversation

@43081j

@43081j 43081j commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

We can use fast-string-width instead which is much faster and smaller, already in wide use too.


For us to review and ship your PR efficiently, please perform the following steps:

  • Open a bug/issue before writing your code 🧑‍💻. This ensures
    we can discuss the changes and get feedback from everyone that should be involved. If you`re fixing a typo or
    something that`s on fire 🔥 (e.g. incident related), you can skip this step.
  • Read the contribution guidelines 📖. This ensures
    your code follows our style guide and passes our tests.
  • Update or add tests (if any source code was changed or added) 🧪
  • Update or add documentation (if features were changed or added) 📝
  • Make sure the status checks below are successful ✅

A picture of a cute animal (not mandatory, but encouraged)

We can use fast-string-width instead which is much faster and smaller, already in wide use too.
@43081j 43081j requested a review from a team as a code owner June 25, 2026 13:37
@coderabbitai

coderabbitai Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d0171db8-54cb-40fd-a021-4e22ac395a8f

📥 Commits

Reviewing files that changed from the base of the PR and between 677f1bd and 29e610f.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (2)
  • packages/build/package.json
  • packages/build/src/log/header.ts
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • netlify/blueprints (manual)

📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes
    • Improved header display width handling for more consistent log formatting across different characters.
    • Updated the underlying string-width calculation to use a faster, compatible implementation.

Walkthrough

This pull request replaces the string-width package dependency with fast-string-width in the build package's manifest and updates the corresponding import statement in the header rendering module. No functional logic changes were made to the header width computation.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Changes

File Summary
packages/build/package.json Removed string-width and added fast-string-width to dependencies.
packages/build/src/log/header.ts Updated import of stringWidth to source from fast-string-width.

Sequence Diagram(s)

Not applicable — this change is a simple dependency substitution with no observable behavioral flow.

Related issues: None specified.

Related PRs: None specified.

Suggested labels: dependencies, chore

Suggested reviewers: None specified.

🐰 A tiny hop from one string to another,
Width still measured, no need to bother,
Fast-string-width now takes the lead,
Same old header, quicker indeed!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is missing the required Summary section and issue reference from the template. Add a Summary with Fixes # and briefly explain the motivation for replacing string-width.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the change: swapping out string-width for a faster alternative.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

e18e dependency analysis

No dependency warnings found.

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 this pull request may close these issues.

2 participants