{"action":"created","issue":{"url":"https://api.github.com/repos/emberjs/rfcs/issues/154","repository_url":"https://api.github.com/repos/emberjs/rfcs","labels_url":"https://api.github.com/repos/emberjs/rfcs/issues/154/labels{/name}","comments_url":"https://api.github.com/repos/emberjs/rfcs/issues/154/comments","events_url":"https://api.github.com/repos/emberjs/rfcs/issues/154/events","html_url":"https://github.com/emberjs/rfcs/pull/154","id":166221278,"number":154,"title":"RFC for router enhancements","user":{"login":"cibernox","id":265339,"avatar_url":"https://avatars.githubusercontent.com/u/265339?v=3","gravatar_id":"","url":"https://api.github.com/users/cibernox","html_url":"https://github.com/cibernox","followers_url":"https://api.github.com/users/cibernox/followers","following_url":"https://api.github.com/users/cibernox/following{/other_user}","gists_url":"https://api.github.com/users/cibernox/gists{/gist_id}","starred_url":"https://api.github.com/users/cibernox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cibernox/subscriptions","organizations_url":"https://api.github.com/users/cibernox/orgs","repos_url":"https://api.github.com/users/cibernox/repos","events_url":"https://api.github.com/users/cibernox/events{/privacy}","received_events_url":"https://api.github.com/users/cibernox/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":12,"created_at":"2016-07-19T00:10:49Z","updated_at":"2016-12-01T22:34:24Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/emberjs/rfcs/pulls/154","html_url":"https://github.com/emberjs/rfcs/pull/154","diff_url":"https://github.com/emberjs/rfcs/pull/154.diff","patch_url":"https://github.com/emberjs/rfcs/pull/154.patch"},"body":"Expand Ember's router with support for optional segments and constraints.\n\n[Rendered](https://github.com/cibernox/rfcs/blob/router_enhancements/text/router-enhancements.md)\n"},"comment":{"url":"https://api.github.com/repos/emberjs/rfcs/issues/comments/264316719","html_url":"https://github.com/emberjs/rfcs/pull/154#issuecomment-264316719","issue_url":"https://api.github.com/repos/emberjs/rfcs/issues/154","id":264316719,"user":{"login":"simonihmig","id":1325249,"avatar_url":"https://avatars.githubusercontent.com/u/1325249?v=3","gravatar_id":"","url":"https://api.github.com/users/simonihmig","html_url":"https://github.com/simonihmig","followers_url":"https://api.github.com/users/simonihmig/followers","following_url":"https://api.github.com/users/simonihmig/following{/other_user}","gists_url":"https://api.github.com/users/simonihmig/gists{/gist_id}","starred_url":"https://api.github.com/users/simonihmig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simonihmig/subscriptions","organizations_url":"https://api.github.com/users/simonihmig/orgs","repos_url":"https://api.github.com/users/simonihmig/repos","events_url":"https://api.github.com/users/simonihmig/events{/privacy}","received_events_url":"https://api.github.com/users/simonihmig/received_events","type":"User","site_admin":false},"created_at":"2016-12-01T22:34:24Z","updated_at":"2016-12-01T22:34:24Z","body":"I have not seen a discussion about default values for optional segments here. Is that not under consideration?\r\n\r\nGiven the one example from the RFC wouldn't it be nice to do something like that:\r\n```js\r\nRouter.map(function() {\r\n  this.route('forecast', {\r\n    path: 'forecast/(:scale)',\r\n    constraints: { scale: /(celsius|fahrenheit|kelvin)/ },\r\n    defaults: { scale: 'celsius' }\r\n  });\r\n});\r\n\r\n\r\nrouter.serialize('/forecast/celsius'); // => routeName='forecast', params: { scale: 'celsius' }\r\nrouter.serialize('/forecast/newton'); // => not recognized route.\r\nrouter.serialize('/forecast'); // => routeName='forecast', params: { scale: 'celsius' }\r\n```\r\n\r\nThis way the `forecast` route would not have to explicitly handle the case where the 'scale' param would be `undefined` (see the example's last line)."}}
{"actor":{"display_login":"simonihmig"}}