Repository navigation
Commit c5a2780
Docs: Fix inaccurate and outdated documentation (#2077)
Summary:
Pull Request resolved: #2077
Audits every page under `docs/` against the current source and fixes statements that are wrong or out of date, and documents current options and APIs that were missing. This change only corrects content; readability changes follow separately.
**Configuration**
- Config file lookup order: `.json` is tried before TypeScript files.
- `maxWorkers`: configured values are not capped at the core count; the default is 50-75% of cores, not "about half".
- `unstable_perfLoggerFactory`: event type is `'START_UP'` (not `'STARTUP'`), `opts` is optional and `key` is a number.
- `hasteImplModulePath` modules must also export `getCacheKey()`.
- `dynamicDepsInPackages` only applies to files in `node_modules`; dynamic requires elsewhere are always rejected.
- Fixed defaults/types of `getPolyfills` (`[]`), `processModuleFilter` (one module), `getRunModuleStatement`, `schemeResolvers` (not nullable), `enhanceMiddleware`, `getTransformOptions` (`hot: true`).
- Fixed descriptions of `assetRegistryPath`, `enableBabelRuntime` (plugin name), `rewriteRequestUrl` (order relative to middleware), `useGlobalHotkey` (has no effect), `blockList` (default hides `__tests__`), `mergeConfig` (one level deep; first argument can't be a promise), `tls`/`secureServerOptions` precedence.
- Documented missing options: the `symbolicator` section, `resolver.dependencyExtractor`, `transformer.globalPrefix`/`allowOptionalDependencies`/`publicPath`, `serializer.polyfillModuleNames`/`customSerializer`/`experimentalSerializerHook` and extra `getTransformOptions` fields. `unstable_*` options not documented before follow in the next change.
**API, CLI, Getting Started**
- `runServer` and `createConnectMiddleware` have no `port` option; `runBuild`'s `out` is optional; corrected how source maps are written and inlined.
- `runServer` calls `runMetro`, not the other way around; fixed an example using an undefined `httpServer`.
- `dev` sets `__DEV__`; production builds inline `process.env.NODE_ENV` as `'production'`.
- Documented missing options of `loadConfig`, `runMetro`, `runBuild` (including `output`), `runServer`, `createConnectMiddleware`, and the `buildGraph` and `attachMetroCli` exports.
- CLI: documented `serve` options and the `start` alias, deprecated and ignored flags, `get-dependencies [entryFile]` and corrected defaults; every `--max-workers` overrides `maxWorkers`.
- Documented all bundle URL query parameters and the transformer `transform`/`getCacheKey(options)` interface.
**Resolution and Package Exports**
- `#` subpath imports are supported (the docs said they throw).
- Corrected the Haste, directory, `"browser"` field and file variant resolution steps, the `unstable_conditionsByPlatform` field name, asset variant naming (`2x`), `getPackage`/`getPackageForModule`/`asyncType` types, resolver caching conditions, and documented missing context fields.
- Fixed the invalid custom resolver example and outdated warning text in Package Exports, and converted absolute links to relative ones.
**Other pages**
- Bundling: corrected the indexed RAM bundle header, offsets, lookup formulas and `UNBUNDLE` location; explained startup code and other unexplained terms.
- Caching: `HttpCache` doesn't exist; documented `HttpStore` options, `HttpGetStore` error handling and `AutoCleanFileStore(options)`.
- Module API, Source Map Format and Local Development: corrected `dynamicDepsInPackages` scope, the mappings grammar and the project scaffolding command.
Also adds a doc comment to `getMaxWorkers`.
Changelog: [Internal]
Differential Revision: D1256741231 parent 2641b08 commit c5a2780
12 files changed
Lines changed: 338 additions & 156 deletions
File tree
- docs
- packages/metro-config/src/defaults
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
| 47 | + | |
48 | 48 | | |
49 | | - | |
| 49 | + | |
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
| 53 | + | |
54 | 54 | | |
55 | | - | |
| 55 | + | |
56 | 56 | | |
57 | | - | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
58 | 62 | | |
59 | 63 | | |
60 | 64 | | |
61 | | - | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
62 | 68 | | |
63 | | - | |
| 69 | + | |
64 | 70 | | |
65 | | - | |
| 71 | + | |
66 | 72 | | |
67 | 73 | | |
68 | 74 | | |
69 | | - | |
| 75 | + | |
70 | 76 | | |
71 | | - | |
| 77 | + | |
72 | 78 | | |
73 | 79 | | |
74 | 80 | | |
| |||
80 | 86 | | |
81 | 87 | | |
82 | 88 | | |
83 | | - | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
84 | 104 | | |
85 | | - | |
| 105 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
| 15 | + | |
14 | 16 | | |
15 | 17 | | |
16 | 18 | | |
17 | 19 | | |
18 | | - | |
19 | | - | |
20 | | - | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
21 | 23 | | |
22 | 24 | | |
23 | 25 | | |
24 | 26 | | |
25 | 27 | | |
26 | | - | |
| 28 | + | |
27 | 29 | | |
28 | 30 | | |
29 | 31 | | |
| |||
35 | 37 | | |
36 | 38 | | |
37 | 39 | | |
38 | | - | |
| 40 | + | |
39 | 41 | | |
40 | | - | |
| 42 | + | |
41 | 43 | | |
42 | 44 | | |
43 | 45 | | |
| |||
49 | 51 | | |
50 | 52 | | |
51 | 53 | | |
52 | | - | |
53 | | - | |
| 54 | + | |
| 55 | + | |
54 | 56 | | |
55 | 57 | | |
56 | 58 | | |
57 | 59 | | |
58 | 60 | | |
59 | | - | |
| 61 | + | |
60 | 62 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | | - | |
| 17 | + | |
| 18 | + | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | | - | |
23 | | - | |
| 22 | + | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
29 | 31 | | |
30 | 32 | | |
31 | 33 | | |
32 | 34 | | |
33 | | - | |
| 35 | + | |
34 | 36 | | |
35 | | - | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
36 | 56 | | |
37 | 57 | | |
38 | 58 | | |
| |||
44 | 64 | | |
45 | 65 | | |
46 | 66 | | |
47 | | - | |
48 | | - | |
49 | | - | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
0 commit comments