{"action":"created","issue":{"url":"https://api.github.com/repos/joliss/node-walk-sync/issues/5","labels_url":"https://api.github.com/repos/joliss/node-walk-sync/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/joliss/node-walk-sync/issues/5/comments","events_url":"https://api.github.com/repos/joliss/node-walk-sync/issues/5/events","html_url":"https://github.com/joliss/node-walk-sync/pull/5","id":99747139,"number":5,"title":"Optionally accept an array of matchers","user":{"login":"stefanpenner","id":1377,"avatar_url":"https://avatars.githubusercontent.com/u/1377?v=3","gravatar_id":"","url":"https://api.github.com/users/stefanpenner","html_url":"https://github.com/stefanpenner","followers_url":"https://api.github.com/users/stefanpenner/followers","following_url":"https://api.github.com/users/stefanpenner/following{/other_user}","gists_url":"https://api.github.com/users/stefanpenner/gists{/gist_id}","starred_url":"https://api.github.com/users/stefanpenner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stefanpenner/subscriptions","organizations_url":"https://api.github.com/users/stefanpenner/orgs","repos_url":"https://api.github.com/users/stefanpenner/repos","events_url":"https://api.github.com/users/stefanpenner/events{/privacy}","received_events_url":"https://api.github.com/users/stefanpenner/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-08-07T23:27:59Z","updated_at":"2015-08-26T14:53:54Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/joliss/node-walk-sync/pulls/5","html_url":"https://github.com/joliss/node-walk-sync/pull/5","diff_url":"https://github.com/joliss/node-walk-sync/pull/5.diff","patch_url":"https://github.com/joliss/node-walk-sync/pull/5.patch"},"body":"@joliss I don't really expect you to merge this one, as the resulting complexity is pretty shitty.\r\n\r\nIt is primarily intended as quickfix for: https://github.com/ember-cli/ember-cli/issues/4460\r\nreducing the funnel cost from 800ms (on SSD) to just \"noise\",\r\n\r\n### Why not just use glob:\r\n\r\n* Higher level APIs we offer currently support multiple includes, thereby requiring multiple patterns to glob against.\r\n* maybe future iterations of those API's should consider not doing this.\r\n\r\n\r\nLet me explain why this provides value, maybe some future solution can better address this.\r\n\r\nTL;DR sometimes Funnels are used, to funnel from potentially massive directory trees. This PR hedges the bet, that the include globs are sufficiently conservative. Essentially prunning unwanted traversals for us.\r\n\r\n### Why are large directory structures commonly funneled?\r\n\r\ndir structures such as, are fairly common:\r\n\r\n```\r\nfile-to-funnel.js\r\na-dir-to-funnel/**/*..\r\nnode_modules/**/* <--- potentially massive\r\n```\r\n\r\na developer may realize this, and improve specificity, ultimately enabling `Funnel` to invoke walkSync with more details.\r\n\r\n```\r\nwalkSync('root', undefined, ['file-to-funnel.js', 'a-dir-to-funnel/**/*'])\r\n```\r\n\r\nsome notable things:\r\n\r\n* although more CPU, in many cases this allow us to skip walking potentially expensive dirs\r\n* the CPU is likely going to be spent shortly afterwards filtering out the resulting file list anyways (mitigating the above concern)\r\n* costs us nothing if not used\r\n* unfortunately much extra code-complexity and some lolcode.\r\n\r\n## caveats\r\n\r\n* likely has bugs, especially with the incremental pattern matching\r\n* If we hit bugs, the tests are good so fixes should be easyish"},"comment":{"url":"https://api.github.com/repos/joliss/node-walk-sync/issues/comments/135048875","html_url":"https://github.com/joliss/node-walk-sync/pull/5#issuecomment-135048875","issue_url":"https://api.github.com/repos/joliss/node-walk-sync/issues/5","id":135048875,"user":{"login":"joliss","id":524783,"avatar_url":"https://avatars.githubusercontent.com/u/524783?v=3","gravatar_id":"","url":"https://api.github.com/users/joliss","html_url":"https://github.com/joliss","followers_url":"https://api.github.com/users/joliss/followers","following_url":"https://api.github.com/users/joliss/following{/other_user}","gists_url":"https://api.github.com/users/joliss/gists{/gist_id}","starred_url":"https://api.github.com/users/joliss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joliss/subscriptions","organizations_url":"https://api.github.com/users/joliss/orgs","repos_url":"https://api.github.com/users/joliss/repos","events_url":"https://api.github.com/users/joliss/events{/privacy}","received_events_url":"https://api.github.com/users/joliss/received_events","type":"User","site_admin":false},"created_at":"2015-08-26T14:53:53Z","updated_at":"2015-08-26T14:53:53Z","body":"I'm almost wondering if we should just make the API be \"an array of minimatch instances\" and not accept globs, since it seems like we won't be using globs anyway, and minimatch has a bunch of options (with not terribly reasonable defaults). But I'll let you choose.\r\n\r\nIt looks good otherwise. Let me know when you repush and I'll merge & release."}}