Skip to content

[Suggestion]: Migrate from Yarn to pnpm #536

@ablfaxl

Description

@ablfaxl

Summary

This issue proposes migrating the project from Yarn to pnpm as the package manager.

🤔 Why pnpm?

pnpm offers several advantages over Yarn:

  • ⚡ Faster install times due to content-addressable storage
  • 💾 Disk space efficiency (shared dependencies)
  • 🔒 Strict dependency resolution (prevents phantom dependencies)
  • 🧠 Better monorepo support (if needed in the future)

🧪 Current State

The project currently uses Yarn (yarn.lock present).

🎯 Proposed Changes

  1. Remove Yarn-related files:

    • yarn.lock
  2. Install pnpm:

    npm install -g pnpm
  3. Generate lockfile:

    pnpm install
  4. Update scripts (if needed):
    Replace yarn commands with pnpm equivalents:

    • yarn devpnpm dev
    • yarn buildpnpm build
    • etc.
  5. Add .npmrc (optional but recommended):

    strict-peer-dependencies=false
  6. Update documentation:

    • README instructions to use pnpm instead of Yarn

⚠️ Considerations

  • Ensure CI/CD pipelines support pnpm
  • Verify compatibility with all dependencies
  • Confirm team alignment before switching

✅ Benefits

  • Reduced install time for contributors
  • Lower disk usage
  • More predictable dependency management

🙌 Open to Discussion

Happy to help with the migration or submit a PR if this proposal is accepted.

Page

No response

Details

📖 Details

Migrating from Yarn to pnpm is not just a preference change — it brings tangible improvements in performance, consistency, and developer experience.

pnpm uses a content-addressable storage mechanism, which means dependencies are stored once and shared across projects. This significantly reduces disk usage and speeds up installation, especially for contributors who frequently clone or update the repository.

Another important advantage is strict dependency resolution. Unlike Yarn (especially v1), pnpm prevents access to undeclared dependencies, which helps avoid hidden bugs and improves long-term maintainability.

From a contributor’s perspective, pnpm typically results in:

  • Faster install times
  • More predictable dependency trees
  • Cleaner node_modules structure

For a documentation-focused project like this (fa.react.dev GitHub repo), where contributors may frequently install dependencies for local development, these improvements can meaningfully enhance the onboarding experience.

Additionally, pnpm is becoming widely adopted in modern JavaScript ecosystems and aligns well with current best practices.

The migration process is relatively straightforward and low-risk, as it mainly involves replacing the lockfile and updating package manager commands.

Overall, this change would modernize the tooling and improve the development workflow without affecting the core functionality of the project.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions