{"action":"created","issue":{"url":"https://api.github.com/repos/webpack/webpack/issues/2974","repository_url":"https://api.github.com/repos/webpack/webpack","labels_url":"https://api.github.com/repos/webpack/webpack/issues/2974/labels{/name}","comments_url":"https://api.github.com/repos/webpack/webpack/issues/2974/comments","events_url":"https://api.github.com/repos/webpack/webpack/issues/2974/events","html_url":"https://github.com/webpack/webpack/pull/2974","id":175805776,"number":2974,"title":"Use JSON schema to validate webpack config (fixes #2971)","user":{"login":"gajus","id":973543,"avatar_url":"https://avatars.githubusercontent.com/u/973543?v=3","gravatar_id":"","url":"https://api.github.com/users/gajus","html_url":"https://github.com/gajus","followers_url":"https://api.github.com/users/gajus/followers","following_url":"https://api.github.com/users/gajus/following{/other_user}","gists_url":"https://api.github.com/users/gajus/gists{/gist_id}","starred_url":"https://api.github.com/users/gajus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gajus/subscriptions","organizations_url":"https://api.github.com/users/gajus/orgs","repos_url":"https://api.github.com/users/gajus/repos","events_url":"https://api.github.com/users/gajus/events{/privacy}","received_events_url":"https://api.github.com/users/gajus/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/webpack/webpack/labels/documentation","name":"documentation","color":"d4c5f9"},{"url":"https://api.github.com/repos/webpack/webpack/labels/X3:%20discussion%20required","name":"X3: discussion required","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":27,"created_at":"2016-09-08T16:55:02Z","updated_at":"2016-09-09T15:57:25Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/webpack/webpack/pulls/2974","html_url":"https://github.com/webpack/webpack/pull/2974","diff_url":"https://github.com/webpack/webpack/pull/2974.diff","patch_url":"https://github.com/webpack/webpack/pull/2974.patch"},"body":"**What kind of change does this PR introduce?** (Bug fix, feature, docs update, ...)\r\n\r\n- [x] Feature\r\n\r\n**What is the current behavior?** (You can also link to an open issue here)\r\n\r\nValidation is limited to a simple condition:\r\n\r\n```js\r\nif(!options.entry && !options.plugins) {\r\n  throw new Error(\"Passed 'options' object does not look like a valid webpack configuration\");\r\n}\r\n```\r\n\r\n**What is the new behavior?**\r\n\r\nValidation logic is expressed using `./schemas/webpackOptionsSchema.json` JSON schema.\r\n\r\n**Does this PR introduce a breaking change?**\r\n\r\n- [x] Yes\r\n\r\nIf this PR contains a breaking change, please describe the following... \r\n\r\n* Impact:\r\n    \r\n    An error is thrown when an unknown configuration is encountered in webpack options object.\r\n    This error might appear now because previously unknown configuration was ignored.\r\n    \r\n* Migration path for existing applications:\r\n    \r\n    Remove unknown configuration properties from webpack options object.\r\n    To configure a loader, use `LoaderOptionsPlugin`.\r\n    For a list of valid configuration properties, refer to the webpack documentation (https://webpack.github.io/docs/configuration.html).\r\n\r\n* Github Issue(s) this is regarding:\r\n    \r\n    https://github.com/webpack/webpack/issues/2971\r\n\r\n**Other information**:\r\n\r\n* Need to discuss how to approach testing.\r\n    \r\n    JSON schema is declarative. Therefore, the contents of the schema should not be tested. The implementation testing is left to https://github.com/epoberezkin/ajv.\r\n* Need to discuss how to inform user about errors.\r\n    \r\n    Just throwing an error is not enough.\r\n    > Passed 'options' object does not look like a valid webpack configuration\r\n    \r\n    I am fine with the current implementation – throwing an error and printing detail info to the `console.log`. I can see how someone can dislike this.\r\n\r\n### Outstanding tasks\r\n\r\n* [ ] Waiting for @sokra to come back on https://github.com/webpack/webpack/pull/2974#discussion_r78160976\r\n* [x] Waiting for a decision/ solution regarding a pre-existing failing test condition https://github.com/webpack/webpack/pull/2974#issuecomment-245860191"},"comment":{"url":"https://api.github.com/repos/webpack/webpack/issues/comments/245956309","html_url":"https://github.com/webpack/webpack/pull/2974#issuecomment-245956309","issue_url":"https://api.github.com/repos/webpack/webpack/issues/2974","id":245956309,"user":{"login":"sokra","id":1365881,"avatar_url":"https://avatars.githubusercontent.com/u/1365881?v=3","gravatar_id":"","url":"https://api.github.com/users/sokra","html_url":"https://github.com/sokra","followers_url":"https://api.github.com/users/sokra/followers","following_url":"https://api.github.com/users/sokra/following{/other_user}","gists_url":"https://api.github.com/users/sokra/gists{/gist_id}","starred_url":"https://api.github.com/users/sokra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sokra/subscriptions","organizations_url":"https://api.github.com/users/sokra/orgs","repos_url":"https://api.github.com/users/sokra/repos","events_url":"https://api.github.com/users/sokra/events{/privacy}","received_events_url":"https://api.github.com/users/sokra/received_events","type":"User","site_admin":false},"created_at":"2016-09-09T15:57:25Z","updated_at":"2016-09-09T15:57:25Z","body":"yeah, but the link should be http://webpack.js.org/api/configuration/\r\n\r\nDon't link to the old documentation."}}
{"actor":{"display_login":"sokra"}}