dart-league/ng_bootstrap

Can't used it with DDC

Closed this issue · 5 comments

Is it ready to work with DDC or not yet? I have this error when I test it in Chrome browser.
angular2: 3.1.0
ng_bootstrap: 0.6.5

GET http://192.168.0.100:8080/packages/stream_transformers/lib__stream_transformers.js 404 (Not Found)
  req.load	
  load	
  load	
  fetch	
  check	
  enable	
  enable	
  (anonymous function)	
  (anonymous function)	
  each	
  enable	
  init	
  callGetModule	
  completeLoad	
  onScriptLoad	
Uncaught Error: Script error for "packages/stream_transformers/lib__stream_transformers", needed by: packages/ng_bootstrap/lib__components__typeahead__typeahead
  makeError	
  onScriptError	
Error compiling dartdevc module:stream_transformers|lib/lib__stream_transformers.js

[error] The argument type '(EventSink<List<dynamic>>) → StreamSubscription<List<Object>>' can't be assigned to the parameter type '(EventSink<dynamic>) → StreamSubscription<dynamic>'. (package:stream_transformers/src/combine.dart, line 28, col 24)
[error] The argument type '(EventSink<R>) → StreamSubscription<List<dynamic>>' can't be assigned to the parameter type '(EventSink<dynamic>) → StreamSubscription<dynamic>'. (package:stream_transformers/src/combine.dart, line 51, col 38)
[error] The argument type '(EventSink<T>) → StreamSubscription<T>' can't be assigned to the parameter type '(EventSink<dynamic>) → StreamSubscription<dynamic>'. (package:stream_transformers/src/do_action.dart, line 46, col 38)
[error] The function 'onListen' has type '(EventSink<T>) → StreamSubscription<dynamic>' that isn't of expected type '(EventSink<dynamic>) → StreamSubscription<dynamic>'. This means its parameter or return type does not match what is expected. (package:stream_transformers/src/flat_map.dart, line 62, col 60)
[error] The function 'onListen' has type '(EventSink<T>) → StreamSubscription<dynamic>' that isn't of expected type '(EventSink<dynamic>) → StreamSubscription<dynamic>'. This means its parameter or return type does not match what is expected. (package:stream_transformers/src/flat_map_latest.dart, line 34, col 48)
[error] The argument type '(T) → T' can't be assigned to the parameter type 'Mapper(T) → Stream<T>'. (package:stream_transformers/src/merge_all.dart, line 28, col 41)
[error] The function expression type '(EventSink<T>) → StreamSubscription<dynamic>' isn't of type '(EventSink<dynamic>) → StreamSubscription<dynamic>'. This means its parameter or return type does not match what is expected. Consider changing parameter type(s) or the returned type(s). (package:stream_transformers/src/sample_on.dart, line 42, col 42)
[error] The function 'onListen' has type '(EventSink<T>) → StreamSubscription<dynamic>' that isn't of expected type '(EventSink<dynamic>) → StreamSubscription<dynamic>'. This means its parameter or return type does not match what is expected. (package:stream_transformers/src/sample_on.dart, line 50, col 48)
[error] The argument type '(EventSink<R>) → StreamSubscription<A>' can't be assigned to the parameter type '(EventSink<dynamic>) → StreamSubscription<dynamic>'. (package:stream_transformers/src/scan.dart, line 30, col 38)
[error] The function 'onListen' has type '(EventSink<T>) → StreamSubscription<dynamic>' that isn't of expected type '(EventSink<dynamic>) → StreamSubscription<dynamic>'. This means its parameter or return type does not match what is expected. (package:stream_transformers/src/take_until.dart, line 54, col 48)
[error] The return type 'Future<List>' isn't a 'void', as defined by the method ''. (package:stream_transformers/src/util.dart, line 18, col 16)
[error] The argument type '(EventSink<T>) → StreamSubscription<T>' can't be assigned to the parameter type '(EventSink<dynamic>) → StreamSubscription<dynamic>'. (package:stream_transformers/src/when.dart, line 31, col 38)
[error] The argument type '(EventSink<T>) → StreamSubscription<T>' can't be assigned to the parameter type '(EventSink<dynamic>) → StreamSubscription<dynamic>'. (package:stream_transformers/src/when.dart, line 35, col 34)
[error] The argument type '(EventSink<R>) → StreamSubscription<R>' can't be assigned to the parameter type '(EventSink<dynamic>) → StreamSubscription<dynamic>'. (package:stream_transformers/src/zip.dart, line 50, col 38)

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

  xhr.onreadystatechange	

this is caused because stream_transformers library is not strong mode aware, until that library get updated we cannot do to much.

A possible solution could be to remove the dependency to that library

I think it is possible to swap out stream_transformers with rxdart with no trouble. Both of their transformers implement StreamTransformer<T, T> and rxdart is strong mode aware.

I'll check it tomorrow, thanks for the tip

There is also the stream_transform package maintained by the Dart team. It uses strong-mode and appears to support the same operations.

Thanks I'll test it.

Remember you can also create a pull request.