{"action":"created","issue":{"url":"https://api.github.com/repos/mozilla-neutrino/neutrino-dev/issues/900","repository_url":"https://api.github.com/repos/mozilla-neutrino/neutrino-dev","labels_url":"https://api.github.com/repos/mozilla-neutrino/neutrino-dev/issues/900/labels{/name}","comments_url":"https://api.github.com/repos/mozilla-neutrino/neutrino-dev/issues/900/comments","events_url":"https://api.github.com/repos/mozilla-neutrino/neutrino-dev/issues/900/events","html_url":"https://github.com/mozilla-neutrino/neutrino-dev/issues/900","id":325827272,"node_id":"MDU6SXNzdWUzMjU4MjcyNzI=","number":900,"title":"Properly set `mode` and `NODE_ENV` for test middleware","user":{"login":"eliperelman","id":285899,"node_id":"MDQ6VXNlcjI4NTg5OQ==","avatar_url":"https://avatars0.githubusercontent.com/u/285899?v=4","gravatar_id":"","url":"https://api.github.com/users/eliperelman","html_url":"https://github.com/eliperelman","followers_url":"https://api.github.com/users/eliperelman/followers","following_url":"https://api.github.com/users/eliperelman/following{/other_user}","gists_url":"https://api.github.com/users/eliperelman/gists{/gist_id}","starred_url":"https://api.github.com/users/eliperelman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eliperelman/subscriptions","organizations_url":"https://api.github.com/users/eliperelman/orgs","repos_url":"https://api.github.com/users/eliperelman/repos","events_url":"https://api.github.com/users/eliperelman/events{/privacy}","received_events_url":"https://api.github.com/users/eliperelman/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/mozilla-neutrino/neutrino-dev/milestones/6","html_url":"https://github.com/mozilla-neutrino/neutrino-dev/milestone/6","labels_url":"https://api.github.com/repos/mozilla-neutrino/neutrino-dev/milestones/6/labels","id":3272176,"node_id":"MDk6TWlsZXN0b25lMzI3MjE3Ng==","number":6,"title":"v9","description":"This release is the next major version, which includes webpack v4 and Babel 7.","creator":{"login":"eliperelman","id":285899,"node_id":"MDQ6VXNlcjI4NTg5OQ==","avatar_url":"https://avatars0.githubusercontent.com/u/285899?v=4","gravatar_id":"","url":"https://api.github.com/users/eliperelman","html_url":"https://github.com/eliperelman","followers_url":"https://api.github.com/users/eliperelman/followers","following_url":"https://api.github.com/users/eliperelman/following{/other_user}","gists_url":"https://api.github.com/users/eliperelman/gists{/gist_id}","starred_url":"https://api.github.com/users/eliperelman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eliperelman/subscriptions","organizations_url":"https://api.github.com/users/eliperelman/orgs","repos_url":"https://api.github.com/users/eliperelman/repos","events_url":"https://api.github.com/users/eliperelman/events{/privacy}","received_events_url":"https://api.github.com/users/eliperelman/received_events","type":"User","site_admin":false},"open_issues":11,"closed_issues":46,"state":"open","created_at":"2018-04-16T22:31:33Z","updated_at":"2018-06-01T12:16:14Z","due_on":"2018-06-30T07:00:00Z","closed_at":null},"comments":0,"created_at":"2018-05-23T18:41:40Z","updated_at":"2018-06-01T14:07:10Z","closed_at":null,"author_association":"MEMBER","body":"In the v8 line of Neutrino we manually default `NODE_ENV` to `test` when running the test command. With the removal of the Neutrino CLI, we would no longer have a test command, but we do still have testing middleware via the karma, mocha, and jest presets. We should ensure that we have a reasonable value for the `config.mode` and `NODE_ENV` for test middleware to rely on while trying to get the least number of config permutations.\r\n\r\nAt the outset, I'm wondering if we should have `--mode none` and `NODE_ENV=test`, but I think @edmorley had concerns about this particular mode. Also need to ensure that these values can be easily overridden from the host environment."},"comment":{"url":"https://api.github.com/repos/mozilla-neutrino/neutrino-dev/issues/comments/393891660","html_url":"https://github.com/mozilla-neutrino/neutrino-dev/issues/900#issuecomment-393891660","issue_url":"https://api.github.com/repos/mozilla-neutrino/neutrino-dev/issues/900","id":393891660,"node_id":"MDEyOklzc3VlQ29tbWVudDM5Mzg5MTY2MA==","user":{"login":"edmorley","id":501702,"node_id":"MDQ6VXNlcjUwMTcwMg==","avatar_url":"https://avatars3.githubusercontent.com/u/501702?v=4","gravatar_id":"","url":"https://api.github.com/users/edmorley","html_url":"https://github.com/edmorley","followers_url":"https://api.github.com/users/edmorley/followers","following_url":"https://api.github.com/users/edmorley/following{/other_user}","gists_url":"https://api.github.com/users/edmorley/gists{/gist_id}","starred_url":"https://api.github.com/users/edmorley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edmorley/subscriptions","organizations_url":"https://api.github.com/users/edmorley/orgs","repos_url":"https://api.github.com/users/edmorley/repos","events_url":"https://api.github.com/users/edmorley/events{/privacy}","received_events_url":"https://api.github.com/users/edmorley/received_events","type":"User","site_admin":false},"created_at":"2018-06-01T14:07:10Z","updated_at":"2018-06-01T14:07:10Z","author_association":"MEMBER","body":"I've been experimenting with setting mode to `development` when using Karma.\r\n\r\nI've finally got it working, however I can see from the webpack build console output that the hot reloader configs are being added. This doesn't break anything, but is another side-effect of consolidating 9+ different permutations of configuration (`command = {start, build, test, ...}` x `NODE_ENV = {production, development, test}`) into just two (`mode = {development, production}`).\r\n\r\nI'd be open to considering `mode=none` as a way to add a third state, though it would disable some of the webpack development features that might be useful for testing (eg named modules), so we'd want to vet those:\r\nhttps://github.com/webpack/webpack/blob/v4.10.2/lib/WebpackOptionsDefaulter.js#L257-L266\r\n\r\nOther possible options:\r\n\r\n1) Make Neutrino support a `mode` of 'test', that gets translated to 'development' in the webpack config, but sets NODE_ENV to 'test'. Presets would then be encouraged to check the value of NODE_ENV rather than `mode`, so they would see all three states, not just the 2 stats of `mode`. (Though having Neutrino's `mode` support extra options is kinda confusing, so not sure this is ideal.)\r\n\r\n2) Encourage presets to use NODE_ENV to check for development/production/test, and allow the adapters (`neutrino().karma()` etc) to set both a default mode and NODE_ENV. "}}
{"actor":{"display_login":"edmorley"}}