Skip to content

Commit 8235fd3

Browse files
refactor: remove the features option (#2604)
BREAKING CHANGE: the `features` option was removed
1 parent e94238b commit 8235fd3

File tree

4 files changed

+2
-13
lines changed

4 files changed

+2
-13
lines changed

lib/Server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ class Server {
508508
runnableFeatures.push('onAfterSetupMiddleware');
509509
}
510510

511-
(this.options.features || runnableFeatures).forEach((feature) => {
511+
runnableFeatures.forEach((feature) => {
512512
features[feature]();
513513
});
514514
}

lib/options.json

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,6 @@
8787
"disableHostCheck": {
8888
"type": "boolean"
8989
},
90-
"features": {
91-
"type": "array",
92-
"items": {
93-
"type": "string"
94-
}
95-
},
9690
"fs": {
9791
"type": "object"
9892
},
@@ -431,7 +425,6 @@
431425
"compress": "should be {Boolean} (https://webpack.js.org/configuration/dev-server/#devservercompress)",
432426
"contentBase": "should be {Number|String|Array} (https://webpack.js.org/configuration/dev-server/#devservercontentbase)",
433427
"disableHostCheck": "should be {Boolean} (https://webpack.js.org/configuration/dev-server/#devserverdisablehostcheck)",
434-
"features": "should be {Array}",
435428
"fs": "should be {Object} (https://github.com/webpack/webpack-dev-middleware#fs)",
436429
"headers": "should be {Object} (https://webpack.js.org/configuration/dev-server/#devserverheaders-)",
437430
"historyApiFallback": "should be {Boolean|Object} (https://webpack.js.org/configuration/dev-server/#devserverhistoryapifallback)",

test/__snapshots__/Validation.test.js.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,5 @@ exports[`Validation validation should fail validation for invalid \`writeToDisk\
3737
exports[`Validation validation should fail validation for no additional properties 1`] = `
3838
"Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema.
3939
- configuration has an unknown property 'additional'. These properties are valid:
40-
object { allowedHosts?, bonjour?, clientLogLevel?, clientOptions?, compress?, contentBasePublicPath?, contentBase?, disableHostCheck?, features?, fs?, headers?, historyApiFallback?, host?, hot?, http2?, https?, index?, injectClient?, injectHot?, liveReload?, log?, logLevel?, logTime?, mimeTypes?, noInfo?, onAfterSetupMiddleware?, onBeforeSetupMiddleware?, onListening?, open?, openPage?, overlay?, port?, profile?, progress?, proxy?, public?, publicPath?, quiet?, reporter?, requestCert?, serveIndex?, serverSideRender?, socket?, staticOptions?, stats?, transportMode?, useLocalIp?, warn?, watchContentBase?, watchOptions?, writeToDisk? }"
40+
object { allowedHosts?, bonjour?, clientLogLevel?, clientOptions?, compress?, contentBasePublicPath?, contentBase?, disableHostCheck?, fs?, headers?, historyApiFallback?, host?, hot?, http2?, https?, index?, injectClient?, injectHot?, liveReload?, log?, logLevel?, logTime?, mimeTypes?, noInfo?, onAfterSetupMiddleware?, onBeforeSetupMiddleware?, onListening?, open?, openPage?, overlay?, port?, profile?, progress?, proxy?, public?, publicPath?, quiet?, reporter?, requestCert?, serveIndex?, serverSideRender?, socket?, staticOptions?, stats?, transportMode?, useLocalIp?, warn?, watchContentBase?, watchOptions?, writeToDisk? }"
4141
`;

test/options.test.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -215,10 +215,6 @@ describe('options', () => {
215215
success: [true],
216216
failure: [''],
217217
},
218-
features: {
219-
success: [['onBeforeSetupMiddleware', 'onAfterSetupMiddleware'], []],
220-
failure: [false],
221-
},
222218
fs: {
223219
success: [
224220
{

0 commit comments

Comments
 (0)