Skip to content

docs: add a p-limit/p-map migration guide - #397

Merged
ppeeou merged 2 commits into
mainfrom
docs/p-map-migration
Aug 8, 2026
Merged

ppeeou merged 2 commits into
mainfrom
docs/p-map-migration

Conversation

@ppeeou

@ppeeou ppeeou commented Aug 8, 2026

Copy link
Copy Markdown
Member

Summary

Adds a migration guide (en/ko/ja/zh + sidebar entries) targeting the largest adjacent audience: p-limit (313M weekly downloads), p-map (78M), and p-queue (32M) users.

Semantics were verified empirically before writing. On an uneven-duration benchmark (concurrency 2):

  • p-map: 455ms — pool semantics (refill on completion)
  • FxTS concurrentPool(2): 458ms — same pool semantics, input-order results, first rejection aborts → this is the documented replacement
  • FxTS concurrent(2): 653ms — fixed windows; the guide explicitly warns migrators away from it for this use case

The guide is honest about non-goals: shared ad-hoc limiters (keep p-limit), stopOnError: false aggregation (Result-object pattern shown instead), and AbortSignal. It closes with what p-map cannot express: streaming consumption with each, early termination with take (unstarted work is never scheduled), and AsyncIterable sources.

Test plan

  • Full vitepress build docs passes locally with the new pages and sidebar entries
  • All four locales ship complete translations (i18n-check green)
  • Behavioral claims backed by the timing/order/error probes above

🤖 Generated with Claude Code

ppeeou and others added 2 commits August 8, 2026 17:24
escapeYamlString handled quotes and newlines but not backslashes, so
the escapeRegExp JSDoc summary produced `\,` inside the YAML
description and broke the vitepress website build ("unknown escape
sequence"). Escape backslashes first, then quotes.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Semantics verified empirically before writing: concurrentPool matches
p-map exactly (pool refill on completion, input-order results, first
rejection aborts - 455ms vs 458ms on an uneven-duration benchmark at
concurrency 2), while concurrent evaluates in fixed windows (653ms on
the same benchmark) and is therefore explicitly not recommended as the
p-map replacement. The guide is honest about non-goals: shared ad-hoc
limiters, stopOnError: false aggregation, and AbortSignal.

Adds the page in en/ko/ja/zh with sidebar entries; vitepress build
verified locally.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@ppeeou ppeeou self-assigned this Aug 8, 2026
@ppeeou
ppeeou merged commit bf98d29 into main Aug 8, 2026
4 checks passed
@ppeeou
ppeeou deleted the docs/p-map-migration branch August 8, 2026 13:58
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.

1 participant