Skip to content

Commit 654fed4

Browse files
cpojerfacebook-github-bot
authored andcommitted
Rename metro-bundler to metro
Reviewed By: davidaurelio Differential Revision: D6413420 fbshipit-source-id: f13184b8157de2c3aeaa7f2647becc175f62cdbb
1 parent 92c0980 commit 654fed4

18 files changed

+45
-45
lines changed

Libraries/Image/RelativeImageStub.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
'use strict';
1313

1414
// This is a stub for flow to make it understand require('./icon.png')
15-
// See metro-bundler/src/Bundler/index.js
15+
// See metro/src/Bundler/index.js
1616

1717
var AssetRegistry = require('AssetRegistry');
1818

blog/2017-06-21-react-native-monthly-1.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ As teams' plans might be of interest to a broader audience, we'll be sharing the
4444

4545
- Looking into improving the release process by using [Detox](https://github.com/wix/detox) for E2E testing. Pull request should land soon.
4646
- Blob pull request they have been working on has been merged, subsequent pull requests coming up.
47-
- Increasing [Haul](https://github.com/callstack-io/haul) adoption across internal projects to see how it performs compared to [Metro Bundler](http://github.com/facebook/metro-bundler). Working on better multi-threaded performance with the Webpack team.
47+
- Increasing [Haul](https://github.com/callstack-io/haul) adoption across internal projects to see how it performs compared to [Metro](http://github.com/facebook/metro). Working on better multi-threaded performance with the Webpack team.
4848
- Internally, they have implemented a better infrastructure to manage open source projects. Plans to be getting more stuff out in upcoming weeks.
4949
- The React Native Europe conference is coming along, nothing interesting yet, but y'all invited!
5050
- Stepped back from [react-navigation](https://github.com/react-community/react-navigation) for a while to investigate alternatives (especially native navigations).
@@ -58,7 +58,7 @@ As teams' plans might be of interest to a broader audience, we'll be sharing the
5858

5959
### Facebook
6060

61-
- React Native's packager is now [Metro Bundler](https://github.com/facebook/metro-bundler), in an independent repo. The Metro Bundler team in London is excited to address the needs of the community, improve modularity for additional use-cases beyond React Native, and increase responsiveness on issues and PRs.
61+
- React Native's packager is now [Metro](https://github.com/facebook/metro), in an independent repo. The Metro Bundler team in London is excited to address the needs of the community, improve modularity for additional use-cases beyond React Native, and increase responsiveness on issues and PRs.
6262
- In the coming months, the React Native team will work on refining the APIs of primitive components. Expect improvements in layout quirks, accessibility, and flow typing.
6363
- The React Native team also plans on improving core modularity this year, by refactoring to fully support 3rd party platforms such as Windows and macOS.
6464

@@ -84,7 +84,7 @@ As teams' plans might be of interest to a broader audience, we'll be sharing the
8484
### Wix
8585

8686
- Working internally to adopt [Detox](https://github.com/wix/detox) to move significant parts of the Wix app to "zero manual QA". As a result, Detox is being used heavily in a production setting by dozens of developers and maturing rapidly.
87-
- Working to add support to the [Metro Bundler](https://github.com/facebook/metro-bundler) for overriding any file extension during the build. Instead of just "ios" and "android", it would support any custom extension like "e2e" or "detox". Plans to use this for E2E mocking. There's already a library out called [react-native-repackager](https://github.com/wix/react-native-repackager), now working on a PR.
87+
- Working to add support to the [Metro](https://github.com/facebook/metro) for overriding any file extension during the build. Instead of just "ios" and "android", it would support any custom extension like "e2e" or "detox". Plans to use this for E2E mocking. There's already a library out called [react-native-repackager](https://github.com/wix/react-native-repackager), now working on a PR.
8888
- Investigating automation of performance tests. This is a new repo called [DetoxInstruments](https://github.com/wix/DetoxInstruments). You can take a look, it's being developed open source.
8989
- Working with a contributor from KPN on Detox for Android and supporting real devices.
9090
- Thinking about "Detox as a platform" to allow building other tools that need to automate the simulator/device. An example is [Storybook](https://github.com/storybooks/react-native-storybook) for React Native or Ram's idea for integration testing.

blog/2017-07-28-react-native-monthly-2.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Here are the notes from each team:
3636

3737
- [Mike Grabowski](https://github.com/grabbou) has been managing React Native's monthly releases as always, including a few betas that were pushed out. In particular, working on getting a v0.43.5 build published to npm since it unblocks Windows users!
3838
- Slow but consistent work is happening on [Haul](https://github.com/callstack-io/haul). There is a pull request that adds HMR, and other improvements have shipped. Recently got a few industry leaders to adopt it. Possibly planning to start a full-time paid work in that area.
39-
- [Michał Pierzchała](https://twitter.com/thymikee) from the [Jest](https://github.com/facebook/jest) team has joined us at Callstack this month. He will help maintain [Haul](https://github.com/callstack-io/haul) and possibly work on [Metro Bundler](https://github.com/facebook/metro-bundler) and [Jest](https://github.com/facebook/jest).
39+
- [Michał Pierzchała](https://twitter.com/thymikee) from the [Jest](https://github.com/facebook/jest) team has joined us at Callstack this month. He will help maintain [Haul](https://github.com/callstack-io/haul) and possibly work on [Metro Bundler](https://github.com/facebook/metro) and [Jest](https://github.com/facebook/jest).
4040
- [Satyajit Sahoo](https://twitter.com/satya164) is now with us, yay!
4141
- Got a bunch of cool stuff coming up from our OSS department. In particular, working on bringing Material Palette API to React Native. Planning to finally release our native iOS kit which is aimed to provide 1:1 look & feel of native components.
4242

@@ -79,7 +79,7 @@ Here are the notes from each team:
7979
- Some people have reported an issue with duplicate apps - they already had an app on Mobile Center. We are working on resolving them, but if you have two apps, let us know, and we can merge them for you.
8080
- Mobile Center now supports Push Notifications for CodePush. We also showed how a combination of Notifications and CodePush could be used for A/B testing apps - something unique to the ReactNative architecture.
8181
- [VSCode](https://github.com/Microsoft/vscode) has a known debugging issue with ReactNative - the next release of the extension in a couple of days will be fixing the issue.
82-
- Since there are many other teams also working on React Native inside Microsoft, we will work on getting better representation from all the groups for the next meeting.
82+
- Since there are many other teams also working on React Native inside Microsoft, we will work on getting better representation from all the groups for the next meeting.
8383

8484
### Shoutem
8585

@@ -90,7 +90,7 @@ Here are the notes from each team:
9090

9191
### Wix
9292

93-
- We started working on a pull request to [Metro Bundler](https://github.com/facebook/metro-bundler) with [react-native-repackager](https://github.com/wix/react-native-repackager) capabilities. We updated react-native-repackager to support RN 44 (which we use in production). We are using it for our mocking infrastructure for [detox](https://github.com/wix/detox).
93+
- We started working on a pull request to [Metro Bundler](https://github.com/facebook/metro) with [react-native-repackager](https://github.com/wix/react-native-repackager) capabilities. We updated react-native-repackager to support RN 44 (which we use in production). We are using it for our mocking infrastructure for [detox](https://github.com/wix/detox).
9494
- We have been covering the Wix app in detox tests for the last three weeks. It's an amazing learning experience of how to reduce manual QA in an app of this scale (over 40 engineers). We have resolved several issues with detox as a result, a new version was just published. I am happy to report that we are living up to the "zero flakiness policy" and the tests are passing consistently so far.
9595
- Detox for Android is moving forward nicely. We are getting significant help from the community. We are expecting an initial version in about two weeks.
9696
- [DetoxInstruments](https://github.com/wix/detoxinstruments), our performance testing tool, is getting a little bigger than we originally intended. We are now planning to turn it into a standalone tool that will not be tightly coupled to detox. It will allow investigating the performance of iOS apps in general. It will also be integrated with detox so we can run automated tests on performance metrics.

docs/Images.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ Note that image sources required this way include size (width, height) info for
6767

6868
## Static Non-Image Resources
6969

70-
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 [packager defaults](https://github.com/facebook/metro-bundler/blob/master/packages/metro-bundler/src/defaults.js#L13-L18) for the full list.
70+
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 [packager defaults](https://github.com/facebook/metro/blob/master/packages/metro/src/defaults.js#L13-L18) for the full list.
7171

7272
You can add support for other types by creating a packager config file (see the [packager config file](https://github.com/facebook/react-native/blob/master/local-cli/util/Config.js#L34-L39) for the full list of configuration options).
7373

jest/preprocessor.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const babel = require('babel-core');
2020
/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error
2121
* found when Flow v0.54 was deployed. To see the error delete this comment and
2222
* run Flow. */
23-
const babelRegisterOnly = require('metro-bundler/src/babelRegisterOnly');
23+
const babelRegisterOnly = require('metro/src/babelRegisterOnly');
2424
/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error
2525
* found when Flow v0.54 was deployed. To see the error delete this comment and
2626
* run Flow. */
@@ -29,7 +29,7 @@ const generate = require('babel-generator').default;
2929

3030
const nodeFiles = RegExp([
3131
'/local-cli/',
32-
'/metro-bundler/',
32+
'/metro(-bundler)?/',
3333
].join('|'));
3434
const nodeOptions = babelRegisterOnly.config([nodeFiles]);
3535

@@ -38,7 +38,7 @@ babelRegisterOnly([]);
3838
/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error
3939
* found when Flow v0.54 was deployed. To see the error delete this comment and
4040
* run Flow. */
41-
const transformer = require('metro-bundler/src/transformer.js');
41+
const transformer = require('metro/src/transformer.js');
4242
module.exports = {
4343
process(src/*: string*/, file/*: string*/) {
4444
if (nodeFiles.test(file)) { // node specific transforms only
@@ -75,7 +75,7 @@ module.exports = {
7575

7676
getCacheKey: createCacheKeyFunction([
7777
__filename,
78-
require.resolve('metro-bundler/src/transformer.js'),
78+
require.resolve('metro/src/transformer.js'),
7979
require.resolve('babel-core/package.json'),
8080
]),
8181
};

local-cli/bundle/buildBundle.js

+10-10
Original file line numberDiff line numberDiff line change
@@ -15,38 +15,38 @@ const log = require('../util/log').out('bundle');
1515
/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error
1616
* found when Flow v0.54 was deployed. To see the error delete this comment and
1717
* run Flow. */
18-
const Server = require('metro-bundler/src/Server');
18+
const Server = require('metro/src/Server');
1919
/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error
2020
* found when Flow v0.54 was deployed. To see the error delete this comment and
2121
* run Flow. */
22-
const Terminal = require('metro-bundler/src/lib/Terminal');
22+
const Terminal = require('metro/src/lib/Terminal');
2323
/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error
2424
* found when Flow v0.54 was deployed. To see the error delete this comment and
2525
* run Flow. */
26-
const TerminalReporter = require('metro-bundler/src/lib/TerminalReporter');
26+
const TerminalReporter = require('metro/src/lib/TerminalReporter');
2727
/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error
2828
* found when Flow v0.54 was deployed. To see the error delete this comment and
2929
* run Flow. */
30-
const TransformCaching = require('metro-bundler/src/lib/TransformCaching');
30+
const TransformCaching = require('metro/src/lib/TransformCaching');
3131

3232
/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error
3333
* found when Flow v0.54 was deployed. To see the error delete this comment and
3434
* run Flow. */
35-
const outputBundle = require('metro-bundler/src/shared/output/bundle');
35+
const outputBundle = require('metro/src/shared/output/bundle');
3636
const path = require('path');
3737
const saveAssets = require('./saveAssets');
38-
const defaultAssetExts = require('metro-bundler/src/defaults').assetExts;
39-
const defaultSourceExts = require('metro-bundler/src/defaults').sourceExts;
40-
const defaultPlatforms = require('metro-bundler/src/defaults').platforms;
38+
const defaultAssetExts = require('metro/src/defaults').assetExts;
39+
const defaultSourceExts = require('metro/src/defaults').sourceExts;
40+
const defaultPlatforms = require('metro/src/defaults').platforms;
4141
/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error
4242
* found when Flow v0.54 was deployed. To see the error delete this comment and
4343
* run Flow. */
44-
const defaultProvidesModuleNodeModules = require('metro-bundler/src/defaults').providesModuleNodeModules;
44+
const defaultProvidesModuleNodeModules = require('metro/src/defaults').providesModuleNodeModules;
4545

4646
const {ASSET_REGISTRY_PATH} = require('../core/Constants');
4747

4848
import type {RequestOptions, OutputOptions} from './types.flow';
49-
import type {ConfigT} from 'metro-bundler';
49+
import type {ConfigT} from 'metro';
5050

5151
async function buildBundle(
5252
args: OutputOptions & {

local-cli/bundle/bundle.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
const buildBundle = require('./buildBundle');
1212
const bundleCommandLineArgs = require('./bundleCommandLineArgs');
13-
const outputBundle = require('metro-bundler/src/shared/output/bundle');
13+
const outputBundle = require('metro/src/shared/output/bundle');
1414

1515
/**
1616
* Builds the bundle starting to look for dependencies at the given entry path.

local-cli/bundle/types.flow.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error
1414
* found when Flow v0.54 was deployed. To see the error delete this comment and
1515
* run Flow. */
16-
export type {OutputOptions, RequestOptions} from 'metro-bundler/src/shared/types.flow';
16+
export type {OutputOptions, RequestOptions} from 'metro/src/shared/types.flow';

local-cli/bundle/unbundle.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
const bundleWithOutput = require('./bundle').withOutput;
1212
const bundleCommandLineArgs = require('./bundleCommandLineArgs');
13-
const outputUnbundle = require('metro-bundler/src/shared/output/unbundle');
13+
const outputUnbundle = require('metro/src/shared/output/unbundle');
1414

1515
/**
1616
* Builds the bundle starting to look for dependencies at the given entry path.

local-cli/core/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const minimist = require('minimist');
2929
const path = require('path');
3030

3131
import type {CommandT} from '../commands';
32-
import type {ConfigT} from 'metro-bundler';
32+
import type {ConfigT} from 'metro';
3333

3434
export type RNConfig = {
3535
...ConfigT,

local-cli/dependencies/dependencies.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*/
99
'use strict';
1010

11-
const ReactPackager = require('metro-bundler');
11+
const ReactPackager = require('metro');
1212

1313
const denodeify = require('denodeify');
1414
const fs = require('fs');

local-cli/server/checkNodeVersion.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
'use strict';
1010

1111
var chalk = require('chalk');
12-
var formatBanner = require('metro-bundler/src/lib/formatBanner');
12+
var formatBanner = require('metro/src/lib/formatBanner');
1313
var semver = require('semver');
1414

1515
module.exports = function() {

local-cli/server/runServer.js

+11-11
Original file line numberDiff line numberDiff line change
@@ -16,28 +16,28 @@ require('../../setupBabel')();
1616
/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error
1717
* found when Flow v0.54 was deployed. To see the error delete this comment and
1818
* run Flow. */
19-
const ReactPackager = require('metro-bundler');
19+
const ReactPackager = require('metro');
2020

21-
const HmrServer = require('metro-bundler/src/HmrServer');
21+
const HmrServer = require('metro/src/HmrServer');
2222

2323
/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error
2424
* found when Flow v0.54 was deployed. To see the error delete this comment and
2525
* run Flow. */
26-
const Terminal = require('metro-bundler/src/lib/Terminal');
26+
const Terminal = require('metro/src/lib/Terminal');
2727

2828
const attachWebsocketServer = require('./util/attachWebsocketServer');
2929
/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error
3030
* found when Flow v0.54 was deployed. To see the error delete this comment and
3131
* run Flow. */
3232
const connect = require('connect');
3333
const copyToClipBoardMiddleware = require('./middleware/copyToClipBoardMiddleware');
34-
const defaultAssetExts = require('metro-bundler/src/defaults').assetExts;
35-
const defaultSourceExts = require('metro-bundler/src/defaults').sourceExts;
36-
const defaultPlatforms = require('metro-bundler/src/defaults').platforms;
34+
const defaultAssetExts = require('metro/src/defaults').assetExts;
35+
const defaultSourceExts = require('metro/src/defaults').sourceExts;
36+
const defaultPlatforms = require('metro/src/defaults').platforms;
3737
/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error
3838
* found when Flow v0.54 was deployed. To see the error delete this comment and
3939
* run Flow. */
40-
const defaultProvidesModuleNodeModules = require('metro-bundler/src/defaults')
40+
const defaultProvidesModuleNodeModules = require('metro/src/defaults')
4141
.providesModuleNodeModules;
4242
const fs = require('fs');
4343
const getDevToolsMiddleware = require('./middleware/getDevToolsMiddleware');
@@ -55,15 +55,15 @@ const webSocketProxy = require('./util/webSocketProxy.js');
5555
/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error
5656
* found when Flow v0.54 was deployed. To see the error delete this comment and
5757
* run Flow. */
58-
const TransformCaching = require('metro-bundler/src/lib/TransformCaching');
58+
const TransformCaching = require('metro/src/lib/TransformCaching');
5959

6060
const {ASSET_REGISTRY_PATH} = require('../core/Constants');
6161

62-
import type {ConfigT} from 'metro-bundler';
62+
import type {ConfigT} from 'metro';
6363
/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error
6464
* found when Flow v0.54 was deployed. To see the error delete this comment and
6565
* run Flow. */
66-
import type {Reporter} from 'metro-bundler/src/lib/reporting';
66+
import type {Reporter} from 'metro/src/lib/reporting';
6767

6868
export type Args = {|
6969
+assetExts: $ReadOnlyArray<string>,
@@ -152,7 +152,7 @@ function runServer(
152152

153153
function getReporterImpl(customLogReporterPath: ?string) {
154154
if (customLogReporterPath == null) {
155-
return require('metro-bundler/src/lib/TerminalReporter');
155+
return require('metro/src/lib/TerminalReporter');
156156
}
157157
try {
158158
// First we let require resolve it, so we can require packages in node_modules

local-cli/server/server.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const path = require('path');
1515
const runServer = require('./runServer');
1616

1717
import type {RNConfig} from '../core';
18-
import type {ConfigT} from 'metro-bundler';
18+
import type {ConfigT} from 'metro';
1919
import type {Args as RunServerArgs} from './runServer';
2020

2121
/**

local-cli/server/util/debugger-ui/DeltaPatcher.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
/**
1313
* This file is a copy of the reference `DeltaPatcher`, located in
14-
* metro-bundler. The reason to not reuse that file is that in this context
14+
* metro. The reason to not reuse that file is that in this context
1515
* we cannot have flow annotations or CJS syntax (since this file is directly)
1616
* injected into a static HTML page.
1717
*

local-cli/util/Config.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ const getPolyfills = require('../../rn-get-polyfills');
1717
const invariant = require('fbjs/lib/invariant');
1818
const path = require('path');
1919

20-
const {Config: MetroConfig} = require('metro-bundler');
20+
const {Config: MetroConfig} = require('metro');
2121

2222
const RN_CLI_CONFIG = 'rn-cli.config.js';
2323

24-
import type {ConfigT as MetroConfigT} from 'metro-bundler';
24+
import type {ConfigT as MetroConfigT} from 'metro';
2525

2626
/**
2727
* Configuration file of the CLI.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@
172172
"graceful-fs": "^4.1.3",
173173
"inquirer": "^3.0.6",
174174
"lodash": "^4.16.6",
175-
"metro-bundler": "^0.22.1",
175+
"metro": "^0.22.1",
176176
"mime": "^1.3.4",
177177
"minimist": "^1.2.0",
178178
"mkdirp": "^0.5.1",

0 commit comments

Comments
 (0)