Skip to content

fix(observability-plugin): gate dev channels outside production#4746

Merged
2heal1 merged 2 commits into
module-federation:pre-release/2.5from
2heal1:codex/observability-debug-collector-error
May 20, 2026
Merged

fix(observability-plugin): gate dev channels outside production#4746
2heal1 merged 2 commits into
module-federation:pre-release/2.5from
2heal1:codex/observability-debug-collector-error

Conversation

@2heal1

@2heal1 2heal1 commented May 20, 2026

Copy link
Copy Markdown
Member

What changed

This updates the observability plugin so the local collector and devtools notification channels only run outside production mode.

Why

The local collector is a development-only path. In production, it should not attempt to notify the local collector or browser devtools channel.

Impact

Production pages will skip those development notification channels. Debug/local collector behavior remains available outside production mode.

Validation

  • pnpm --filter @module-federation/observability-plugin run test -- --runInBand
  • pnpm exec prettier --check packages/observability-plugin/src/core.ts packages/observability-plugin/__tests__/observability.spec.ts .changeset/quiet-collector-debug.md
  • pnpm --filter @module-federation/observability-plugin run lint
  • pnpm --filter @module-federation/observability-plugin run build
  • python .codex/skills/changeset-pr/scripts/run_changeset_status.py --verbose

@changeset-bot

changeset-bot Bot commented May 20, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9df464b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 46 packages
Name Type
@module-federation/observability-plugin Patch
@module-federation/devtools Patch
@module-federation/runtime Patch
@module-federation/enhanced Patch
@module-federation/rspack Patch
@module-federation/webpack-bundler-runtime Patch
@module-federation/sdk Patch
@module-federation/runtime-tools Patch
@module-federation/managers Patch
@module-federation/manifest Patch
@module-federation/dts-plugin Patch
@module-federation/third-party-dts-extractor Patch
@module-federation/bridge-react Patch
@module-federation/bridge-vue3 Patch
@module-federation/bridge-shared Patch
@module-federation/bridge-react-webpack-plugin Patch
@module-federation/modern-js Patch
@module-federation/modern-js-v3 Patch
@module-federation/retry-plugin Patch
@module-federation/rsbuild-plugin Patch
@module-federation/error-codes Patch
@module-federation/inject-external-runtime-core-plugin Patch
@module-federation/runtime-core Patch
create-module-federation Patch
@module-federation/cli Patch
@module-federation/rspress-plugin Patch
@module-federation/treeshake-server Patch
@module-federation/treeshake-frontend Patch
@module-federation/metro Patch
@module-federation/metro-plugin-rnef Patch
@module-federation/metro-plugin-rock Patch
@module-federation/metro-plugin-rnc-cli Patch
@module-federation/esbuild Patch
@module-federation/nextjs-mf Patch
@module-federation/node Patch
@module-federation/storybook-addon Patch
shared-tree-shaking-no-server-host Patch
shared-tree-shaking-no-server-provider Patch
@module-federation/utilities Patch
remote5 Patch
remote6 Patch
shared-tree-shaking-with-server-host Patch
shared-tree-shaking-with-server-provider Patch
website-new Patch
node-dynamic-remote-new-version Patch
node-dynamic-remote Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@2heal1 2heal1 marked this pull request as ready for review May 20, 2026 09:43
@2heal1 2heal1 merged commit a9858e7 into module-federation:pre-release/2.5 May 20, 2026
3 of 4 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e161823447

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +3404 to +3408
typeof process === 'undefined' ||
!process.env ||
typeof process.env.NODE_ENV === 'undefined'
) {
return false;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Treat missing NODE_ENV as non-production

shouldUseDevelopmentChannels now returns false whenever process/process.env.NODE_ENV is unavailable, which disables both notifyCollector and notifyDevtools in browser runtimes that do not expose process (common with modern ESM tooling). In those environments, even explicit debug activation (FEDERATION_DEBUG or browser debug storage) cannot reach the local collector/devtools path, so development observability regresses outside production despite this change being intended only to block production.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant