Skip to content

fix(imageRegistry): split data from flag-gated logic to avoid client bundle leak (#10692) - #15791

Merged
diegosouzapw merged 1 commit into
diegosouzapw:release/v3.8.52from
Junior-HJ:fix/client-bundle-image-registry-flag
Oct 8, 2026
Merged

diegosouzapw merged 1 commit into
diegosouzapw:release/v3.8.52from
Junior-HJ:fix/client-bundle-image-registry-flag

Conversation

@Junior-HJ

Copy link
Copy Markdown
Contributor

Summary

Fixes client bundle leak introduced in #15423 where open-sse/config/imageRegistry.ts statically imported isFeatureFlagEnabled from @/shared/utils/featureFlags.ts. Because imageRegistry.ts is in the static import graph of "use client" pages (MediaPageClient.tsx, mediaServiceKinds.ts via serviceKindIndex), Turbopack/Next.js attempted to bundle server-only database code (src/lib/db/core.ts) into the browser bundle, violating the invariant guarded by tests/unit/client-bundle-no-server-only-10692.test.ts.

Changes

Verification

  • tests/unit/client-bundle-no-server-only-10692.test.ts: passes ("no client entry point statically reaches server-only code"). Fails on origin/release/v3.8.52 before this fix with the exact MediaPageClient → imageRegistry → featureFlags → db/core trail.
  • grok-subscription-images-flag-off.test.ts: passes (2/2).
  • image-xai-subscription.test.ts: passes (4/4).
  • registry-direct-exports.test.ts: passes (20/20).

⚠️ base-red inherited: #15306

…/v3.8.52

Keep the data module out of the client flag path, and carry the tip's Codex
gpt-image entries with it.

Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
@diegosouzapw
diegosouzapw force-pushed the fix/client-bundle-image-registry-flag branch from 6f21036 to 9e8356a Compare October 8, 2026 12:57
@diegosouzapw
diegosouzapw merged commit 238803e into diegosouzapw:release/v3.8.52 Oct 8, 2026
8 of 9 checks passed
@diegosouzapw

Copy link
Copy Markdown
Owner

Thanks @Junior-HJ — the image catalog now lives in its own module so the client bundle does not pull the flag-gated registry. I rebased the branch onto the current release tip and kept that split. The resolution commit is on your branch, co-authored. This is in the upcoming release.

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.

2 participants