angulardart / angular_components

The official Material Design components for AngularDart. Used at Google in production apps.
https://pub.dev/packages/angular_components
372 stars 123 forks source link

Support protobuf dependency ^0.13.0 #399

Closed dougreese closed 5 years ago

dougreese commented 5 years ago

I need a change released in protobuf 0.13.3. I'm using a dependency override to get past the specified 0.10.4 protobuf dependency (using protobuf: ^0.13.4). However, this results in material_datepicker build errors. It looks like the problem is related to a protobuf 0.11.0 breaking change.

Build errors:

[SEVERE] build_web_compilers|entrypoint on web/main.dart (cached):

AssetNotFoundException: angular_components|lib/material_datepicker/proto/date.pb.ddc.js
[SEVERE] build_web_compilers|ddc on package:angular_components/material_datepicker/proto/date.pb.dartdevc.module (cached):
Error compiling dartdevc module:angular_components|lib/material_datepicker/proto/date.pb.ddc.js

[error] Missing concrete implementation of GeneratedMessage.createEmptyInstance. (package:angular_components/material_datepicker/proto/date.pb.dart, line 12, col 7)

Please fix all errors before compiling (warnings are okay).
}

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

[error] Missing concrete implementation of GeneratedMessage.createEmptyInstance. (package:angular_components/material_datepicker/proto/date_range.pb.dart, line 14, col 7)
[error] Missing concrete implementation of GeneratedMessage.createEmptyInstance. (package:angular_components/material_datepicker/proto/date_range.pb.dart, line 152, col 7)

Please fix all errors before compiling (warnings are okay).
}

[SEVERE] Failed after 1.2s

I am using protoc_plugin 16.0.1

dougreese commented 5 years ago

Simply regenerating the pb*.dart files solves this, but due to 3dd4207809523e6579aeaab139a085c69f757621 it looks like this needs to be done during the release process, not as a pull request, with an updated protoc_plugin.

supermuka commented 5 years ago

I'm getting this error too. What would be the step-by-step for workaround?

Using:

dougreese commented 5 years ago

@supermuka This is what worked for me. Assuming a Linux development environment (maybe MacOS as well -- not tested), to regenerate the pertinent datepicker files:

  1. Go to the appropriate pub-cache directory:
    cd ~/.pub-cache/hosted/pub.dartlang.org/angular_components-0.12.0/lib/material_datepicker/proto
  2. Run the protobuf compiler:
    protoc -I=. --dart_out=. *.proto
  3. Override the protobuf dependency version in your project pubspec.yaml:
    dependency_overrides:
    protobuf: ^0.13.4
  4. Build or serve your project as normal, and the updated generated code should be pulled into your project.
supermuka commented 5 years ago

Thanks @dougreese, this works for me too.

nshahan commented 5 years ago

Fixed in 447e040c14a8a0840d08cf7ed79ec1c57705642e. The published angular_components v0.13 includes the updated dependency.