angulardart / angular

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

webdev dartdevc build of angular code is broken with SDK 2.8.0-dev.14.0, requires incompatible protobuf version #1884

Closed whesse closed 4 years ago

whesse commented 4 years ago

Dart SDK Version 2.8.0-dev.16.0. (working with -dev.10.0, not with -dev.14.0) AngularDart Version 6.0.0-alpha+1 Linux

webdev uses bazel_worker to build the dartdevc (non-release) versions of Dart web apps, including angular. The intellij Dart plugin uses webdev serve to build and run in the IDE.

Bazel_worker 0.1.21 has a bug which causes failures on the latest SDKs, which is fixed in 0.1.23+1 All versions of bazel_worker after 0.1.22 require protobuf 0.14.4 (latest version is 1.0.1). But the most recent published version of Angular Dart is broken with protobuf 0.14.4, (it works with 0.13.16+1). So there is no combination of versions of angular, bazel_worker, and protobuf that will work with the current dev versions of the Dart SDK. The SDK changes are intended, so they will be in the next stable version.

It seems like the right solution to this is to publish an updated version of Dart Angular, that works with protobuf 0.14.4 or later. An alternative might be to fork bazel_worker to backport the fix in 0.1.23+1 to version 0.1.21. https://github.com/dart-lang/webdev/issues/936

whesse commented 4 years ago

The first failure of the angular framework compilation due to the newer protobuf looks like

[SEVERE]build_web_compilers:ddc on package:angular_components/material_datepicker/proto/date_range.pb.ddc.module: Error compiling dartdevc module:angular_components|lib/material_datepicker/proto/date_range.pb.ddc.js

packages/angular_components/material_datepicker/proto/date_range.pb.dart:46:19: Error: Too many positional arguments: 3 allowed, but 5 found.
Try removing the extra positional arguments.
    ..a<DateRange>(1, 'dateRange', $pb.PbFieldType.OM, DateRange.getDefault,
natebosch commented 4 years ago

I have published bazel_worker at 0.1.21+1 which should be compatible with these dependencies and work on the latest SDK. Can you please try a pub upgrade and let me know if you are unblocked?

whesse commented 4 years ago

Yes, upgrading to bazel_worker 0.1.21+1 makes dartdevc builds of angular using build-runner work again. This is the non-release build that intellij runs if you build from within the IDE, and now it is working again. Thanks!