Skip to content

chore: Use the isolated pnpm node_modules layout - #25368

Merged
isaacs merged 11 commits into
jp/node-modules-pnpm-isolatedfrom
jp/pnpm-isolated
Oct 22, 2026
Merged

isaacs merged 11 commits into
jp/node-modules-pnpm-isolatedfrom
jp/pnpm-isolated

Conversation

@JPeer264

@JPeer264 JPeer264 commented Oct 14, 2026 •

Copy link
Copy Markdown
Member

This moves the monorepo from the hoisted node_modules layout to the isolated pnpm default. Each package now declares the packages that it imports, instead of using what the root folder had. A full build gives the same files as with the hoisted layout.

  • Packages declare the dependencies that they imported from the hoisted root folder, with the version that the root folder had. The lockfile gets no new versions.
  • The root package.json no longer lists every workspace package as workspace:*. Each package declares the workspace packages that it imports, for example @sentry-internal/rollup-utils in the rollup configs. The root keeps three of them: @sentry-internal/node-integration-tests (its suites import it by name, also from tmp folders with their own package.json), @sentry/eslint-plugin-sdk (oxlint plugin) and @sentry/sveltekit (size-limit bundles its self-import).
  • @sentry/replay declares @sentry/conventions as a dev dependency, so its build still inlines the constant from there.
  • rollup-utils reads the sideEffects field of external packages from the nearest node_modules of the built package, not only from the root folder, and warns when it does not find an installed package there.
  • The integration test runner adds the bins of node-integration-tests to the PATH of setup commands (for example prisma generate), because the Bun and Deno packages run the shared suites with their own PATH.

packageExtensions decisions

@apm-js-collab/code-transformer-bundler-plugins imports the types of Vite, Rollup, webpack and esbuild without declaring them. pnpm-workspace.yaml declares them as optional peers, so its types use the Vite of the importing package. The real fix belongs upstream: apm-js-collab/code-transformer-bundler-plugins#49.

Peer decisions

autoInstallPeers stays false. The pnpm default (true) adds 674 package versions for peers that no package needs, for example @glimmer/component and the GraphQL tools of Gatsby.

@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

size-limit report 📦

Compared: 323884f (PR test merge using develop at 174ec26)

Against: f15e256 (develop) · base run #63142

⚠️ Baseline mismatch: 3 develop commit(s) in the PR build are missing from the baseline. Their size changes also affect this comparison. Compare commits. Re-run once develop's baseline build for 174ec26 finishes.

Path Size % Change Change
@sentry/browser 29.91 kB - -
@sentry/browser - with treeshaking flags 28.05 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 27.95 kB - -
@sentry/browser (incl. Tracing) 52.1 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 52.1 kB - -
@sentry/browser (incl. Tracing, Profiling) 55.05 kB - -
@sentry/browser (incl. Tracing, Replay) 91.85 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 80.72 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 96.58 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 109.52 kB - -
@sentry/browser (incl. Feedback) 47.42 kB - -
@sentry/browser (incl. sendFeedback) 34.97 kB - -
@sentry/browser (incl. FeedbackAsync) 40.07 kB - -
@sentry/browser (incl. Metrics) 30.93 kB - -
@sentry/browser (incl. Logs) 31.21 kB - -
@sentry/browser (incl. Metrics & Logs) 31.84 kB - -
@sentry/react 31.74 kB +0.01% +2 B 🔺
@sentry/react (incl. Tracing) 54.42 kB +0.01% +2 B 🔺
@sentry/vue 38.07 kB - -
@sentry/vue (incl. Tracing) 55.03 kB - -
@sentry/svelte 29.93 kB - -
@sentry/remix (Remix 3 client bundle) 57.11 kB - -
CDN Bundle 31.67 kB - -
CDN Bundle (incl. Tracing) 52.61 kB - -
CDN Bundle (incl. Logs, Metrics) 33.87 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 54.55 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 74.79 kB - -
CDN Bundle (incl. Tracing, Replay) 90.28 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 92.21 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 96.42 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 98.37 kB - -
CDN Bundle - uncompressed 93.29 kB - -
CDN Bundle (incl. Tracing) - uncompressed 156.14 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 99.84 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 162.11 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 229.88 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 276.31 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 282.26 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 290.01 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 295.96 kB - -
@sentry/nextjs (client) 57.3 kB -0.01% -1 B 🔽
@sentry/sveltekit (client) 52.48 kB - -
@sentry/core/server 41.85 kB - -
@sentry/core/browser 13.81 kB - -
@sentry/node 152.96 kB - -
@sentry/node/import (ESM hook with diagnostics-channel injection) 81.58 kB +0.01% +1 B 🔺
@sentry/node - without tracing 94.57 kB - -
@sentry/node - without channel injection 133.6 kB +0.01% +1 B 🔺
@sentry/aws-serverless 102.74 kB - -
@sentry/cloudflare (withSentry) - minified 192.31 kB - -
@sentry/cloudflare (withSentry) 478.7 kB +0.22% +1.04 kB 🔺
@sentry/nextjs/cloudflare (withSentry) - minified 213.28 kB - -

