angulardart / angular

Fast and productive web framework provided by Dart
https://pub.dev/packages/angular
MIT License
1.83k stars 232 forks source link

pub build --mode=release never completes #626

Closed mjeffw closed 7 years ago

mjeffw commented 7 years ago

Running "pub build --mode=debug" completes as expected.

Running "pub build --mode=release" never completes.

Turning on --verbosity=all shows the following messages being repeated over and over:

FINE: [Fine from BuilderTransformer: Instance of 'LibraryBuilder' on angular_forms|primary]:
| Not yet complete after 16:26.0s
FINE: [Fine from BuilderTransformer: Instance of 'TemplatePlaceholderBuilder' on angular_test|primary]:
| Not yet complete after 16:7.0s, waiting on input(s) angular_router|lib/angular_router.dart, angular_router|lib/testing.dart
FINE: [Fine from BuilderTransformer: Instance of 'TemplatePlaceholderBuilder' on angular_components|primary]:
| Not yet complete after 16:7.0s, waiting on input(s) angular_forms|lib/angular_forms.dart
FINE: [Fine from BuilderTransformer: Instance of 'TemplatePlaceholderBuilder' on ng_materialdesign_sandbox|primary]:
| Not yet complete after 16:7.0s, waiting on input(s) angular_components|lib/angular_components.dart
FINE: [Fine from BuilderTransformer: Instance of 'TemplatePlaceholderBuilder' on angular_router|primary]:
| Not yet complete after 16:26.0s, waiting on input(s) angular|lib/angular.dart, angular|lib/src/core/linker/component_resolver.dart
FINE: [Fine from BuilderTransformer: Instance of 'TemplatePlaceholderBuilder' on angular_forms|primary]:
| Not yet complete after 16:26.0s, waiting on input(s) angular|lib/angular.dart, angular|lib/src/facade/lang.dart

Here is a copy of my pubspec.yaml:

name: ng_materialdesign_sandbox
description: A web app that uses AngularDart Components
version: 0.0.1
#homepage: https://www.example.com
#author: jeff <email@example.com>

environment:
  sdk: '>=1.23.0 <2.0.0'

dependencies:
  angular: ^4.0.0
  angular_components: ^0.6.0
  gurps_incantation_magic_model:
      path: ../gurps-incantation-magic-dart

dev_dependencies:
  angular_test: ^1.0.0-beta+2
  browser: ^0.10.0
  dart_to_js_script_rewriter: ^1.0.1
  test: ^0.12.0

transformers:
- angular:
    entry_points: web/main.dart
- angular/transform/reflection_remover:
    $include: test/**_test.dart
- test/pub_serve:
    $include: test/**_test.dart
- dart_to_js_script_rewriter
matanlurey commented 7 years ago

Hi @mjeffw thanks for filing.

I'm currently tackling some build-related issues as part of https://github.com/dart-lang/angular/issues/594, but until then I have the following suggestions:

You can simply just rely on the angular transformer, and include it as an entry point:

transformers:
  - angular:
      entry_points:
        - web/main.dart
        - test/**_test.dart

If this works for you, please let me know. tl;dr, having multiple different transformer names in pub seems to use a lot of memory/CPU time, and it's not something AngularDart has the ability to fix.

/cc @chalin @kwalrath if we should document this further.

kwalrath commented 7 years ago

I think we should. dart-lang/site-webdev#658

mjeffw commented 7 years ago

Taking out angular/transform/reflection_remover worked, thank you!

AlexanderJohr commented 6 years ago

For me that didn't work.

I also described this in #674

I had a lot of dart files in my "web" directory, also components for angular. Pub build hang until I moved most of the dart files into "lib."

After the build was running again , pub showed me errors again. Dartson was another cause of problems (It's seems not to be maintained anymore) so I'm trying to use built_value package now.