mirror of
https://github.com/status-im/metro.git
synced 2025-01-19 07:32:16 +00:00
packager: JSTransform cleanup: remove opts.worker
Summary: it's not used from any callsite as far as I can see. Reviewed By: davidaurelio Differential Revision: D4481699 fbshipit-source-id: 4cf63ef7953d6cfc58e7ef4f22ecb99bf51e76a0
This commit is contained in:
parent
fd5933b63d
commit
485dcb1e79
@ -39,9 +39,6 @@ const validateOpts = declareOpts({
|
|||||||
type:'string',
|
type:'string',
|
||||||
required: false,
|
required: false,
|
||||||
},
|
},
|
||||||
worker: {
|
|
||||||
type: 'string',
|
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
type: 'array',
|
type: 'array',
|
||||||
default: [],
|
default: [],
|
||||||
@ -50,7 +47,6 @@ const validateOpts = declareOpts({
|
|||||||
|
|
||||||
type Options = {
|
type Options = {
|
||||||
transformModulePath?: ?string,
|
transformModulePath?: ?string,
|
||||||
worker?: ?string,
|
|
||||||
methods?: ?Array<string>,
|
methods?: ?Array<string>,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -90,7 +86,6 @@ class Transformer {
|
|||||||
|
|
||||||
_opts: {
|
_opts: {
|
||||||
transformModulePath?: ?string,
|
transformModulePath?: ?string,
|
||||||
worker: ?string,
|
|
||||||
methods: Array<string>,
|
methods: Array<string>,
|
||||||
};
|
};
|
||||||
_workers: {[name: string]: mixed};
|
_workers: {[name: string]: mixed};
|
||||||
@ -112,16 +107,7 @@ class Transformer {
|
|||||||
|
|
||||||
const {transformModulePath} = opts;
|
const {transformModulePath} = opts;
|
||||||
|
|
||||||
if (opts.worker) {
|
if (transformModulePath) {
|
||||||
this._workers =
|
|
||||||
makeFarm(opts.worker, opts.methods, TRANSFORM_TIMEOUT_INTERVAL);
|
|
||||||
opts.methods.forEach(name => {
|
|
||||||
/* $FlowFixMe: assigning the class object fields directly is
|
|
||||||
* questionable, because it's prone to conflicts. */
|
|
||||||
this[name] = this._workers[name];
|
|
||||||
});
|
|
||||||
}
|
|
||||||
else if (transformModulePath) {
|
|
||||||
this._transformModulePath = require.resolve(transformModulePath);
|
this._transformModulePath = require.resolve(transformModulePath);
|
||||||
|
|
||||||
this._workers = makeFarm(
|
this._workers = makeFarm(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user