-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ahead of time (AOT) compilation support #885
Comments
I agree, we should use AOT compilation now that it's available in Angular2! |
+1 |
there's still a lot of bugs and peculiarities in aot that would break most people's app...so this doesn't need to be added immediately |
At least we can get a writeup explaining how to do it individually, so we can work the kinks out ourselves. |
The details could be found here: http://blog.mgechev.com/2016/08/14/ahead-of-time-compilation-angular-offline-precompilation/ Just wondering how to do that with webpack, maybe another loader? |
+1 |
I was finally able to get AOT running fine with Webpack 2, you guys can check it here: https://github.com/qdouble/angular2webpack2-starter . There is a known issue with lazy routes when using AOT though, hopefully they patch it soon angular/angular#11075 |
@qdouble I downloaded your repo and got it to compile, excellent!. Only problem is, it doesn't work with any
|
@IAMtheIAM that's an AOT limitation. You can't use require on your styles or templates with offline compile. It should work fine with JIT. For your html and styles, use templateUrl and stylesUrls... they will be bundled properly because the starter is using the angular2-template-loader. |
I've updated my starter project to fully support lazy loading in AOT mode. I have to wait until there are some more updates/bug fixes before making it a bit cleaner, but it's a viable solution for now: |
+1 |
@qdouble any updates on this ? |
@kodeine uh, my angular repo has grown and is working very well, but I'm not trying to say anything negative about this repo... my link is here: https://github.com/qdouble/angular2webpack2-starter address any issues there. |
+1. AOT very important to increase speed for first start. |
@qdouble I think, you should make more production-ready config for webpack. I mean splitting different environments ti dedicated files. Now your webpack config is unsupportable and not ready to be usen in production. |
@vadimzham I disagree, it's a matter of preference I suppose. |
@qdouble Dedication configs on production/staging/development environments it's not just preference. It's necessity. |
@vadimzham that's really just your opinion. There's no major difference between a production and development config that can't be solved with pushing in a few extra plugins or changing some settings based on variables. It's a design choice. |
It would be great if we can incorporate tree shaking into the prod AOT build process as well. https://angular.io/docs/ts/latest/cookbook/aot-compiler.html#!#tree-shaking |
@vadimzham We are already using the webpack starter of @qdouble in production. Have a look at this sexy & fast website :-) https://secrets.schmid.digital It uses AoT and is ultra fast. The website is now about 4-5x faster than before! Thanks again to @qdouble . He does awesome work! :) Check out this webpack starter, if you can't wait longer to use AoT! |
@smith64fx yea, i have to use AOT on our website too. But looks like i will use angular-cli to do it. Also now i have problems with with several packages of AOT support. So, i have to wait several days(or fix it by myself). |
@vadimzham Yes not every package supports AoT yet. What i still don't really understand about Angular-cli: Is it a replacement or an extension for webpack? And in the future, what is the way to go? btw the webpackstarter from @qdouble also uses angular-cli for AoT: From the package.json file:
|
@smith64fx angular-cli is webpack-based tool that help you to start clear project. It will have much less code than any of |
It seems there is no plan to support AOT in this repo based on the previous comments, is that true? |
@itrethan 🎱 No, it is definitely something to support. I hope to do something on that frontier soon. |
As far as I could do some testing, the best option so far is @ngtools/webpack. I could make it work without too much effort, and especially without impacting my existing configuration. |
@katallaxie Thanks, are you going to merge this with master or just leave the aot part in a separate branch? |
@itrethan we will bring it to master, hopefully with ts and dll. |
@jskrzypek looks promising, try it? :) |
Agree with @qdouble here. As it stands right now, I'm loving AoT but I have implemented it professionally in a similar fashion to Anthony, separate tasks executed explicitly. @ngtools/webpack has some outstanding issues that are blocking it's usefulness. Small implementation details aside, the only really viable way to get AoT working in a meaningful way would be the route @qdouble took. Kind of wish I would have seen his starter prior to doing all that work myself :/ as we ended up in a similar place. If the intent is to get AoT into this starter sooner rather than later, qdouble/angular-webpack2-starter would be the path forward. That said, there are some pretty significant challenges with AoT once you grow your application to anything of production size. If we are going to land AoT now, everyone should be ready for the onslaught of questions and issues when people try to pull in AoT enabled #master and their builds explode ( been there ... lol ). Also worth noting, if we are going to release AoT support we definitely need to test the AoT builds for PRs or we are going to be breaking master every other day ( been there too ). |
@katallaxie @d3viant0ne angular/angular-cli#3583 and angular/angular-cli#2584 is fixed as well, so I guess v6 should be more or less ready now? |
Any updates? This is a must have feature, any serious production app needs to have AOT enabled. People will be moving to other starters if this is missing. |
I've got it working perfectly. Will submit a PR very soon. |
* feature: added AOT compile support (#885) * updated travis.yml with new ci script * removed yarn.lock from .gitignore * (optimize) vendor tree shaking and bundle analysis tool * (fix) support node 5 * upgraded to webpack 2.2.0-rc-2, removed analyzer
@colinskow @d3viant0ne From what I see no /: Let me know if you don't I have a solution I'm running with. |
Currently we don't support SCSS. There is s solution in #1304. |
@colinskow That's not only for SCSS, that's for all resource. CSS, LESS, SCSS or whatever, they don't go through the loader chain. Development output might not be the same as AOT. I will post a PR soon with suggestion. |
Is there any issue for that V6 branch? While AOT is a nice step forwards, this starter is still obsolete without DLLs and other stuff. @katallaxie @gdi2290 @d3viant0ne ? |
@fxck - Obsolete without a development experience only improvement? How about you open a pull request for whatever |
@d3viant0ne say what, I'm not sure what the earlier version of that comment was, but I've long since had to move to @qdouble's starter, so I doubt I was threatening I was gonna go anywhere. I've been advocating this starter over others for a long time and was closely following the V6 branch(which was blocked by ngtools issues at the time) which I found superior to what I'm using(as it's based on what I'm using). As soon as all the issues I knew about were resolved, I tried getting a status update on it, didn't get any answer and instead this issue, which was the only issue V6 was discussed at, as far as I know anyway, was closed, which was what prompted my last comment, asking for whether there was, or was going to be another issue created for the V6 branch. I didn't get any reply, which is why I wrote this. So how about you cut me a slack, I didn't mean anything offensive in the slightest sense, I'm all up for helping finish that branch but without ever getting an answer about your plans going forward, it's kind of hard. ..and yes, what is currently on master is indeed obsolete, especially at the time I wrote that comment, compared to your V6 branch. At DLLs and the way and the language configs are written in, for example. And I have no idea why should I be sending PRs while you already have a a branch with all the |
@fxck You are 1 of many, you want DLL, thats cool... |
Guys calm down, he just was asking where he could find a status update for v6. People are WAY too quick to get dramatic. |
@shlomiassaf cutting development build time in half with no other side effects is good for everyone. |
@shlomiassaf geez, DLLs are not even the point. The point was that there is a branch of THIS repo that already has both AOT and DLLs, is utilising @ngtools/webpack, is written a way more modern way, with all the configs being typesafe and written in typescript and all the while @AngularClass team members and collaborators are being completely oblivious to the fact. I honestly couldn't care less, as I had to move to qdouble's starter couple of months ago because I simply couldn't proceed without AOT, but it seems like a wasted chance, time and effort to abandon that branch, unless there are reasons for it, which is what I kept asking for. |
import { where, find, keys } from 'lodash'; should work just fine, you might need |
@fxck it looks nice but the checker in my terminal keep saying
and thus I cannot run |
Have you installed |
Oh thank you very much, it works just fine now @fxck !! |
@fxck There is a branch with those but the fact that we waited led to better implementation :) The current setup with AOT is better then Patience :) |
not working: component level LESS files images hash in *.html, template or templateUrl see app.component.ts, home.component.html and home.component.css
* feature: added AOT compile support (PatrickJS#885) * updated travis.yml with new ci script * removed yarn.lock from .gitignore * (optimize) vendor tree shaking and bundle analysis tool * (fix) support node 5 * upgraded to webpack 2.2.0-rc-2, removed analyzer
Note: for support questions, please use one of these channels: Chat: AngularClass.slack or Twitter: @AngularClass
[ ] bug report
[x ] feature request
[ ] question about the decisions made in the repository
Request a feature, AOT support in webpack
JIT compile, performance is bad in prod.
Performance boost
The text was updated successfully, but these errors were encountered: