Skip to content

Remove yarn esbuild pnp plugin#33097

Merged
valentinpalkovic merged 1 commit into
storybookjs:nextfrom
mrginglymus:rm-esbuild-plugin
Nov 24, 2025
Merged

Remove yarn esbuild pnp plugin#33097
valentinpalkovic merged 1 commit into
storybookjs:nextfrom
mrginglymus:rm-esbuild-plugin

Conversation

@mrginglymus
Copy link
Copy Markdown
Contributor

@mrginglymus mrginglymus commented Nov 19, 2025

What I did

Remove @yarnpkg/esbuild-plugin-pnp.

Esbuild has natively and fully supported pnp since 0.15, well below the current minimum listed version of 0.18.

I've recently encountered a bug where the plugin was significantly behind in its resolution logic. Removing the plugin and allowing esbuild to resolve natively fixed the problem.

I appreciate that dropping support for yarn pnp is earmarked for 11, but ironically dropping this special case handling for yarn pnp actually impropes support for it. So...everyone wins?

Checklist for Contributors

Testing

The changes in this PR are covered in the following automated tests:

  • stories
  • unit tests
  • integration tests
  • end-to-end tests

Manual testing

This section is mandatory for all contributions. If you believe no manual test is necessary, please state so explicitly. Thanks!

Documentation

  • Add or update documentation reflecting your changes
  • If you are deprecating/removing a feature, make sure to update
    MIGRATION.MD

Checklist for Maintainers

  • When this PR is ready for testing, make sure to add ci:normal, ci:merged or ci:daily GH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found in code/lib/cli-storybook/src/sandbox-templates.ts

  • Make sure this PR contains one of the labels below:

    Available labels
    • bug: Internal changes that fixes incorrect behavior.
    • maintenance: User-facing maintenance tasks.
    • dependencies: Upgrading (sometimes downgrading) dependencies.
    • build: Internal-facing build tooling & test updates. Will not show up in release changelog.
    • cleanup: Minor cleanup style change. Will not show up in release changelog.
    • documentation: Documentation only changes. Will not show up in release changelog.
    • feature request: Introducing a new feature.
    • BREAKING CHANGE: Changes that break compatibility in some way with current major version.
    • other: Changes that don't fit in the above categories.

🦋 Canary release

This PR does not have a canary release associated. You can request a canary release of this pull request by mentioning the @storybookjs/core team here.

core team members can create a canary release here or locally with gh workflow run --repo storybookjs/storybook publish.yml --field pr=<PR_NUMBER>

Summary by CodeRabbit

  • Chores
    • Removed build tooling dependencies and associated build configurations to streamline the build setup.✏️ Tip: You can customize this high-level summary in your review settings.

@nx-cloud
Copy link
Copy Markdown

nx-cloud Bot commented Nov 19, 2025

View your CI Pipeline Execution ↗ for commit 46bd4d5

Command Status Duration Result
nx run-many -t build --parallel=3 ✅ Succeeded 44s View ↗

☁️ Nx Cloud last updated this comment at 2025-11-19 18:37:09 UTC

@yannbf yannbf added maintenance User-facing maintenance tasks yarn ci:normal labels Nov 19, 2025
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Nov 19, 2025

📝 Walkthrough

Walkthrough

The changes remove the PnP (Plug'n'Play) esbuild plugin support from the build configuration by deleting the devDependency from package.json and removing the corresponding plugin import and usage from the builder manager configuration.

Changes

Cohort / File(s) Summary
PnP plugin removal
code/core/package.json, code/core/src/builder-manager/index.ts
Removed the "@yarnpkg/esbuild-plugin-pnp" devDependency and its associated import and usage in the esbuild plugins configuration.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

✨ Finishing touches
  • 📝 Generate docstrings

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a29f6df and 46bd4d5.

⛔ Files ignored due to path filters (1)
  • code/yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (2)
  • code/core/package.json (0 hunks)
  • code/core/src/builder-manager/index.ts (1 hunks)
💤 Files with no reviewable changes (1)
  • code/core/package.json
🧰 Additional context used
🧬 Code graph analysis (1)
code/core/src/builder-manager/index.ts (1)
code/core/src/manager/globals/globals-module-info.ts (1)
  • globalsModuleInfoMap (35-55)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: normal
