mirror of
https://github.com/status-im/react-native.git
synced 2025-01-29 02:35:41 +00:00
Breaking change: Move bundle
to private-cli
Summary: @public We need to start using the `private-cli` for the new asset system. Note this is a breaking change! People will have to upgrade their workflows/scripts to start using the new cli. Otherwise we'd need to build a thin adapter that is aware of both APIs which is something we;d like to avoid. The major API changes are: - API is now `entry-file` based instead of `url` based. - /s/--out/--bundle-output - /s/--out/--sourcemap-output Also these parameters have no longer default values, you need to specify them. For instance, if you want to generate the sourcemaps you need to pass in the `--sourcemap-output` option Lastly, additional project roots or asset roots need to be specified on the `rn-cli.config.js`. Reviewed By: @frantic Differential Revision: D2533877 fb-gh-sync-id: a45f9095fdf9442a9106ea7bb6a6b7f651d25273
This commit is contained in:
parent
793c3564ff
commit
a102e6f587
10
breaking-changes.md
Normal file
10
breaking-changes.md
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
# Breaking Changes
|
||||||
|
|
||||||
|
## 0.14
|
||||||
|
|
||||||
|
- D2530161: Need to introduce rn-cli.config.js for existing projects
|
||||||
|
- D2533877: `react-native bundle` API changes:
|
||||||
|
- API is now `entry-file <path>` based instead of url based.
|
||||||
|
- Need to specify which platform you're bundling for `--platform <ios|android>`.
|
||||||
|
- Option `--out` has been renamed for `--bundle-output`.
|
||||||
|
- Source maps are no longer automatically generated. Need to specify `--sourcemap-output <path>` option to indicate where to put the source maps.
|
@ -1,3 +0,0 @@
|
|||||||
0.14:
|
|
||||||
- D2530161: Need to introduce rn-cli.config.js for existing projects
|
|
||||||
|
|
4
cli.js
4
cli.js
@ -8,4 +8,8 @@
|
|||||||
*/
|
*/
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
require('./packager/babelRegisterOnly')([
|
||||||
|
/private-cli\/src/
|
||||||
|
]);
|
||||||
|
|
||||||
module.exports = require('./local-cli/cli.js');
|
module.exports = require('./local-cli/cli.js');
|
||||||
|
@ -4,13 +4,13 @@
|
|||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
var bundle = require('../private-cli/src/bundle/bundle');
|
||||||
|
var bundle_DEPRECATED = require('./bundle.js');
|
||||||
|
var Config = require('../private-cli/src/util/Config');
|
||||||
var fs = require('fs');
|
var fs = require('fs');
|
||||||
var spawn = require('child_process').spawn;
|
|
||||||
var path = require('path');
|
|
||||||
var generateAndroid = require('./generate-android.js');
|
var generateAndroid = require('./generate-android.js');
|
||||||
var init = require('./init.js');
|
var init = require('./init.js');
|
||||||
var install = require('./install.js');
|
var install = require('./install.js');
|
||||||
var bundle = require('./bundle.js');
|
|
||||||
var newLibrary = require('./new-library.js');
|
var newLibrary = require('./new-library.js');
|
||||||
var runAndroid = require('./run-android.js');
|
var runAndroid = require('./run-android.js');
|
||||||
var runPackager = require('./run-packager.js');
|
var runPackager = require('./run-packager.js');
|
||||||
@ -51,7 +51,8 @@ function run() {
|
|||||||
install.init();
|
install.init();
|
||||||
break;
|
break;
|
||||||
case 'bundle':
|
case 'bundle':
|
||||||
bundle.init(args);
|
bundle(args, Config.get(__dirname)).done();
|
||||||
|
// bundle_DEPRECATED.init(args);
|
||||||
break;
|
break;
|
||||||
case 'new-library':
|
case 'new-library':
|
||||||
newLibrary.init(args);
|
newLibrary.init(args);
|
||||||
|
@ -4,23 +4,20 @@ var blacklist = require('./node_modules/react-native/packager/blacklist');
|
|||||||
|
|
||||||
var config = {
|
var config = {
|
||||||
getProjectRoots() {
|
getProjectRoots() {
|
||||||
return this._getRoots();
|
return [__dirname];
|
||||||
},
|
},
|
||||||
|
|
||||||
getAssetRoots() {
|
getAssetRoots() {
|
||||||
return this._getRoots();
|
// speficy where to look for assets
|
||||||
|
return [];
|
||||||
},
|
},
|
||||||
|
|
||||||
getBlacklistRE() {
|
getBlacklistRE(platform) {
|
||||||
return blacklist('');
|
return blacklist(platform);
|
||||||
},
|
},
|
||||||
|
|
||||||
getTransformModulePath() {
|
getTransformModulePath() {
|
||||||
return require.resolve('./node_modules/react-native/packager/transformer');
|
return require.resolve('./node_modules/react-native/packager/transformer');
|
||||||
},
|
|
||||||
|
|
||||||
_getRoots() {
|
|
||||||
return [__dirname];
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -63,7 +63,7 @@ function _bundle(argv, config, resolve, reject) {
|
|||||||
const options = {
|
const options = {
|
||||||
projectRoots: config.getProjectRoots(),
|
projectRoots: config.getProjectRoots(),
|
||||||
assetRoots: config.getAssetRoots(),
|
assetRoots: config.getAssetRoots(),
|
||||||
blacklistRE: config.getBlacklistRE(),
|
blacklistRE: config.getBlacklistRE(args.platform),
|
||||||
transformModulePath: config.getTransformModulePath(),
|
transformModulePath: config.getTransformModulePath(),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ function _dependencies(argv, config, resolve, reject) {
|
|||||||
const packageOpts = {
|
const packageOpts = {
|
||||||
projectRoots: config.getProjectRoots(),
|
projectRoots: config.getProjectRoots(),
|
||||||
assetRoots: config.getAssetRoots(),
|
assetRoots: config.getAssetRoots(),
|
||||||
blacklistRE: config.getBlacklistRE(),
|
blacklistRE: config.getBlacklistRE(args.platform),
|
||||||
transformModulePath: config.getTransformModulePath(),
|
transformModulePath: config.getTransformModulePath(),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user