Skip to content

Commit ebf5aea

Browse files
Jean Lauliacfacebook-github-bot
Jean Lauliac
authored andcommitted
BREAKING: metro: rename 'unbundle' to 'ram bundle'
Summary: @public Let's get rid of the "unbundle" terminology and instead use "RAM bundle", short for "Random Access Bundle" format. THIS IS A BREAKING CHANGE FOR OSS, as the command becomes `ram-bundle` instead of `unbundle`. It realy shouldn't be a command to start with (only a "format" specifier for the `bundle` command), but I don't want to do that change at this point. Reviewed By: davidaurelio Differential Revision: D8894433 fbshipit-source-id: 5565f9ae94c7c2d7f6b25f95ae45b64f27f6aec8
1 parent 583cb13 commit ebf5aea

File tree

3 files changed

+45
-13
lines changed

3 files changed

+45
-13
lines changed

local-cli/bundle/ramBundle.js

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/**
2+
* Copyright (c) 2015-present, Facebook, Inc.
3+
*
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
6+
*
7+
* @format
8+
*/
9+
10+
'use strict';
11+
12+
const bundleWithOutput = require('./bundle').withOutput;
13+
const bundleCommandLineArgs = require('./bundleCommandLineArgs');
14+
const outputUnbundle = require('metro/src/shared/output/unbundle');
15+
16+
/**
17+
* Builds the bundle starting to look for dependencies at the given entry path.
18+
*/
19+
function ramBundle(argv, config, args) {
20+
return bundleWithOutput(argv, config, args, outputUnbundle);
21+
}
22+
23+
module.exports = {
24+
name: 'ram-bundle',
25+
description:
26+
'builds javascript as a "Random Access Module" bundle for offline use',
27+
func: ramBundle,
28+
options: bundleCommandLineArgs.concat({
29+
command: '--indexed-ram-bundle',
30+
description:
31+
'Force the "Indexed RAM" bundle file format, even when building for android',
32+
default: false,
33+
}),
34+
};

local-cli/bundle/unbundle.js

+10-13
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,22 @@
99

1010
'use strict';
1111

12-
const bundleWithOutput = require('./bundle').withOutput;
1312
const bundleCommandLineArgs = require('./bundleCommandLineArgs');
14-
const outputUnbundle = require('metro/src/shared/output/unbundle');
15-
16-
/**
17-
* Builds the bundle starting to look for dependencies at the given entry path.
18-
*/
19-
function unbundle(argv, config, args) {
20-
return bundleWithOutput(argv, config, args, outputUnbundle);
21-
}
2213

2314
module.exports = {
2415
name: 'unbundle',
25-
description: 'builds javascript as "unbundle" for offline use',
26-
func: unbundle,
16+
description: 'Deprecated. Renamed to `ram-bundle`.',
17+
func: () => {
18+
throw new Error(
19+
'The `unbundle` command has been renamed `ram-bundle` to better ' +
20+
'represent the actual functionality. `ram` mean "Random Access ' +
21+
'Module", this particular format of bundle. Functionality remained ' +
22+
'unchanged.',
23+
);
24+
},
2725
options: bundleCommandLineArgs.concat({
2826
command: '--indexed-unbundle',
29-
description:
30-
'Force indexed unbundle file format, even when building for android',
27+
description: 'Deprecated. Renamed to `--indexed-ram-bundle`.',
3128
default: false,
3229
}),
3330
};

local-cli/commands.js

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ const documentedCommands = [
4242
require('./library/library'),
4343
require('./bundle/bundle'),
4444
require('./bundle/unbundle'),
45+
require('./bundle/ramBundle'),
4546
require('./eject/eject'),
4647
require('./link/link'),
4748
require('./link/unlink'),

0 commit comments

Comments
 (0)