🔇 Additional comments (1)
code/core/src/builder-manager/index.ts (1)

105-105: Relying on esbuild’s native PnP resolver – confirm compatible esbuild minimum version

Removing the Yarn PnP plugin here and keeping only globalExternals(globalsModuleInfoMap) looks correct and simplifies the plugin chain; esbuild’s native PnP support should handle resolution in Yarn PnP projects as long as the project’s minimum esbuild version is high enough.

Please double‑check that all esbuild dependencies/peers in this repo (e.g., root package.json, code/core/package.json) are pinned to a version that includes native PnP support (≥ 0.15) and that there’s no remaining configuration or docs that still reference the removed plugin.


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

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Nov 19, 2025

📝 Walkthrough

Walkthrough

The pull request removes Yarn PnP (Plug'n'Play) esbuild plugin support from the build configuration. This includes removing the devDependency from the package manifest and eliminating the plugin's integration from the esbuild configuration in the builder manager.

Changes

Cohort / File(s) Summary
Dependency removal
code/core/package.json
Removed @yarnpkg/esbuild-plugin-pnp devDependency
Plugin configuration removal
code/core/src/builder-manager/index.ts
Removed pnpPlugin import and its registration in the esbuild plugins array; only globalExternals plugin remains active

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

  • Straightforward removal of an unused plugin dependency and its configuration
  • No changes to function signatures or public APIs
  • Minimal surface area across two files with clear, focused modifications

Possibly related PRs

✨ Finishing touches
  • 📝 Generate docstrings

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a29f6df and 46bd4d5.

⛔ Files ignored due to path filters (1)
  • code/yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (2)
  • code/core/package.json (0 hunks)
  • code/core/src/builder-manager/index.ts (1 hunks)
💤 Files with no reviewable changes (1)
  • code/core/package.json
🧰 Additional context used
🧬 Code graph analysis (1)
code/core/src/builder-manager/index.ts (1)
code/core/src/manager/globals/globals-module-info.ts (1)
  • globalsModuleInfoMap (35-55)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: normal
🔇 Additional comments (1)
code/core/src/builder-manager/index.ts (1)

105-105: LGTM! Relying on esbuild's native PnP support is the right approach.

The removal of the Yarn PnP esbuild plugin aligns with the PR objectives. esbuild has had native PnP support since v0.15, and the project uses v0.27.0, so this change correctly removes the deprecated plugin in favor of the native resolver.

The change at line 105 is clean: only globalExternals(globalsModuleInfoMap) remains in the plugins array, with the old pnpPlugin successfully removed. However, since there are no automated CI tests specifically covering Yarn PnP builds with the builder-manager, manual verification remains important before merging.


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

@storybook-app-bot
Copy link
Copy Markdown

Package Benchmarks

Commit: 46bd4d5, ran on 19 November 2025 at 20:01:31 UTC

The following packages have significant changes to their size or dependencies:

storybook

Before After Difference
Dependency count 39 39 0
Self size 19.20 MB 19.18 MB 🎉 -24 KB 🎉
Dependency size 16.40 MB 16.40 MB 0 B
Bundle Size Analyzer Link Link

@storybook/cli

Before After Difference
Dependency count 173 173 0
Self size 770 KB 770 KB 🎉 -84 B 🎉
Dependency size 66.17 MB 66.14 MB 🎉 -24 KB 🎉
Bundle Size Analyzer Link Link

@storybook/codemod

Before After Difference
Dependency count 166 166 0
Self size 30 KB 30 KB 0 B
Dependency size 64.74 MB 64.72 MB 🎉 -24 KB 🎉
Bundle Size Analyzer Link Link

create-storybook

Before After Difference
Dependency count 40 40 0
Self size 998 KB 998 KB 🎉 -84 B 🎉
Dependency size 35.60 MB 35.58 MB 🎉 -24 KB 🎉
Bundle Size Analyzer node node

@valentinpalkovic valentinpalkovic merged commit a166849 into storybookjs:next Nov 24, 2025
59 of 66 checks passed
@mrginglymus mrginglymus deleted the rm-esbuild-plugin branch November 24, 2025 14:12
@github-actions github-actions Bot mentioned this pull request Nov 24, 2025
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:normal maintenance User-facing maintenance tasks yarn

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants