Skip to content

Commit

Permalink
Update all Metro links to metrobundler.dev (#3928)
Browse files Browse the repository at this point in the history
  • Loading branch information
huntie authored Nov 24, 2023
1 parent 4975f99 commit b8cd3b0
Show file tree
Hide file tree
Showing 51 changed files with 62 additions and 62 deletions.
2 changes: 1 addition & 1 deletion docs/_getting-started-linux-android.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ Click "Next" then "Finish" to create your AVD. At this point you should be able

<h3>Step 1: Start Metro</h3>

[**Metro**](https://facebook.github.io/metro/) is the JavaScript build tool for React Native. To start the Metro development server, run the following from your project folder:
[**Metro**](https://metrobundler.dev/) is the JavaScript build tool for React Native. To start the Metro development server, run the following from your project folder:

<Tabs groupId="package-manager" queryString defaultValue={constants.defaultPackageManager} values={constants.packageManagers}>
<TabItem value="npm">
Expand Down
2 changes: 1 addition & 1 deletion docs/_getting-started-macos-android.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ Click "Next" then "Finish" to create your AVD. At this point you should be able

<h3>Step 1: Start Metro</h3>

[**Metro**](https://facebook.github.io/metro/) is the JavaScript build tool for React Native. To start the Metro development server, run the following from your project folder:
[**Metro**](https://metrobundler.dev/) is the JavaScript build tool for React Native. To start the Metro development server, run the following from your project folder:

<Tabs groupId="package-manager" queryString defaultValue={constants.defaultPackageManager} values={constants.packageManagers}>
<TabItem value="npm">
Expand Down
2 changes: 1 addition & 1 deletion docs/_getting-started-macos-ios.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ You might also want to ensure that all "shell script build phase" of your Xcode

### Step 1: Start Metro

[**Metro**](https://facebook.github.io/metro/) is the JavaScript build tool for React Native. To start the Metro development server, run the following from your project folder:
[**Metro**](https://metrobundler.dev/) is the JavaScript build tool for React Native. To start the Metro development server, run the following from your project folder:

<Tabs groupId="package-manager" queryString defaultValue={constants.defaultPackageManager} values={constants.packageManagers}>
<TabItem value="npm">
Expand Down
2 changes: 1 addition & 1 deletion docs/_getting-started-windows-android.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ Click "Next" then "Finish" to create your AVD. At this point you should be able

<h3>Step 1: Start Metro</h3>

[**Metro**](https://facebook.github.io/metro/) is the JavaScript build tool for React Native. To start the Metro development server, run the following from your project folder:
[**Metro**](https://metrobundler.dev/) is the JavaScript build tool for React Native. To start the Metro development server, run the following from your project folder:

<Tabs groupId="package-manager" queryString defaultValue={constants.defaultPackageManager} values={constants.packageManagers}>
<TabItem value="npm">
Expand Down
2 changes: 1 addition & 1 deletion docs/_integration-with-existing-apps-java.md
Original file line number Diff line number Diff line change
Expand Up @@ -440,4 +440,4 @@ Now, create a release build of your native app from within Android Studio as usu

At this point you can continue developing your app as usual. Refer to our [debugging](debugging) and [deployment](running-on-device) docs to learn more about working with React Native.

[metro]: https://facebook.github.io/metro/
[metro]: https://metrobundler.dev/
2 changes: 1 addition & 1 deletion docs/_integration-with-existing-apps-kotlin.md
Original file line number Diff line number Diff line change
Expand Up @@ -416,4 +416,4 @@ Now, create a release build of your native app from within Android Studio as usu

At this point you can continue developing your app as usual. Refer to our [debugging](debugging) and [deployment](running-on-device) docs to learn more about working with React Native.

[metro]: https://facebook.github.io/metro/
[metro]: https://metrobundler.dev/
2 changes: 1 addition & 1 deletion docs/_integration-with-existing-apps-objc.md
Original file line number Diff line number Diff line change
Expand Up @@ -400,4 +400,4 @@ Here is the _React Native_ high score screen:

At this point you can continue developing your app as usual. Refer to our [debugging](debugging) and [deployment](running-on-device) docs to learn more about working with React Native.

[metro]: https://facebook.github.io/metro/
[metro]: https://metrobundler.dev/
2 changes: 1 addition & 1 deletion docs/_integration-with-existing-apps-swift.md
Original file line number Diff line number Diff line change
Expand Up @@ -378,4 +378,4 @@ Here is the _React Native_ high score screen:

At this point you can continue developing your app as usual. Refer to our [debugging](debugging) and [deployment](running-on-device) docs to learn more about working with React Native.

[metro]: https://facebook.github.io/metro/
[metro]: https://metrobundler.dev/
2 changes: 1 addition & 1 deletion docs/hermes.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ Hermes supports the Chrome debugger by implementing the Chrome inspector protoco
Note that this is very different with the deprecated "Remote JS Debugging" from the In-App Dev Menu documented in the [Debugging](debugging#remote-debugging) section, which actually runs the JS code on Chrome's V8 on your development machine (laptop or desktop) instead of connecting to the JS engine running the app on your device.
:::

Chrome connects to Hermes running on device via Metro, so you'll need to know where Metro is listening. Typically this will be on `localhost:8081`, but this is [configurable](https://facebook.github.io/metro/docs/configuration). When running `yarn start` the address is written to stdout on startup.
Chrome connects to Hermes running on device via Metro, so you'll need to know where Metro is listening. Typically this will be on `localhost:8081`, but this is [configurable](https://metrobundler.dev/docs/configuration). When running `yarn start` the address is written to stdout on startup.

Once you know where the Metro server is listening, you can connect with Chrome using the following steps:

Expand Down
2 changes: 1 addition & 1 deletion docs/images.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Note that image sources required this way include size (width, height) info for

The `require` syntax described above can be used to statically include audio, video or document files in your project as well. Most common file types are supported including `.mp3`, `.wav`, `.mp4`, `.mov`, `.html` and `.pdf`. See [bundler defaults](https://github.com/facebook/metro/blob/master/packages/metro-config/src/defaults/defaults.js#L14-L44) for the full list.

You can add support for other types by adding an [`assetExts` resolver option](https://facebook.github.io/metro/docs/configuration#resolver-options) in your [Metro configuration](https://facebook.github.io/metro/docs/configuration).
You can add support for other types by adding an [`assetExts` resolver option](https://metrobundler.dev/docs/configuration#resolver-options) in your [Metro configuration](https://metrobundler.dev/docs/configuration).

A caveat is that videos must use absolute positioning instead of `flexGrow`, since size info is not currently passed for non-image assets. This limitation doesn't occur for videos that are linked directly into Xcode or the Assets folder for Android.

Expand Down
8 changes: 4 additions & 4 deletions docs/metro.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ id: metro
title: Metro
---

React Native uses [Metro](https://facebook.github.io/metro/) to build your JavaScript code and assets.
React Native uses [Metro](https://metrobundler.dev/) to build your JavaScript code and assets.

## Configuring Metro

Expand All @@ -13,7 +13,7 @@ Configuration options for Metro can be customized in your project's `metro.confi
- [**A function**](#advanced-using-a-config-function) that will be called with Metro's internal config defaults and should return a final config object.

:::tip
Please see [**Configuring Metro**](https://facebook.github.io/metro/docs/configuration) on the Metro website for documentation on all available config options.
Please see [**Configuring Metro**](https://metrobundler.dev/docs/configuration) on the Metro website for documentation on all available config options.
:::

In React Native, your Metro config should extend either [`@react-native/metro-config`](https://www.npmjs.com/package/@react-native/metro-config) or [`@expo/metro-config`](https://www.npmjs.com/package/@expo/metro-config). These packages contain essential defaults necessary to build and run React Native apps.
Expand All @@ -26,7 +26,7 @@ const {getDefaultConfig, mergeConfig} = require('@react-native/metro-config');

/**
* Metro configuration
* https://facebook.github.io/metro/docs/configuration
* https://metrobundler.dev/docs/configuration
*
* @type {import('metro-config').MetroConfig}
*/
Expand Down Expand Up @@ -100,5 +100,5 @@ const config = {

## Learn more about Metro

- [Metro website](https://facebook.github.io/metro/)
- [Metro website](https://metrobundler.dev/)
- [Video: "Metro & React Native DevX" talk at App.js 2023](https://www.youtube.com/watch?v=c9D4pg0y9cI)
2 changes: 1 addition & 1 deletion docs/out-of-tree-platforms.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Right now the process of creating a React Native platform from scratch is not ve

### Bundling

As of React Native 0.57 you can now register your React Native platform with React Native's JavaScript bundler, [Metro](https://facebook.github.io/metro/). This means you can pass `--platform example` to `npx react-native bundle`, and it will look for JavaScript files with the `.example.js` suffix.
As of React Native 0.57 you can now register your React Native platform with React Native's JavaScript bundler, [Metro](https://metrobundler.dev/). This means you can pass `--platform example` to `npx react-native bundle`, and it will look for JavaScript files with the `.example.js` suffix.

To register your platform with RNPM, your module's name must match one of these patterns:

Expand Down
2 changes: 1 addition & 1 deletion docs/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,4 +149,4 @@ echo fs.inotify.max_user_watches=582222 | sudo tee -a /etc/sysctl.conf && sudo s

If you run into issue where executing `npm run android` or `yarn android` on macOS throws the above error, try to run `sudo chmod +x android/gradlew` command to make `gradlew` files into executable.

[metro]: https://facebook.github.io/metro/
[metro]: https://metrobundler.dev/
12 changes: 6 additions & 6 deletions website/blog/2023-06-21-package-exports-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ Enabling Package Exports brings a few [edge-case breaking changes](#breaking-cha

### Enabling Package Exports (beta)

Package Exports can be enabled in your app's [**metro.config.js**](https://github.com/facebook/react-native/blob/0.72-stable/packages/react-native/template/metro.config.js) file via the [`resolver.unstable_enablePackageExports`](https://facebook.github.io/metro/docs/configuration/#unstable_enablepackageexports-experimental) option.
Package Exports can be enabled in your app's [**metro.config.js**](https://github.com/facebook/react-native/blob/0.72-stable/packages/react-native/template/metro.config.js) file via the [`resolver.unstable_enablePackageExports`](https://metrobundler.dev/docs/configuration/#unstable_enablepackageexports-experimental) option.

```js
const config = {
Expand All @@ -97,8 +97,8 @@ const config = {

Metro exposes two further resolver options which configure how conditional exports behave:

- [`unstable_conditionNames`](https://facebook.github.io/metro/docs/configuration/#unstable_conditionnames-experimental) — The set of [condition names](https://nodejs.org/docs/latest-v19.x/api/packages.html#community-conditions-definitions) to assert when resolving conditional exports. By default, we match `['require', 'import', 'react-native']`.
- [`unstable_conditionsByPlatform`](https://facebook.github.io/metro/docs/configuration/#unstable_conditionsbyplatform-experimental) — The additional condition names to assert when resolving for a given platform target. By default, this matches `'browser'` when the platform is `'web'`.
- [`unstable_conditionNames`](https://metrobundler.dev/docs/configuration/#unstable_conditionnames-experimental) — The set of [condition names](https://nodejs.org/docs/latest-v19.x/api/packages.html#community-conditions-definitions) to assert when resolving conditional exports. By default, we match `['require', 'import', 'react-native']`.
- [`unstable_conditionsByPlatform`](https://metrobundler.dev/docs/configuration/#unstable_conditionsbyplatform-experimental) — The additional condition names to assert when resolving for a given platform target. By default, this matches `'browser'` when the platform is `'web'`.

:::tip
**Remember to use the React Native [Jest preset](https://github.com/facebook/react-native/blob/main/template/jest.config.js#L2)!** Jest includes support for Package Exports by default. In tests, you can override which `customExportConditions` are resolved using the [`testEnvironmentOptions`](https://jestjs.io/docs/configuration#testenvironmentoptions-object) option.
Expand Down Expand Up @@ -148,10 +148,10 @@ We decided on an implementation of Package Exports in Metro that is spec-complia

The key breaking change is that when `"exports"` is provided by a package, it will be consulted first (before any other `package.json` fields) — and a matched subpath target will be used directly.

- Metro will not expand [`sourceExts`](https://facebook.github.io/metro/docs/configuration/#sourceexts) against the import specifier.
- Metro will not expand [`sourceExts`](https://metrobundler.dev/docs/configuration/#sourceexts) against the import specifier.
- Metro will not resolve [platform-specific extensions](/docs/platform-specific-code) against the target file.

For more details, please see all [**breaking changes**](https://facebook.github.io/metro/docs/package-exports#summary-of-breaking-changes) in the Metro docs.
For more details, please see all [**breaking changes**](https://metrobundler.dev/docs/package-exports#summary-of-breaking-changes) in the Metro docs.

### Package encapsulation is lenient

Expand Down Expand Up @@ -194,7 +194,7 @@ We believe that the new features of `"exports"` provide a compelling feature set
- **Tighten your package API**: This is a great time to review the module API of your package, which can now be formally defined via exported subpath aliases. This prevents users from accessing internal APIs, reducing surface area for bugs.
- **Conditional exports**: If your package targets React Native for Web (i.e. `"react-native"` and `"browser"`), we now give packages control of the resolution order of these conditions (see next heading).

If you decide to introduce `"exports"`, **we recommend making this as a breaking change**. We've prepared a [**migration guide**](https://facebook.github.io/metro/docs/package-exports#migration-guide-for-package-maintainers) in the Metro docs which includes how to replace features such as platform-specific extensions.
If you decide to introduce `"exports"`, **we recommend making this as a breaking change**. We've prepared a [**migration guide**](https://metrobundler.dev/docs/package-exports#migration-guide-for-package-maintainers) in the Metro docs which includes how to replace features such as platform-specific extensions.

:::note
**Please do not rely on the lenient behaviours of Metro's implementation.** While Metro is backwards-compatible, packages should follow how `"exports"` is documented in the spec and strictly implemented by other tools.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ Click "Next" then "Finish" to create your AVD. At this point you should be able

<h3>Step 1: Start Metro</h3>

First, you will need to start Metro, the JavaScript bundler that ships with React Native. Metro "takes in an entry file and various options, and returns a single JavaScript file that includes all your code and its dependencies."—[Metro Docs](https://facebook.github.io/metro/docs/concepts)
First, you will need to start Metro, the JavaScript bundler that ships with React Native. Metro "takes in an entry file and various options, and returns a single JavaScript file that includes all your code and its dependencies."—[Metro Docs](https://metrobundler.dev/docs/concepts)

To start Metro, run `npx react-native start` inside your React Native project folder:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ Click "Next" then "Finish" to create your AVD. At this point you should be able

<h3>Step 1: Start Metro</h3>

First, you will need to start Metro, the JavaScript bundler that ships with React Native. Metro "takes in an entry file and various options, and returns a single JavaScript file that includes all your code and its dependencies."—[Metro Docs](https://facebook.github.io/metro/docs/concepts)
First, you will need to start Metro, the JavaScript bundler that ships with React Native. Metro "takes in an entry file and various options, and returns a single JavaScript file that includes all your code and its dependencies."—[Metro Docs](https://metrobundler.dev/docs/concepts)

To start Metro, run `npx react-native start` inside your React Native project folder:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ On top of this, it's possible to add any other environment variable and to sourc

### Step 1: Start Metro

First, you will need to start Metro, the JavaScript bundler that ships with React Native. Metro "takes in an entry file and various options, and returns a single JavaScript file that includes all your code and its dependencies."—[Metro Docs](https://facebook.github.io/metro/docs/concepts)
First, you will need to start Metro, the JavaScript bundler that ships with React Native. Metro "takes in an entry file and various options, and returns a single JavaScript file that includes all your code and its dependencies."—[Metro Docs](https://metrobundler.dev/docs/concepts)

To start Metro, run `npx react-native start` inside your React Native project folder:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ Click "Next" then "Finish" to create your AVD. At this point you should be able

<h3>Step 1: Start Metro</h3>

First, you will need to start Metro, the JavaScript bundler that ships with React Native. Metro "takes in an entry file and various options, and returns a single JavaScript file that includes all your code and its dependencies."—[Metro Docs](https://facebook.github.io/metro/docs/concepts)
First, you will need to start Metro, the JavaScript bundler that ships with React Native. Metro "takes in an entry file and various options, and returns a single JavaScript file that includes all your code and its dependencies."—[Metro Docs](https://metrobundler.dev/docs/concepts)

To start Metro, run `npx react-native start` inside your React Native project folder:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -380,4 +380,4 @@ Now, create a release build of your native app from within Android Studio as usu

At this point you can continue developing your app as usual. Refer to our [debugging](debugging) and [deployment](running-on-device) docs to learn more about working with React Native.

[metro]: https://facebook.github.io/metro/
[metro]: https://metrobundler.dev/
Original file line number Diff line number Diff line change
Expand Up @@ -373,4 +373,4 @@ Now, create a release build of your native app from within Android Studio as usu

At this point you can continue developing your app as usual. Refer to our [debugging](debugging) and [deployment](running-on-device) docs to learn more about working with React Native.

[metro]: https://facebook.github.io/metro/
[metro]: https://metrobundler.dev/
Original file line number Diff line number Diff line change
Expand Up @@ -388,4 +388,4 @@ Here is the _React Native_ high score screen:

At this point you can continue developing your app as usual. Refer to our [debugging](debugging) and [deployment](running-on-device) docs to learn more about working with React Native.

[metro]: https://facebook.github.io/metro/
[metro]: https://metrobundler.dev/
Original file line number Diff line number Diff line change
Expand Up @@ -336,4 +336,4 @@ Here is the _React Native_ high score screen:

At this point you can continue developing your app as usual. Refer to our [debugging](debugging) and [deployment](running-on-device) docs to learn more about working with React Native.

[metro]: https://facebook.github.io/metro/
[metro]: https://metrobundler.dev/
2 changes: 1 addition & 1 deletion website/versioned_docs/version-0.70/hermes.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Hermes supports the Chrome debugger by implementing the Chrome inspector protoco
Note that this is very different with the "Remote JS Debugging" from the In-App Developer Menu documented in the [Debugging](debugging#debugging-using-a-custom-javascript-debugger) section, which actually runs the JS code on Chrome's V8 on your development machine (laptop or desktop).
:::

Chrome connects to Hermes running on device via Metro, so you'll need to know where Metro is listening. Typically this will be on `localhost:8081`, but this is [configurable](https://facebook.github.io/metro/docs/configuration). When running `yarn start` the address is written to stdout on startup.
Chrome connects to Hermes running on device via Metro, so you'll need to know where Metro is listening. Typically this will be on `localhost:8081`, but this is [configurable](https://metrobundler.dev/docs/configuration). When running `yarn start` the address is written to stdout on startup.

Once you know where the Metro server is listening, you can connect with Chrome using the following steps:

Expand Down
Loading

0 comments on commit b8cd3b0

Please sign in to comment.