Skip to content

fix(perf): replace string-width with fast-string-width#7105

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

fix(perf): replace string-width with fast-string-width#7105
43081j wants to merge 3 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

📝 Walkthrough

Walkthrough

This pull request replaces the string-width dependency with fast-string-width in the build package and updates the header renderer’s import. The existing header width computation remains unchanged.

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

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title clearly matches the main change: replacing string-width with fast-string-width for performance.
Description check ✅ Passed The description covers the motivation and checklist items, but it omits the required issue reference in the Summary section.
✨ 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.

@serhalp serhalp changed the title perf: remove string-width fix(perf): replace string-width with fast-string-width Jul 16, 2026
@serhalp serhalp enabled auto-merge (squash) July 16, 2026 17:03
@pkg-pr-new

pkg-pr-new Bot commented Jul 16, 2026

Copy link
Copy Markdown

Open in StackBlitz

@netlify/build

npm i https://pkg.pr.new/@netlify/build@7105

@netlify/build-info

npm i https://pkg.pr.new/@netlify/build-info@7105

@netlify/cache-utils

npm i https://pkg.pr.new/@netlify/cache-utils@7105

@netlify/config

npm i https://pkg.pr.new/@netlify/config@7105

@netlify/edge-bundler

npm i https://pkg.pr.new/@netlify/edge-bundler@7105

@netlify/functions-utils

npm i https://pkg.pr.new/@netlify/functions-utils@7105

@netlify/git-utils

npm i https://pkg.pr.new/@netlify/git-utils@7105

@netlify/headers-parser

npm i https://pkg.pr.new/@netlify/headers-parser@7105

@netlify/api

npm i https://pkg.pr.new/@netlify/api@7105

@netlify/nock-udp

npm i https://pkg.pr.new/@netlify/nock-udp@7105

@netlify/opentelemetry-sdk-setup

npm i https://pkg.pr.new/@netlify/opentelemetry-sdk-setup@7105

@netlify/opentelemetry-utils

npm i https://pkg.pr.new/@netlify/opentelemetry-utils@7105

@netlify/redirect-parser

npm i https://pkg.pr.new/@netlify/redirect-parser@7105

@netlify/run-utils

npm i https://pkg.pr.new/@netlify/run-utils@7105

@netlify/zip-it-and-ship-it

npm i https://pkg.pr.new/@netlify/zip-it-and-ship-it@7105

commit: 824eaf5

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