angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

Allow fully customization by tapping into build lifecycle through hooks; or create angular own build system

Open feng-xiao opened this issue 9 years ago • 4 comments

Bug Report or Feature Request (mark with an x)

- [ ] bug report -> please search issues before submitting
- [x] feature request

I'm working on an Angular template for the company I work for. I used AngularClass angular 2 starter template to make the customization, I want to create the template as easy as possible to any non-angular background developers. To be able to achieve that, I need to do typescript code generation in my own webpack loader. Unfortunately, the webpack has performance issues (takes 100 seconds to build a very small app - under 15 pages). I spent days efforts to figure what caused it, it turned out it's webpack build system's problem, I submitted the issue to webpack a month ago, nobody really act on it...

Now, Angular is facing competition from React, Vue, etc. I wish Angular can create a whole eco-system that doesn't rely on other open-source projects. I'm tiring spent days figuring out what breaks my application, at the end they're all caused by other open-source repo. The current approach that relies on many npm packages also increase the application source file size a lot. In my case, it's at least 200MB on node_modules folder...

Versions.

Repro steps.

None

The log given by the failure.

None

Desired functionality.

Mention any other details that might be useful.

feng-xiao avatar Apr 20 '17 15:04 feng-xiao

@feng-xiao, I would disagree in saying that Angular is facing competition from other frameworks. Angular, React, Vue, you name it, are all frameworks trying to accomplish a common goal, make the web a better place. If tomorrow another framework comes out that sweeps the world in web development, I can bet you every framework will look at the good parts of the new framework and try it's best to incorporate them, much like how the three frameworks listed do currently.

Your dream is large and also vague. To ask for an entire ecosystem that doesn't not rely on other open source projects is quite a lofty goal. Where does one draw the line? Webpack, TypeScript, TSLint, Protractor, Karma, Jasmine... All open source and all used by this project.

Now, that said, the team is working on the design where one can plug in to various aspects of the CLI. Don't like Jasmine? Try the Jest plug in or the Mocha plug in. Don't like Webpack? Try the gulp plugin. I hope you get the picture.

The team is looking at issues like this and using it to help scope and plan what's next for the CLI / SDK. If you would like to see something be considered, opening issues with a design doc and examples of usage will go a long way to making those ideas happen.

delasteve avatar Apr 20 '17 16:04 delasteve

@delasteve , thanks for you quick reply. I'm excited about what you said about plugin system the team is working on.

No offence about what I said 'competitions' from other frameworks. I just had really bad experiences with Webpack when I tried to work on the application template. I used Gulp task system to create application template for AngularJS before, it was much easier to do what I wanted to do, I had full control on the build process. Then when I worked on the new application template for Angular 2 in this January, I spent weeks time trying to figure out how to tap into the build system to do the customization/code generation I want... I'm so frustrated. I also found there's performance issue with Webpack for what i'm doing (adding 'import' dynamically to TypeScript code, see #4582)

I really hope the plugin system the team is working on allow me to tap into the build system (e.g. a event hook knowing what files are modifying, so I can modify the content, etc.), no performance issues on dynamically adding import (code gen), and easier to add third party libraries.

feng-xiao avatar Apr 21 '17 16:04 feng-xiao

Closing as answered by @delasteve. I don't have anything to add though, but can confirm we're looking at the addon/hooks system.

filipesilva avatar May 03 '17 11:05 filipesilva

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.