Skip to content

fix(enhanced): resolve protocol requiredVersion from installed package - #5013

Open
tonoizer wants to merge 1 commit into
module-federation:mainfrom
tonoizer:fix/shared-required-version-protocol-specifiers
Open

fix(enhanced): resolve protocol requiredVersion from installed package#5013
tonoizer wants to merge 1 commit into
module-federation:mainfrom
tonoizer:fix/shared-required-version-protocol-specifiers

Conversation

@tonoizer

Copy link
Copy Markdown
Contributor

No description provided.

When shared dependencies use package-manager protocol specifiers
(catalog:, workspace:*, npm:, patch:, file:, link:, portal:), auto
requiredVersion no longer becomes '' or the protocol string. Consume
falls back to ^<installed version> from the resolved package.json.

@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: 9218099b4c

ℹ️ 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 331 to 334
getDescriptionFile(
compilation.inputFileSystem,
path.dirname(importResolved as string),
['package.json'],

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Resolve the configured package rather than the fallback module

When a protocol dependency uses the supported packageName option with a relative or alternative fallback import, this search starts from importResolved and therefore reads the fallback module's nearest package.json, not the configured package's manifest. For example, { import: './src/react-shim', packageName: 'react' } with react: 'catalog:' assigns the application's own version as React's required range, potentially rejecting compatible shared React versions or accepting incompatible ones. Resolve the installed packageName itself before constructing the caret range.

AGENTS.md reference: AGENTS.md:L289-L289

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.

2 participants