{"action":"created","issue":{"url":"https://api.github.com/repos/Automattic/wp-calypso/issues/9433","repository_url":"https://api.github.com/repos/Automattic/wp-calypso","labels_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/9433/labels{/name}","comments_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/9433/comments","events_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/9433/events","html_url":"https://github.com/Automattic/wp-calypso/pull/9433","id":189747763,"number":9433,"title":"DevDocs / State: Add DevDocs screen for searching state selectors","user":{"login":"aduth","id":1779930,"avatar_url":"https://avatars.githubusercontent.com/u/1779930?v=3","gravatar_id":"","url":"https://api.github.com/users/aduth","html_url":"https://github.com/aduth","followers_url":"https://api.github.com/users/aduth/followers","following_url":"https://api.github.com/users/aduth/following{/other_user}","gists_url":"https://api.github.com/users/aduth/gists{/gist_id}","starred_url":"https://api.github.com/users/aduth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aduth/subscriptions","organizations_url":"https://api.github.com/users/aduth/orgs","repos_url":"https://api.github.com/users/aduth/repos","events_url":"https://api.github.com/users/aduth/events{/privacy}","received_events_url":"https://api.github.com/users/aduth/received_events","type":"User","site_admin":false},"labels":[{"id":285010033,"url":"https://api.github.com/repos/Automattic/wp-calypso/labels/DevDocs","name":"DevDocs","color":"006b75","default":false},{"id":360006704,"url":"https://api.github.com/repos/Automattic/wp-calypso/labels/State","name":"State","color":"006b75","default":false},{"id":285010018,"url":"https://api.github.com/repos/Automattic/wp-calypso/labels/[Status]%20Needs%20Review","name":"[Status] Needs Review","color":"fbca04","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-11-16T15:56:00Z","updated_at":"2016-11-16T15:56:07Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/9433","html_url":"https://github.com/Automattic/wp-calypso/pull/9433","diff_url":"https://github.com/Automattic/wp-calypso/pull/9433.diff","patch_url":"https://github.com/Automattic/wp-calypso/pull/9433.patch"},"body":"Related: #5954\r\n\r\nThis pull request seeks to add a new screen to the [DevDocs section](https://wpcalypso.wordpress.com/devdocs) to enable a developer to search for available selectors. Search is fuzzy, enabling generic searches like \"getSite\" to return the `getSelectedSite` selector, but in less precedence than the `getSite` selector.\r\n\r\nSearch View | Single View\r\n---|---\r\n![Search](https://cloud.githubusercontent.com/assets/1779930/20353862/29f87256-abea-11e6-9861-a795d72c97cc.png)|![Detail](https://cloud.githubusercontent.com/assets/1779930/20353866/2d213bb6-abea-11e6-8f0e-822881cb8c80.png)\r\n\r\n__Implementation Notes:__\r\n\r\nFuzzy searching uses [Fuse.js](http://fusejs.io). The DevDocs section already uses another similar library [Lunr.js](http://lunrjs.com) for full text search, though this library does not have great support for fuzzy searching, and it was important for me to support.\r\n\r\nThe selector parsing is cached, though not to the filesystem as in the case of document searching. Any request to any section of DevDocs will start \"priming\" the selector cache and this cache will be used for the remainder of the server process.\r\n\r\nIncluded are several examples of selectors that will be removed prior to merging. See #5954.\r\n\r\n__Testing Instructions:__\r\n\r\n1. Navigate to [DevDocs State Selectors](http://calypso.localhost:3000/devdocs/selectors)\r\n2. Note that all selectors from the `client/state/selectors` are visible with description\r\n3. Enter a search term\r\n4. Note that fuzzy results are shown in order of matching precedence\r\n5. Click a result\r\n6. Note that selector is shown with arguments are return type\r\n7. Click Back\r\n8. Note that you're returned to search results\r\n\r\n__Open Questions / Ideas:__\r\n\r\n- If we were to parse the file using a proper JavaScript parser, we could interpret arguments even for selectors without good JSDoc, though I argue it's better to encourage good documentation by using them as a prerequisite for arguments displaying\r\n- Search only applies to selector name and description, though we could also apply this to parameters or return types (e.g. search all selectors that accept `siteId` as a parameter)\r\n- What other [JSDoc tags](http://usejsdoc.org) would be useful to include aside from `@param` and `@return`? Another good option may be `@see` for external resources.\r\n\r\ncc @withinboredom "},"comment":{"url":"https://api.github.com/repos/Automattic/wp-calypso/issues/comments/260983492","html_url":"https://github.com/Automattic/wp-calypso/pull/9433#issuecomment-260983492","issue_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/9433","id":260983492,"user":{"login":"matticbot","id":18333116,"avatar_url":"https://avatars.githubusercontent.com/u/18333116?v=3","gravatar_id":"","url":"https://api.github.com/users/matticbot","html_url":"https://github.com/matticbot","followers_url":"https://api.github.com/users/matticbot/followers","following_url":"https://api.github.com/users/matticbot/following{/other_user}","gists_url":"https://api.github.com/users/matticbot/gists{/gist_id}","starred_url":"https://api.github.com/users/matticbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matticbot/subscriptions","organizations_url":"https://api.github.com/users/matticbot/orgs","repos_url":"https://api.github.com/users/matticbot/repos","events_url":"https://api.github.com/users/matticbot/events{/privacy}","received_events_url":"https://api.github.com/users/matticbot/received_events","type":"User","site_admin":false},"created_at":"2016-11-16T15:56:07Z","updated_at":"2016-11-16T15:56:07Z","body":"Test live: https://calypso.live/?branch=try/selector-search"}}
{"actor":{"display_login":"matticbot"}}