{"action":"created","issue":{"url":"https://api.github.com/repos/babel/babel/issues/3281","labels_url":"https://api.github.com/repos/babel/babel/issues/3281/labels{/name}","comments_url":"https://api.github.com/repos/babel/babel/issues/3281/comments","events_url":"https://api.github.com/repos/babel/babel/issues/3281/events","html_url":"https://github.com/babel/babel/pull/3281","id":127366420,"number":3281,"title":"[RFC] Pass per preset","user":{"login":"DmitrySoshnikov","id":244010,"avatar_url":"https://avatars.githubusercontent.com/u/244010?v=3","gravatar_id":"","url":"https://api.github.com/users/DmitrySoshnikov","html_url":"https://github.com/DmitrySoshnikov","followers_url":"https://api.github.com/users/DmitrySoshnikov/followers","following_url":"https://api.github.com/users/DmitrySoshnikov/following{/other_user}","gists_url":"https://api.github.com/users/DmitrySoshnikov/gists{/gist_id}","starred_url":"https://api.github.com/users/DmitrySoshnikov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DmitrySoshnikov/subscriptions","organizations_url":"https://api.github.com/users/DmitrySoshnikov/orgs","repos_url":"https://api.github.com/users/DmitrySoshnikov/repos","events_url":"https://api.github.com/users/DmitrySoshnikov/events{/privacy}","received_events_url":"https://api.github.com/users/DmitrySoshnikov/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2016-01-19T05:03:07Z","updated_at":"2016-01-19T18:18:14Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/babel/babel/pulls/3281","html_url":"https://github.com/babel/babel/pull/3281","diff_url":"https://github.com/babel/babel/pull/3281.diff","patch_url":"https://github.com/babel/babel/pull/3281.patch"},"body":"#### Rationale\r\n\r\nSee discussion and the issue description in [#6730: Plugins order is not respected](https://phabricator.babeljs.io/T6730).\r\n\r\nThis introduces \"pass per preset\" feature, spawting a new traversal for each preset in case if the `passPerPreset` is `true` (default is `false`).\r\n\r\nThis gives opportunity to define \"before\" and \"after\" presets, mimicking a similar feature from Babel 5. A rationally for this is to make plugins as short as possible, and handle only needed nodes, not dealing with \"unrelated\" node in order to avoid potential collisions in case if presets are merged.\r\n\r\n#### RFC: design notes\r\n\r\nCurrently I handle only `plugins` in presets. Are there actual practical use case when a preset may define its own options, other than `plugins`? The options per preset are inherited from main options, overriding needed fields, such as `plugins`.\r\n\r\n#### Test plan\r\n\r\n`make test`. Will add more tests \"per preset\" after main review."},"comment":{"url":"https://api.github.com/repos/babel/babel/issues/comments/172939378","html_url":"https://github.com/babel/babel/pull/3281#issuecomment-172939378","issue_url":"https://api.github.com/repos/babel/babel/issues/3281","id":172939378,"user":{"login":"hzoo","id":588473,"avatar_url":"https://avatars.githubusercontent.com/u/588473?v=3","gravatar_id":"","url":"https://api.github.com/users/hzoo","html_url":"https://github.com/hzoo","followers_url":"https://api.github.com/users/hzoo/followers","following_url":"https://api.github.com/users/hzoo/following{/other_user}","gists_url":"https://api.github.com/users/hzoo/gists{/gist_id}","starred_url":"https://api.github.com/users/hzoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hzoo/subscriptions","organizations_url":"https://api.github.com/users/hzoo/orgs","repos_url":"https://api.github.com/users/hzoo/repos","events_url":"https://api.github.com/users/hzoo/events{/privacy}","received_events_url":"https://api.github.com/users/hzoo/received_events","type":"User","site_admin":false},"created_at":"2016-01-19T18:18:14Z","updated_at":"2016-01-19T18:18:14Z","body":"Re: Preset options/more global options could be useful but I think @kittens didn't want to make presets that complicated?\r\nhttps://phabricator.babeljs.io/T2756 - An example though would be specifying loose mode for all plugins instead of doing it for each one."}}