docs: fix non-existent bridge-react/react import path - #4971
Open
Gmendesfonseca wants to merge 1 commit into
Open
docs: fix non-existent bridge-react/react import path#4971Gmendesfonseca wants to merge 1 commit into
bridge-react/react import path#4971Gmendesfonseca wants to merge 1 commit into
Conversation
The Producer and Consumer API tables in the React Bridge getting-started
guide point at `@module-federation/bridge-react/react`. That subpath is not
in the package's `exports` map and never has been, so the import fails to
resolve:
$ node -e "require.resolve('@module-federation/bridge-react/react')"
MODULE_NOT_FOUND
The correct entry for the legacy (React 16/17) `createBridgeComponent`, for
`createRemoteAppComponent` and for `lazyLoadComponentPlugin` is the package
root, which is what `apps/router-demo` and the sibling `load-app` /
`export-app` guides already use.
Replaces all 9 occurrences across en, zh and pt-BR.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The Producer API and Consumer API tables in the React Bridge getting-started guide point readers at
@module-federation/bridge-react/react. That subpath is not in the package'sexportsmap, so an import copied from these tables fails to resolve:git log -S'"./react"' -- packages/bridge/bridge-react/package.jsonreturns no commits, so this is a path that never existed rather than one that was removed and needs restoring. Neither of the two open PRs that modify thatexportsmap (#4837, #4869) adds it.The correct entry point for the legacy (React 16/17)
createBridgeComponent, forcreateRemoteAppComponentand forlazyLoadComponentPluginis the package root:apps/router-demouses the package root for all six of itscreateBridgeComponent/createRemoteAppComponentimports, and/v18,/v19and/pluginfor the rest./reactappears zero times.load-app.mdxandexport-app.mdxguides already use the package root in their code samples.So the getting-started tables currently contradict both the working examples and the neighbouring pages. A reader following the entry-point tables — the first concrete instruction on the page — hits a module resolution error before anything else.
This PR replaces all 9 occurrences across the English, Simplified Chinese and Brazilian Portuguese pages.
This is a documentation-only change. It does not change runtime behavior or the public API.
Validation
prettier --check apps/website-new/docs/{en,zh,pt-BR}/guide/bridge/react/getting-started.mdx— all matched files use Prettier code styleRelated Issue
N/A — documentation-only correction.
Types of changes
Checklist