Skip to content

Commit

Permalink
refactor: remove the features option (#2410)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: the `features` option was remove without alternatives
  • Loading branch information
evilebottnawi committed Jan 30, 2020
1 parent 036fa17 commit ba2993f
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 18 deletions.
2 changes: 1 addition & 1 deletion lib/Server.js
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ class Server {
runnableFeatures.push('after');
}

(this.options.features || runnableFeatures).forEach((feature) => {
runnableFeatures.forEach((feature) => {
features[feature]();
});
}
Expand Down
7 changes: 0 additions & 7 deletions lib/options.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,6 @@
"disableHostCheck": {
"type": "boolean"
},
"features": {
"type": "array",
"items": {
"type": "string"
}
},
"filename": {
"anyOf": [
{
Expand Down Expand Up @@ -424,7 +418,6 @@
"compress": "should be {Boolean} (https://webpack.js.org/configuration/dev-server/#devservercompress)",
"contentBase": "should be {Number|String|Array} (https://webpack.js.org/configuration/dev-server/#devservercontentbase)",
"disableHostCheck": "should be {Boolean} (https://webpack.js.org/configuration/dev-server/#devserverdisablehostcheck)",
"features": "should be {Array}",
"filename": "should be {String|RegExp|Function} (https://webpack.js.org/configuration/dev-server/#devserverfilename-)",
"fs": "should be {Object} (https://github.com/webpack/webpack-dev-middleware#fs)",
"headers": "should be {Object} (https://webpack.js.org/configuration/dev-server/#devserverheaders-)",
Expand Down
6 changes: 0 additions & 6 deletions test/__snapshots__/validate-options.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,6 @@ exports[`options should throw an error on the "disableHostCheck" option with ""
- options.disableHostCheck should be a boolean."
`;

exports[`options should throw an error on the "features" option with "false" value 1`] = `
"Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.
- options.features should be an array:
[string, ...]"
`;

exports[`options should throw an error on the "filename" option with "false" value 1`] = `
"Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.
- options.filename should be one of these:
Expand Down
4 changes: 0 additions & 4 deletions test/validate-options.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,6 @@ describe('options', () => {
success: [true],
failure: [''],
},
features: {
success: [['before'], []],
failure: [false],
},
filename: {
success: ['', new RegExp(''), () => {}],
failure: [false],
Expand Down

0 comments on commit ba2993f

Please sign in to comment.