Skip to content

Commit

Permalink
Rename metro-bundler to metro
Browse files Browse the repository at this point in the history
Reviewed By: davidaurelio

Differential Revision: D6413420

fbshipit-source-id: f13184b8157de2c3aeaa7f2647becc175f62cdbb
  • Loading branch information
cpojer authored and facebook-github-bot committed Nov 29, 2017
1 parent 92c0980 commit 654fed4
Show file tree
Hide file tree
Showing 18 changed files with 45 additions and 45 deletions.
2 changes: 1 addition & 1 deletion Libraries/Image/RelativeImageStub.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
'use strict';

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

var AssetRegistry = require('AssetRegistry');

Expand Down
6 changes: 3 additions & 3 deletions blog/2017-06-21-react-native-monthly-1.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ As teams' plans might be of interest to a broader audience, we'll be sharing the

- Looking into improving the release process by using [Detox](https://github.com/wix/detox) for E2E testing. Pull request should land soon.
- Blob pull request they have been working on has been merged, subsequent pull requests coming up.
- 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.
- 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.
- Internally, they have implemented a better infrastructure to manage open source projects. Plans to be getting more stuff out in upcoming weeks.
- The React Native Europe conference is coming along, nothing interesting yet, but y'all invited!
- Stepped back from [react-navigation](https://github.com/react-community/react-navigation) for a while to investigate alternatives (especially native navigations).
Expand All @@ -58,7 +58,7 @@ As teams' plans might be of interest to a broader audience, we'll be sharing the

### Facebook

- 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.
- 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.
- 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.
- 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.

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

- 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.
- 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.
- 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.
- 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.
- Working with a contributor from KPN on Detox for Android and supporting real devices.
- 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.
Expand Down
6 changes: 3 additions & 3 deletions blog/2017-07-28-react-native-monthly-2.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Here are the notes from each team:

- [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!
- 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.
- [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).
- [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).
- [Satyajit Sahoo](https://twitter.com/satya164) is now with us, yay!
- 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.

Expand Down Expand Up @@ -79,7 +79,7 @@ Here are the notes from each team:
- 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.
- 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.
- [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.
- 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.
- 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.

### Shoutem

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

### Wix

- 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).
- 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).
- 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.
- 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.
- [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.
Expand Down
2 changes: 1 addition & 1 deletion docs/Images.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Note that image sources required this way include size (width, height) info for

## Static Non-Image Resources

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.
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.

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).

Expand Down
8 changes: 4 additions & 4 deletions jest/preprocessor.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const babel = require('babel-core');
/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error
* found when Flow v0.54 was deployed. To see the error delete this comment and
* run Flow. */
const babelRegisterOnly = require('metro-bundler/src/babelRegisterOnly');
const babelRegisterOnly = require('metro/src/babelRegisterOnly');
/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error
* found when Flow v0.54 was deployed. To see the error delete this comment and
* run Flow. */
Expand All @@ -29,7 +29,7 @@ const generate = require('babel-generator').default;

const nodeFiles = RegExp([
'/local-cli/',
'/metro-bundler/',
'/metro(-bundler)?/',
].join('|'));
const nodeOptions = babelRegisterOnly.config([nodeFiles]);

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

getCacheKey: createCacheKeyFunction([
__filename,
require.resolve('metro-bundler/src/transformer.js'),
require.resolve('metro/src/transformer.js'),
require.resolve('babel-core/package.json'),
]),
};
20 changes: 10 additions & 10 deletions local-cli/bundle/buildBundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,38 +15,38 @@ const log = require('../util/log').out('bundle');
/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error
* found when Flow v0.54 was deployed. To see the error delete this comment and
* run Flow. */
const Server = require('metro-bundler/src/Server');
const Server = require('metro/src/Server');
/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error
* found when Flow v0.54 was deployed. To see the error delete this comment and
* run Flow. */
const Terminal = require('metro-bundler/src/lib/Terminal');
const Terminal = require('metro/src/lib/Terminal');
/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error
* found when Flow v0.54 was deployed. To see the error delete this comment and
* run Flow. */
const TerminalReporter = require('metro-bundler/src/lib/TerminalReporter');
const TerminalReporter = require('metro/src/lib/TerminalReporter');
/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error
* found when Flow v0.54 was deployed. To see the error delete this comment and
* run Flow. */
const TransformCaching = require('metro-bundler/src/lib/TransformCaching');
const TransformCaching = require('metro/src/lib/TransformCaching');

/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error
* found when Flow v0.54 was deployed. To see the error delete this comment and
* run Flow. */
const outputBundle = require('metro-bundler/src/shared/output/bundle');
const outputBundle = require('metro/src/shared/output/bundle');
const path = require('path');
const saveAssets = require('./saveAssets');
const defaultAssetExts = require('metro-bundler/src/defaults').assetExts;
const defaultSourceExts = require('metro-bundler/src/defaults').sourceExts;
const defaultPlatforms = require('metro-bundler/src/defaults').platforms;
const defaultAssetExts = require('metro/src/defaults').assetExts;
const defaultSourceExts = require('metro/src/defaults').sourceExts;
const defaultPlatforms = require('metro/src/defaults').platforms;
/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error
* found when Flow v0.54 was deployed. To see the error delete this comment and
* run Flow. */
const defaultProvidesModuleNodeModules = require('metro-bundler/src/defaults').providesModuleNodeModules;
const defaultProvidesModuleNodeModules = require('metro/src/defaults').providesModuleNodeModules;

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

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

async function buildBundle(
args: OutputOptions & {
Expand Down
2 changes: 1 addition & 1 deletion local-cli/bundle/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

const buildBundle = require('./buildBundle');
const bundleCommandLineArgs = require('./bundleCommandLineArgs');
const outputBundle = require('metro-bundler/src/shared/output/bundle');
const outputBundle = require('metro/src/shared/output/bundle');

/**
* Builds the bundle starting to look for dependencies at the given entry path.
Expand Down
2 changes: 1 addition & 1 deletion local-cli/bundle/types.flow.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error
* found when Flow v0.54 was deployed. To see the error delete this comment and
* run Flow. */
export type {OutputOptions, RequestOptions} from 'metro-bundler/src/shared/types.flow';
export type {OutputOptions, RequestOptions} from 'metro/src/shared/types.flow';
2 changes: 1 addition & 1 deletion local-cli/bundle/unbundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

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

/**
* Builds the bundle starting to look for dependencies at the given entry path.
Expand Down
2 changes: 1 addition & 1 deletion local-cli/core/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const minimist = require('minimist');
const path = require('path');

import type {CommandT} from '../commands';
import type {ConfigT} from 'metro-bundler';
import type {ConfigT} from 'metro';

export type RNConfig = {
...ConfigT,
Expand Down
2 changes: 1 addition & 1 deletion local-cli/dependencies/dependencies.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/
'use strict';

const ReactPackager = require('metro-bundler');
const ReactPackager = require('metro');

const denodeify = require('denodeify');
const fs = require('fs');
Expand Down
2 changes: 1 addition & 1 deletion local-cli/server/checkNodeVersion.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
'use strict';

var chalk = require('chalk');
var formatBanner = require('metro-bundler/src/lib/formatBanner');
var formatBanner = require('metro/src/lib/formatBanner');
var semver = require('semver');

module.exports = function() {
Expand Down
22 changes: 11 additions & 11 deletions local-cli/server/runServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,28 +16,28 @@ require('../../setupBabel')();
/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error
* found when Flow v0.54 was deployed. To see the error delete this comment and
* run Flow. */
const ReactPackager = require('metro-bundler');
const ReactPackager = require('metro');

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

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

const attachWebsocketServer = require('./util/attachWebsocketServer');
/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error
* found when Flow v0.54 was deployed. To see the error delete this comment and
* run Flow. */
const connect = require('connect');
const copyToClipBoardMiddleware = require('./middleware/copyToClipBoardMiddleware');
const defaultAssetExts = require('metro-bundler/src/defaults').assetExts;
const defaultSourceExts = require('metro-bundler/src/defaults').sourceExts;
const defaultPlatforms = require('metro-bundler/src/defaults').platforms;
const defaultAssetExts = require('metro/src/defaults').assetExts;
const defaultSourceExts = require('metro/src/defaults').sourceExts;
const defaultPlatforms = require('metro/src/defaults').platforms;
/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error
* found when Flow v0.54 was deployed. To see the error delete this comment and
* run Flow. */
const defaultProvidesModuleNodeModules = require('metro-bundler/src/defaults')
const defaultProvidesModuleNodeModules = require('metro/src/defaults')
.providesModuleNodeModules;
const fs = require('fs');
const getDevToolsMiddleware = require('./middleware/getDevToolsMiddleware');
Expand All @@ -55,15 +55,15 @@ const webSocketProxy = require('./util/webSocketProxy.js');
/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error
* found when Flow v0.54 was deployed. To see the error delete this comment and
* run Flow. */
const TransformCaching = require('metro-bundler/src/lib/TransformCaching');
const TransformCaching = require('metro/src/lib/TransformCaching');

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

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

export type Args = {|
+assetExts: $ReadOnlyArray<string>,
Expand Down Expand Up @@ -152,7 +152,7 @@ function runServer(

function getReporterImpl(customLogReporterPath: ?string) {
if (customLogReporterPath == null) {
return require('metro-bundler/src/lib/TerminalReporter');
return require('metro/src/lib/TerminalReporter');
}
try {
// First we let require resolve it, so we can require packages in node_modules
Expand Down
2 changes: 1 addition & 1 deletion local-cli/server/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const path = require('path');
const runServer = require('./runServer');

import type {RNConfig} from '../core';
import type {ConfigT} from 'metro-bundler';
import type {ConfigT} from 'metro';
import type {Args as RunServerArgs} from './runServer';

/**
Expand Down
2 changes: 1 addition & 1 deletion local-cli/server/util/debugger-ui/DeltaPatcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

/**
* This file is a copy of the reference `DeltaPatcher`, located in
* metro-bundler. The reason to not reuse that file is that in this context
* metro. The reason to not reuse that file is that in this context
* we cannot have flow annotations or CJS syntax (since this file is directly)
* injected into a static HTML page.
*
Expand Down
4 changes: 2 additions & 2 deletions local-cli/util/Config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ const getPolyfills = require('../../rn-get-polyfills');
const invariant = require('fbjs/lib/invariant');
const path = require('path');

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

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

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

/**
* Configuration file of the CLI.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@
"graceful-fs": "^4.1.3",
"inquirer": "^3.0.6",
"lodash": "^4.16.6",
"metro-bundler": "^0.22.1",
"metro": "^0.22.1",
"mime": "^1.3.4",
"minimist": "^1.2.0",
"mkdirp": "^0.5.1",
Expand Down
Loading

0 comments on commit 654fed4

Please sign in to comment.