After the upgrade to the 4.0.0-alpha+1 from 4.0.0-alpha, the compilation time increased in my project. It took 28 seconds on 4.0.0-alpha+1 and higher. On 4.0.0-alpha it take ~1 second.
After "pub serve" I waiting message "Build completed successfully". Then press Ctrl+S, without any changes. Next compilation message appear after long delay.
I use Visual Studio Code + Dart Core plugin.
dependencies:
angular: "4.0.0-alpha"
angular_components: "0.6.0-alpha"
# angular_forms: "^0.1.0"
# angular_router: "^1.0.0"
http: ^0.11.3+14
uuid: ^0.5.3
stream_transformers: ^0.3.0
dev_dependencies:
browser: "^0.10.0+2"
dart_to_js_script_rewriter: ^1.0.3
transformers:
- angular:
entry_points:
- web/main.dart
- web_test/main.dart
- $dart2js:
commandLineOptions: [--show-package-warnings]
- dart_to_js_script_rewriter
Have you tried the latest final release?
I tried to update version 4.0.0. Compilation time dramatically increased.
I checked versions:
I did another experiment. I created two new projects by "stagehand" (web-angular).
I changed dependencies and compile them.
project1:
dependencies:
angular: ^4.0.0
angular_components: ^0.6.0
angular_forms: ^1.0.0
angular_router: ^1.0.0
project2:
dependencies:
angular: 4.0.0-alpha
angular_components: 0.6.0-alpha
Run both projects on different ports.
pub serve --port 8081
pub serve --port 8082
Save app_component file and compare compilation time project1 and project2. Thereis a lag in firsth project.
I checked this on two different computers.
Can you reproduce it?
I have the same issue, occured after upgrading to angular 4.0.0-beta, and then 4.0.0.
/cc @natebosch @jakemac53
Anything obvious?
Nothing comes to mind.
With something this significant that we don't see with bazel my focus would be any changes in the compiler that make it read different assets from before, or changes the order in which it reads assets.
I can try and bisect this with @alorenzen next week. Thanks Nate.
Here are the changes between 4.0.0-alpha and 4.0.0-alpha+1:
https://github.com/dart-lang/angular/compare/4.0.0-alpha...4.0.0-alpha+1
Notable:
https://github.com/dart-lang/angular/commit/33dccb9b6e886f587d0664df02afbb2dcf3d1c0e,
Flipped usePlaceholder to true for _barback_; this generates slightly more code, and potentially could be spawning more isolates in Barback or doing something else naughty.
Here is the mainline commit:
https://github.com/dart-lang/angular/tree/073e72870d30baee95b5cefbdef8edcca7370269
⏰ ⚠️ 🔥
@natebosch here is the suspect code:
Specifically, >= 4.0.0-alpha+1, we now do:
return await buildStep.canRead(new AssetId.resolve(placeholder, from: buildStep.inputId));
Any advice?
Hmm I think in barback land if that asset doesn't exist its going to wait until all other transformers that could potentially output that file are done before continuing, which is potentially the issue?
Is there anyway to force it/i.e. don't wait? Otherwise we need to think of
a new short-term strategy to fix the check - perhaps give a flag to assume
certain packages have generated Angular code.
On Mon, Sep 11, 2017, 8:17 AM Jacob MacDonald notifications@github.com
wrote:
Hmm I think in barback land if that asset doesn't exist its going to wait
until all other transformers that could potentially output that file are
done before continuing, which is potentially the issue?—
You are receiving this because you were assigned.Reply to this email directly, view it on GitHub
https://github.com/dart-lang/angular/issues/594#issuecomment-328562474,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAKQ7trrdswQQ5-2wlsLOJhu6WZJ_v-oks5shU8EgaJpZM4PCs-n
.
Nope, no way to force it. We should confirm this is the slow part as well (its just a hunch for now). Can you put some logging around that line?
Confirmed this is the source of the slowdown locally.
I have a _potential_ fix @ https://github.com/dart-lang/angular/pull/624, if someone is able to try patching and using it will give me more confidence this is an approach to fix the problem. I'll have to think about how to land this/patch 4.x though.
@matanlurey I tried your patch. But nothing changed. Project compiling take about 30 seconds.
@Cododoc did you make sure to use the patched angular_compiler as well? I didn't see an improvement as well.
Trying another approach, should have something to try relatively soon.
+1
@matanlurey could exclude / include settings in the pubspec.yaml already help? We currently have the problem that #513 appears with MaterialCheckboxComponent and we can't move to 4.0 due to refresh cycles. Any further progress on this issue?
OK, I have an update! I landed a new alpha release of the angular_compiler that _might_ help:
https://pub.dartlang.org/packages/angular_compiler/versions/0.4.0-alpha#pub-pkg-tab-changelog
If you are brave:
dependencies:
angular_compiler: '>=0.3.0 <0.5.0'
It basically assumes that all .dart files your in package that runs that AngularDart transformer will have a corresponding .template.dart file ultimately generated. This is native, but should work unless you are tricky with $include and $exclude (most are not).
If anyone has a change to pub upgrade with this new range, please let me know if it helps!
/cc @nshahan @kevmoo too!
Oops, another change was required. PTAL: https://github.com/dart-lang/angular/pull/666.
I don't know does this issue relate to my problem or not, but I have strange behaviour - project builds with "mode=debug", but in release it...probably never ends (waited ~5 minutes):
➢ pub build --mode=debug
Loading source assets...
Loading dacsslide, csslib_transform, angular, angular/transform/reflection_remover, test/pub_serve and dart_to_js_script_rewriter transformers...
Building slides_gcpstore... (6.1s)
[Info from Dart2JS]:
Compiling slides_gcpstore|web/main.dart...
[Info from Dart2JS]:
Took 0:00:11.201314 to compile slides_gcpstore|web/main.dart.
Built 3147 files to "build".
➢ pub build --mode=release
Loading source assets...
Loading angular, dacsslide, csslib_transform, dart_to_js_script_rewriter and test/pub_serve transformers...
Loading angular/transform/reflection_remover transformers... (37.4s)
Building slides_gcpstore... (4:29.1s)
I am using Dart 2.0.0-dev.3.0 and
|-- angular 4.0.0
| |-- angular_compiler 0.3.0
Hi @olostan: We found out using angular/transform/** instead of the default angular transformer causes deadlocks (and doesn't help your application in any way). Consider just simplifying - should fix that problem:
transformers:
- angular:
entry_points: web/main.dart
@matanlurey thnx! Removing
- angular/transform/reflection_remover:
$include: test/**_test.dart
solved the issue
Are there any status updates on this issue?
Hey, @afpatmin
Our work to improve the build times maps to this work: https://github.com/dart-lang/build/milestone/11
We already have the end-to-end working. We're focusing on big performance wins now.
Thanks for your patience!
I've decided to remove the "PRIORITY" flag, not that it isn't very important to us, but we aren't going to be able to deliver a fix immediately - and "PRIORITY" is limited to stuff we are immediately focusing on. Like @kevmoo mentioned though we are working on a slightly longer-term permanent fix!
@matanlurey Now that we use build_runner instead of transformers, can we go ahead and close this issue?
I want to wait until we have our own documentation on using these tools on
the angular site, even if it is only on staging.
On Fri, Jan 26, 2018, 12:03 PM Andrew Lorenzen notifications@github.com
wrote:
@matanlurey https://github.com/matanlurey Now that we use build_runner
instead of transformers, can we go ahead and close this issue?—
You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub
https://github.com/dart-lang/angular/issues/594#issuecomment-360890228,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAKQ7qPjjCyEVhWRg3JB2lHzcVabHxEHks5tOi-IgaJpZM4PCs-n
.
Most helpful comment
Hey, @afpatmin
Our work to improve the build times maps to this work: https://github.com/dart-lang/build/milestone/11
We already have the end-to-end working. We're focusing on big performance wins now.
Thanks for your patience!