View base workflow run

@JPeer264
JPeer264 force-pushed the jp/pnpm-isolated branch 2 times, most recently from 755fc00 to 00d9d69 Compare October 14, 2026 20:33
@JPeer264
JPeer264 added this pull request to stack #25387 October 15, 2026 08:47
@JPeer264
JPeer264 force-pushed the jp/pnpm-isolated branch 2 times, most recently from f1386d1 to 5c6dd85 Compare October 15, 2026 11:20
@JPeer264
JPeer264 force-pushed the jp/pnpm-isolated branch 2 times, most recently from 3ab242c to 621c3a3 Compare October 15, 2026 14:57
Base automatically changed from jp/move-to-pnpm to develop October 19, 2026 06:56
@JPeer264
JPeer264 force-pushed the jp/pnpm-isolated branch 2 times, most recently from ee68feb to 94240b6 Compare October 19, 2026 10:06
@JPeer264
JPeer264 marked this pull request as ready for review October 19, 2026 10:59
@JPeer264
JPeer264 requested review from a team as code owners October 19, 2026 10:59
@JPeer264
JPeer264 requested a review from s1gr1d October 19, 2026 15:25

@isaacs isaacs left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor nits, but this mostly looks good to go.

Comment thread dev-packages/bundler-plugin-integration-tests/package.json Outdated
Comment thread packages/server-utils/package.json Outdated
Comment thread dev-packages/rollup-utils/npmHelpers.mjs
Comment thread dev-packages/node-integration-tests/utils/runner/createEsmAndCjsTests.ts Outdated
Comment thread dev-packages/node-integration-tests/utils/runner/createEsmAndCjsTests.ts Outdated
Comment thread pnpm-workspace.yaml Outdated
@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Optional E2E tests

Some optional checks were not successful. They do not block the merge. 1 failing, 63 successful. See the run.

Check Status
❌ CI: Optional E2E Tests / E2E node-anthropic-send-to-sentry (latest) Test (optional) Failing after 15s Details
Successful checks
Check Status
✅ CI: Optional E2E Tests / E2E cloudflare-think Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E astro-7-static Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E supabase-nextjs Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E tanstackstart-react-cloudflare Test (optional) Successful in 53s Details
✅ CI: Optional E2E Tests / E2E solidstart-2 Test (optional) Successful in 51s Details
✅ CI: Optional E2E Tests / E2E gen-ai-libraries (cloudflare) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E cloudflare-mastra Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E cloudflare-workers-send-to-sentry Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E node-flue Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E deno (latest) Test (optional) Successful in 49s Details
✅ CI: Optional E2E Tests / E2E nextjs-14 (latest) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E angular (canary) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E angular (canary) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E cloudflare-pi-durable (latest) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nextjs-16 (vinext) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E nextjs-16 (canary, turbopack) Test (optional) Successful in 4m Details
✅ CI: Optional E2E Tests / E2E node-flue (latest) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nextjs-15 (turbo) Test (optional) Successful in 3m Details
✅ CI: Optional E2E Tests / E2E nextjs-16-tunnel (cloudflare) Test (optional) Successful in 47s Details
✅ CI: Optional E2E Tests / E2E nuxt-5-sourcemaps (client source maps kept) Test (optional) Successful in 28s Details
✅ CI: Optional E2E Tests / E2E cloudflare-flue-send-to-sentry Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E node-express-send-to-sentry-static Test (optional) Successful in 53s Details
✅ CI: Optional E2E Tests / E2E nextjs-16 (cloudflare, latest) Test (optional) Successful in 6m Details
✅ CI: Optional E2E Tests / E2E gen-ai-libraries Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E node-fastify-6 (tracer provider) Test (optional) Successful in 8m Details
✅ CI: Optional E2E Tests / E2E node-eve Test (optional) Successful in 55s Details
✅ CI: Optional E2E Tests / E2E nextjs-orpc Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E astro-7 Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E nuxt-4 (canary) Test (optional) Successful in 4m Details
✅ CI: Optional E2E Tests / E2E node-anthropic-send-to-sentry Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E cloudflare-pi-durable Test (optional) Successful in 42s Details
✅ CI: Optional E2E Tests / E2E node-fastify-6 Test (optional) Successful in 25s Details
✅ CI: Optional E2E Tests / E2E node-eve (latest) Test (optional) Successful in 54s Details
✅ CI: Optional E2E Tests / E2E nextjs-16 (vinext, bun) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E node-pi-durable Test (optional) Successful in 35s Details
✅ CI: Optional E2E Tests / E2E node-express-mcp-v1 Test (optional) Successful in 39s Details
✅ CI: Optional E2E Tests / E2E nextjs-16 (deno) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E debug-id-sourcemaps Test (optional) Successful in 38s Details
✅ CI: Optional E2E Tests / E2E nextjs-16-standalone (canary, turbopack) Test (optional) Successful in 3m Details
✅ CI: Optional E2E Tests / E2E node-express-send-to-sentry Test (optional) Successful in 54s Details
✅ CI: Optional E2E Tests / E2E node-openai-decisions-send-to-sentry (latest) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-mastra Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nuxt-5 Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E node-express-mcp-v2 Test (optional) Successful in 24s Details
✅ CI: Optional E2E Tests / E2E nuxt-4-static (canary) Test (optional) Successful in 3m Details
✅ CI: Optional E2E Tests / E2E cloudflare-think (ai v6) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E cloudflare-agent Test (optional) Successful in 44s Details
✅ CI: Optional E2E Tests / E2E nextjs-14 (canary) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nextjs-15 (latest) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E vue-3 (no Options API) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-openai-send-to-sentry Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E node-pi-durable (latest) Test (optional) Successful in 33s Details
✅ CI: Optional E2E Tests / E2E react-send-to-sentry Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nuxt-5-sourcemaps (static / nuxt generate) Test (optional) Successful in 26s Details
✅ CI: Optional E2E Tests / E2E nextjs-16 (canary, webpack) Test (optional) Successful in 5m Details
✅ CI: Optional E2E Tests / E2E node-openai-decisions-send-to-sentry Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-eve (orchestrion) Test (optional) Successful in 46s Details
✅ CI: Optional E2E Tests / E2E node-openai-send-to-sentry (latest) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E react-router-7-framework-instrumentation Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E nuxt-3 (canary) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E node-mastra (latest) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nuxt-5-sourcemaps Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E vue-3 (canary) Test (optional) Successful in 57s Details

JPeer264 and others added 11 commits October 22, 2026 08:43
The test runs a webpack production build. On the Node 20 CI runners it
takes 3 to 5 seconds, close to the 5 second default timeout, and some
runs time out. Locally it takes about 0.3 seconds.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Remove `nodeLinker: hoisted` and `shamefullyHoist`, so pnpm installs its
default isolated layout. Each package now resolves only the dependencies
that it or the root package.json declares.

- Packages declare the dependencies that they imported from the hoisted
  root folder, with the version that the root folder had. The lockfile
  gets no new versions.
- `tslib` is a root devDependency, because the shared tsconfig sets
  `importHelpers`.
- @sentry/replay declares `@sentry/conventions` as a devDependency, so
  its build still inlines the constant that it imports from there.
- react-router, solidstart, sveltekit and tanstackstart-react declare
  `@types/node` 18 like the root. Without it, the optional `@types/node`
  peer of Vite resolves to version 20, and the Vite plugin types of
  @sentry/server-utils do not match.
- `packageExtensions` declares the bundlers as optional peers of
  @apm-js-collab/code-transformer-bundler-plugins, because its type
  declarations import them.
- rollup-utils reads the `sideEffects` field of an external package from
  the nearest node_modules folder of the built package, not only from the
  root folder. Without this, the builds keep empty imports of packages
  that are not in the root folder, for example `import '@sentry/core'`.
- The integration test runner adds the bins of node-integration-tests
  to the `PATH` of setup commands such as `prisma generate`, because the
  Bun and Deno packages run the shared suites with their own `PATH`.
- The install-playwright action runs `npx playwright` outside the
  repository. In the repository, npm finds the playwright version in
  `node_modules/.pnpm` and then runs `node_modules/.bin/playwright`,
  which the root folder no longer has.
- The size limit of `@sentry/cloudflare (withSentry)` goes from 514 KiB
  to 515 KiB. This check bundles without minification, so the bundle
  keeps the module paths, which are about 4 KB longer under
  `node_modules/.pnpm`. The code in the bundle is the same.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The root package.json listed every workspace package as a `workspace:*`
devDependency, so that each package could import any of them from the
root node_modules folder like with Yarn. Remove these entries and
declare the workspace packages in the packages that import them, for
example `@sentry-internal/rollup-utils` in the rollup configs.

The root keeps three of them:
- `@sentry-internal/node-integration-tests`, because its suites import
  it by its own name, also from tmp folders that have their own
  package.json.
- `@sentry/eslint-plugin-sdk`, because the root oxlint config loads it
  as a JS plugin.
- `@sentry/sveltekit`, because size-limit bundles its build output,
  which imports `@sentry/sveltekit/browser-tracing-variant`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@isaacs
isaacs merged commit 40eff80 into develop Oct 22, 2026
684 of 694 checks passed
@isaacs
isaacs deleted the jp/pnpm-isolated branch October 22, 2026 16:36
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.

3 participants