{"action":"opened","issue":{"url":"https://api.github.com/repos/aurelia/documentation/issues/82","labels_url":"https://api.github.com/repos/aurelia/documentation/issues/82/labels{/name}","comments_url":"https://api.github.com/repos/aurelia/documentation/issues/82/comments","events_url":"https://api.github.com/repos/aurelia/documentation/issues/82/events","html_url":"https://github.com/aurelia/documentation/issues/82","id":73675125,"number":82,"title":"Build Process Improvements","user":{"login":"EisenbergEffect","id":131485,"avatar_url":"https://avatars.githubusercontent.com/u/131485?v=3","gravatar_id":"","url":"https://api.github.com/users/EisenbergEffect","html_url":"https://github.com/EisenbergEffect","followers_url":"https://api.github.com/users/EisenbergEffect/followers","following_url":"https://api.github.com/users/EisenbergEffect/following{/other_user}","gists_url":"https://api.github.com/users/EisenbergEffect/gists{/gist_id}","starred_url":"https://api.github.com/users/EisenbergEffect/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EisenbergEffect/subscriptions","organizations_url":"https://api.github.com/users/EisenbergEffect/orgs","repos_url":"https://api.github.com/users/EisenbergEffect/repos","events_url":"https://api.github.com/users/EisenbergEffect/events{/privacy}","received_events_url":"https://api.github.com/users/EisenbergEffect/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/aurelia/documentation/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-05-06T16:45:55Z","updated_at":"2015-05-06T16:45:55Z","closed_at":null,"body":"I've been thinking that we might be able to improve the build process of Aurelia around a few scenarios that have recently come up. Here's what I am proposing:\r\n\r\n* Every repository should contain the following src files\r\n    * imports.js - contains all the ES6 import statements for the library\r\n    * exports.js - contains all the ES6 export statements for the library.\r\n    * classes - one file per ES6 class. No imports or exports. Decorated with Flow types.\r\n    * interfaces.js - contains any TypeScript interfaces needed to define \"shapes\" which are not defined as classes in our ES6 API\r\n* The build process will concatenate all these files into a single index.js with the imports at the top, the classes/interfaces in the middle and the exports at the bottom.\r\n* The build process will use Babel to compile the index.js file, which will strip the Flow types and interface definitions and generate all our supported module formats.\r\n* The build process will use the Babel compiler with a d.ts plugin to generate a single d.ts file for the library, based on the Flow types and interfaces.\r\n* The build process will copy the generate d.ts file into each module format folder so that it can be distributed with our source via standard package managers.\r\n\r\nHere's what I think we can get from this:\r\n\r\n* A single file for each Aurelia library will result in less http requests during debug scenarios, making the development experience smoother.\r\n* A single file will reduce the amount of library code that the Babel compiler generates. Instead of it having to generate it for each class file (today), it only generates the helpers once per library. This makes Aurelia smaller.\r\n* A single file will reduce the amount of runtime module lookup required by the ES6 loader. Thus startup should be faster.\r\n* The flow types and plugin will allow us to get a solid d.ts file for each library and always keep it in sync with every release version.\r\n* We preserve the flexibility of leveraging the Babel compiler.\r\n* We **might** be able to also compile with the TS compiler directly.\r\n\r\n"}}