Skip to content

Commit c65a670

Browse files
committed
Fix formatting in proposals/0534-metro-package-exports-support.md
Resolves #534 (comment)
1 parent 6a0dd6f commit c65a670

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

proposals/0534-metro-package-exports-support.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ This is the primary breaking change introduced by `"exports"`.
9898
> When the `"exports"` field is defined, all subpaths of the package are encapsulated and no longer available to importers.\
9999
https://nodejs.org/docs/latest-v18.x/api/packages.html#main-entry-point-export
100100

101-
```json
101+
```js
102102
"exports": {
103103
// Paths outside of this list are inaccessible to importers
104104
".": "./lib/index.js",
@@ -116,7 +116,7 @@ This is the primary breaking change introduced by `"exports"`.
116116
This relates to the ability for packages to define subpath aliases that point to an underlying file.\
117117
https://nodejs.org/docs/latest-v18.x/api/packages.html#subpath-exports
118118

119-
```
119+
```json
120120
"exports": {
121121
".": "./index.js",
122122
"./submodule.js": "./src/submodule.js"
@@ -297,7 +297,7 @@ This default is directly misaligned with react-native-web via Webpack ([docs](h
297297
Combined, this is the only breaking change we foresee in Metro that will immediately impact app developers, and which we are not deferring via strict mode opt-in. It will align behaviour for existing users of react-native-web via Webpack.
298298

299299
| Condition name | Description | Node.js | Webpack | Metro (proposed) |
300-
| - | - | - | - | - | - |
300+
| - | - | - | - | - |
301301
| `"browser"` | Any web browser environment | - | Matched when `platform === 'web'` | Matched when `platform === 'web'` |
302302
| `"react-native"` [New] | Any React Native runtime environment (non-browser) | - | Matched when `platform !== 'web'` | Matched when `platform !== 'web'` |
303303
| All other | | (unimplemented) | Various supported, e.g. `"deno"`, `"worker"`, `"electron"` | (unimplemented) |
@@ -341,7 +341,7 @@ Therefore, Metro will default to lenient and backwards compatible behaviour, as
341341

342342
The new flag will be exposed as a `reactNative.metroExportsMode` field within `package.json`.
343343

344-
```json
344+
```js
345345
{
346346
"name": "my-package",
347347
"exports": {...},
@@ -354,7 +354,7 @@ The new flag will be exposed as a `reactNative.metroExportsMode` field within `p
354354

355355
Note: `"reactNative"` (in camel case) will be a distinct field from `"react-native"` (in dash case, used as a `"main"` module alias that we are starting to deprecate with `"exports"`). We are [separately considering a `‌"newArchSupport"` option](https://github.com/microsoft/rnx-kit/issues/1863#issuecomment-1246580474) within this new top-level key, which will encapsulate options available to React Native packages.
356356

357-
### Behaviour under `"nonstrict"` mode (default)
357+
#### Behaviour under `"nonstrict"` mode (default)
358358

359359
- Any subpaths are importable (package encapsulation is not enforced).
360360
- When ambiguous, subpaths outside `"exports"` are preferred.

0 commit comments

Comments
 (0)