Repository navigation
Docs: Improve readability for React Native developers - #2121
Merged
Merged
Conversation
Summary: Rewrites the docs for React Native developers who know Metro from the product side (`metro.config.js`, `npx react-native start`, Fast Refresh) but not its internals, and who often land on a single section from search. Builds on react#2077 and react#2084, which fixed inaccuracies and documented missing options. - **Concepts as a glossary:** `Concepts.md` defines the bundling stages and shared terms (module, entry point, dependency graph, platform, project root and watch folders, file watching, Haste) once, and each stage says how to customize it. Other pages link to these definitions instead of re-explaining them. - **Standalone pages and sections:** each page opens with what it covers and when you'd need it; each config section says what it controls. - **React Native context:** examples use `mergeConfig(getDefaultConfig(__dirname), ...)` from `react-native/metro-config`, and options note where React Native's defaults differ from Metro's. - **Less duplication:** `API.md` is the single reference for the JavaScript API. `GettingStarted.md` is a guided introduction with short examples (the CLI, `createConnectMiddleware`, `metro.config.js`) that links to it. - **Bundling page:** "Bundle Formats" becomes "Bundling": how Metro builds a bundle (stages, module IDs, serialization order), modules and scripts (with a polyfill example), then the formats. The RAM bundle section explains when RAM bundles help and why React Native doesn't use them with Hermes, with an example and a compact description of both formats. - **Concrete examples** where a statement isn't obvious, e.g. the URLs Metro's middleware serves, what a wrapped module looks like in a bundle, how a specifier resolves to a file, `mergeConfig` results, and the files `runBuild` writes. - **Recent behavior:** `inlineRequires` inlining destructured requires, `fileMapCacheDirectory` being created if missing, and what `getPackageForModule` returns for symlinked and missing paths. - **New "File watching" section** in `Concepts.md`, linked from every mention of watching. - **Tightened prose** throughout, consistent "Type:" / "Defaults to" phrasing, and removed trailing whitespace. Page URLs are unchanged, and headings keep their text where possible, so existing links keep working. The exceptions: `Bundling.md`'s sections are reorganized (the format headings keep their text), and `Concepts.md`'s "Modules" heading is now "Module", under "Terminology". Changelog: [Internal] Differential Revision: D125674124
Contributor
|
@vzaidman has exported this pull request. If you are a Meta employee, you can view the originating Diff in D125674124. |
robhogan
reviewed
Oct 28, 2026
robhogan
reviewed
Oct 28, 2026
robhogan
reviewed
Oct 28, 2026
Collaborator
I'm not sure about this as a goal - those are really community CLI specifics, at a time when we're actively recommending a framework. I'd be inclined to pick either vanilla Metro or represent Expo alongside RN CLI. |
huntie
approved these changes
Oct 28, 2026
huntie
left a comment
Collaborator
There was a problem hiding this comment.
One blocking comment first!
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.
Summary:
Rewrites the docs for React Native developers who know Metro from the product side (
metro.config.js,npx react-native start, Fast Refresh) but not its internals, and who often land on a single section from search. Builds on #2077 and #2084, which fixed inaccuracies and documented missing options.Concepts.mddefines the bundling stages and shared terms (module, entry point, dependency graph, platform, project root and watch folders, file watching, Haste) once, and each stage says how to customize it. Other pages link to these definitions instead of re-explaining them.npx metro serve,npx metro build, plain config exports), and note where a framework wrapper (e.g. React Native's or Expo'sgetDefaultConfig) changes a default instead of assuming it. The JavaScript API is framed as a framework/tooling integration point, not the usual way to run Metro.API.mdis the single reference for the JavaScript API.GettingStarted.mdis a guided introduction with short examples (the CLI,createConnectMiddleware,metro.config.js) that links to it.mergeConfigresults, and the filesrunBuildwrites.inlineRequiresinlining destructured requires,fileMapCacheDirectorybeing created if missing, and whatgetPackageForModulereturns for symlinked and missing paths.Concepts.md, linked from every mention of watching.Page URLs are unchanged, and headings keep their text where possible, so existing links keep working. The exceptions:
Bundling.md's sections are reorganized (the format headings keep their text), andConcepts.md's "Modules" heading is now "Module", under "Terminology".Changelog: [Internal]
Differential Revision: D125674124