Giter Club home page Giter Club logo

angular's Introduction

AngularDart packages maintained by AngularDart Community

Packages

Build Status

Source code Published Version Pre-Release Version (if any)
ngdart Pub Package Pub Package
ngforms Pub Package Pub Package
ngrouter Pub Package Pub Package
ngtest Pub Package Pub Package
ngast Pub Package Pub Package
ngcompiler Pub Package Pub Package

The following packages are in an external repository:

Resources

AngularDart documentation: https://angulardart.xyz.

Source code Git repositories https://github.com/angulardart-community

Join the Gitter chat room to ask questions.

The original Packages (in the restricted maintenance mode)

See https://github.com/angulardart for updates on the original AngularDart project.

Source code Published Version
angular Pub Package
angular_forms Pub Package
angular_router Pub Package
angular_test Pub Package
angular_components Pub Package
angular_ast Pub Package
angular_compiler Pub Package

angular_components source is in another repository.

Infrastructure packages. Not typically used directly. Included for completeness.

angular's People

Contributors

alorenzen avatar benasocj avatar chalin avatar davidmorgan avatar dramos07 avatar ferhatb avatar grouma avatar gzgavinzhao avatar harryterkelsen avatar igorbabalich avatar iinozemtsev avatar jakemac53 avatar jbdeboer avatar keertip avatar kevmoo avatar kwalrath avatar leafpetersen avatar leonsenft avatar liuming0 avatar maopanglin avatar matanlurey avatar michaelrfairhurst avatar natebosch avatar rkj avatar srawlins avatar stereotype441 avatar tedsander avatar thso avatar tijoforyou avatar ykmnkmi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

angular's Issues

AngularDart 8 Roadmap

This is an incomplete list that I can think of on the top of my head, and I'll come back here to add more things. Feel free to suggest anything more!

For now, I don't expect there to be breaking changes in existing codebases that are using null safety.

  • infra
    • Establish a commit message standard (melos?) (#14).
    • #52
  • angular
    • Find out a new name to publish our forks (#8).
    • Re-enable all the skipped tests in _tests/ (most of them have been resolved) (#9).
    • Migrate codebase to 2.17 language features. Currently, we're only compatible with Dart 2.17.
    • Fix all the static analysis warnings. (#31)
    • (Optional) HTML template intellisense/autocompletion (nganalyzer).
    • (Optional) Investigate PostCSS integration for Tailwind CSS, etc.
    • (Optional) Investigate easy asset packaging.
    • (Optional) Investigate easy interop of npm packages and bundle them into the final JavaScript.
  • angular_test
    • Static analysis regarding type inference in NgTestBed (#5).
  • angular_components
  • site-angulardart
    • Update all examples to Angular 7/8.
    • (Optional) Drop Jekyll, use something else. Our tooling is getting old (e.g. grinder, jekyll-assets) and slow. We can even use AngularDart to write that whole website and use ngpuppeteer to pre-render it. Hugo. Verified that it is theoretically doable, design in progress. Work in progress: angulardart-community/website#9
  • misc
    • (Optional) Consider writing another component library that is much easier to understand/imitate than angular_components? So far everything in the ecosystem is around Material Design. We can utilize existing Angular TS libraries to drastically reduce the work, such as ng-zorro.

No provider found for structured directive

Which ng* package(s) are the source of the bug?

ngcompiler

Which operating system(s) does this bug appear on?

Linux

Which browser(s) does this bug appear on?

Chrome 115.0.5790.98 (Official Build) (64-bit)

Is this a regression?

Yes

Description

The Child should be provided.

Nesting of html elements should not affect this.

Please provide the steps to reproduce the bug

import 'package:ngdart/angular.dart';

import 'main.template.dart' as self;

void main() {
  runApp(self.AppComponentNgFactory);
}

abstract class Child {}

@Directive(
  selector: '[strDir]',
  providers: [ExistingProvider(Child, ChildDirective)],
)
class ChildDirective implements Child, OnInit {
  final TemplateRef _templateRef;
  final ViewContainerRef _viewContainerRef;
  ChildDirective(this._templateRef, this._viewContainerRef);

  @override
  void ngOnInit() {
    _viewContainerRef.createEmbeddedView(_templateRef);
  }
}

@Component(
  selector: 'child',
  template: '',
  changeDetection: ChangeDetectionStrategy.OnPush,
)
class ChildComponent {
  final Child abstract;
  ChildComponent(this.abstract);
}

@Component(
  selector: 'my-app',
  template: r'''
<!-- THIS ONE WORKS -->
<template strDir>
    <child></child>
</template>

<!-- THIS ONE DOES NOT -->
<div>
    <template strDir>
        <child></child>
    </template>
</div>
  ''',
  directives: [ChildComponent, ChildDirective],
  changeDetection: ChangeDetectionStrategy.OnPush,
)
class AppComponent {}

Please provide the exception or error you saw

EXCEPTION: No provider found for Child:
  ChildComponent ->
  Child.

Please provide the dependency environment you discovered this bug in (run dart pub deps -s compact)

Dart SDK 2.18.7
testing 0.0.1

dependencies:
- ngdart 7.1.1 [built_collection built_value collection intl js logging meta stack_trace stream_transform ngast ngcompiler build build_config code_builder csslib path quiver source_gen source_span]

dev dependencies:
- build_runner 2.3.3 [args async analyzer build build_config build_daemon build_resolvers build_runner_core code_builder collection crypto dart_style frontend_server_client glob graphs http_multi_server io js logging meta mime package_config path pool pub_semver pubspec_parse shelf shelf_web_socket stack_trace stream_transform timing watcher web_socket_channel yaml]
- build_web_compilers 3.2.6 [analyzer archive bazel_worker build build_config build_modules collection glob js logging path pool scratch_space source_maps source_span stack_trace]

transitive dependencies:
- _fe_analyzer_shared 47.0.0 [meta]
- analyzer 4.7.0 [_fe_analyzer_shared collection convert crypto glob meta package_config path pub_semver source_span watcher yaml]
- archive 3.3.7 [crypto path pointycastle]
- args 2.4.1
- async 2.11.0 [collection meta]
- bazel_worker 1.0.2 [async protobuf]
- boolean_selector 2.1.1 [source_span string_scanner]
- build 2.3.1 [analyzer async convert crypto glob logging meta path]
- build_config 1.1.1 [checked_yaml json_annotation path pubspec_parse yaml]
- build_daemon 3.1.1 [built_collection built_value http_multi_server logging path pool shelf shelf_web_socket stream_transform watcher web_socket_channel]
- build_modules 4.0.6 [analyzer async bazel_worker build build_config collection crypto glob graphs json_annotation logging path scratch_space stream_transform]
- build_resolvers 2.0.10 [analyzer async build crypto graphs logging path package_config pool pub_semver stream_transform yaml]
- build_runner_core 7.2.7 [async build build_config build_resolvers collection convert crypto glob graphs json_annotation logging meta path package_config pool timing watcher yaml]
- build_test 2.1.7 [async build build_config build_resolvers crypto glob html logging matcher package_config path stream_transform test test_core watcher]
- built_collection 5.1.1
- built_value 8.6.1 [built_collection collection fixnum meta]
- charcode 1.3.1
- checked_yaml 2.0.2 [json_annotation source_span yaml]
- clock 1.1.1
- code_builder 4.4.0 [built_collection built_value collection matcher meta]
- collection 1.17.2
- convert 3.1.1 [typed_data]
- coverage 1.6.3 [args logging package_config path source_maps stack_trace vm_service]
- crypto 3.0.2 [typed_data]
- csslib 0.17.2 [source_span]
- dart_style 2.2.4 [analyzer args path pub_semver source_span]
- file 6.1.4 [meta path]
- fixnum 1.0.1
- frontend_server_client 3.2.0 [async path]
- glob 2.1.1 [async collection file path string_scanner]
- graphs 2.3.1 [collection]
- html 0.15.3 [csslib source_span]
- http_multi_server 3.2.1 [async]
- http_parser 4.0.2 [collection source_span string_scanner typed_data]
- intl 0.17.0 [clock path]
- io 1.0.4 [meta path string_scanner]
- js 0.6.5 [meta]
- json_annotation 4.8.0 [meta]
- logging 1.1.1
- matcher 0.12.16 [async meta stack_trace term_glyph test_api]
- meta 1.9.1
- mime 1.0.4
- ngast 2.1.4 [charcode collection meta source_span string_scanner]
- ngcompiler 2.1.3 [ngdart ngast analyzer args build build_test code_builder collection csslib dart_style logging meta package_config path source_gen source_span stack_trace]
- node_preamble 2.0.2
- package_config 2.1.0 [path]
- path 1.8.3
- pointycastle 3.7.3 [collection convert js]
- pool 1.5.1 [async stack_trace]
- protobuf 2.1.0 [fixnum collection meta]
- pub_semver 2.1.4 [collection meta]
- pubspec_parse 1.2.3 [checked_yaml collection json_annotation pub_semver yaml]
- quiver 3.2.1 [matcher]
- scratch_space 1.0.1 [build crypto path pool]
- shelf 1.4.1 [async collection http_parser path stack_trace stream_channel]
- shelf_packages_handler 3.0.2 [path shelf shelf_static]
- shelf_static 1.1.2 [convert http_parser mime path shelf]
- shelf_web_socket 1.0.4 [shelf stream_channel web_socket_channel]
- source_gen 1.2.6 [analyzer async build dart_style glob meta path source_span yaml]
- source_map_stack_trace 2.1.1 [path source_maps stack_trace]
- source_maps 0.10.12 [source_span]
- source_span 1.10.0 [collection path term_glyph]
- stack_trace 1.11.1 [path]
- stream_channel 2.1.1 [async]
- stream_transform 2.1.0
- string_scanner 1.2.0 [source_span]
- term_glyph 1.2.1
- test 1.24.3 [analyzer async boolean_selector collection coverage http_multi_server io js node_preamble package_config path pool shelf shelf_packages_handler shelf_static shelf_web_socket source_span stack_trace stream_channel typed_data web_socket_channel webkit_inspection_protocol yaml test_api test_core matcher]
- test_api 0.6.0 [async boolean_selector collection meta source_span stack_trace stream_channel string_scanner term_glyph]
- test_core 0.5.3 [analyzer async args boolean_selector collection coverage frontend_server_client glob io meta package_config path pool source_map_stack_trace source_maps source_span stack_trace stream_channel vm_service yaml test_api]
- timing 1.0.1 [json_annotation]
- typed_data 1.3.2 [collection]
- vm_service 11.2.0
- watcher 1.0.2 [async path]
- web_socket_channel 2.4.0 [async crypto stream_channel]
- webkit_inspection_protocol 1.2.0 [logging]
- yaml 3.1.1 [collection source_span string_scanner]

Anything else?

Interesting part from generated template:

App component view
working:

  @override
  void build() {
    final parentRenderNode = this.initViewRoot();
    final _anchor_0 = import11.appendAnchor(parentRenderNode);

    // THIS IS INTERESTING
    // parent is null
    this._appEl_0 = ViewContainer(0, null, this, _anchor_0);

    var _TemplateRef_0_8 = TemplateRef(this._appEl_0, viewFactory_AppComponent1);
    this._ChildDirective_0_9 = import1.ChildDirective(_TemplateRef_0_8, this._appEl_0);
    if (import13.isDevToolsEnabled) {
      import13.Inspector.instance.registerDirective(_anchor_0, this._ChildDirective_0_9);
    }
    final _text_1 = import11.appendText(parentRenderNode, '\n');
    final _text_2 = import11.appendText(parentRenderNode, '\n');
    final _text_3 = import11.appendText(parentRenderNode, '\n');
    final _text_4 = import11.appendText(parentRenderNode, '\n');
    final _text_5 = import11.appendText(parentRenderNode, '\n');
  }

  @override
  dynamic injectorGetInternal(dynamic token, int nodeIndex, dynamic notFoundResult) {
    if ((identical(token, import1.Child) && (0 == nodeIndex))) {
      return this._ChildDirective_0_9;
    }
    return notFoundResult;
  }

NOT working

  @override
  void build() {
    final parentRenderNode = this.initViewRoot();
    final _text_0 = import11.appendText(parentRenderNode, '\n');
    final _text_1 = import11.appendText(parentRenderNode, '\n');
    final _text_2 = import11.appendText(parentRenderNode, '\n');
    final _text_3 = import11.appendText(parentRenderNode, ' ');
    final doc = import6.document;
    final _el_4 = import11.appendDiv(doc, parentRenderNode);
    final _anchor_5 = import11.appendAnchor(_el_4);

    // THIS IS INTERESTING
    // parent index is 4
    this._appEl_5 = ViewContainer(5, 4, this, _anchor_5);

    var _TemplateRef_5_8 = TemplateRef(this._appEl_5, viewFactory_AppComponent1);
    this._ChildDirective_5_9 = import1.ChildDirective(_TemplateRef_5_8, this._appEl_5);
    if (import13.isDevToolsEnabled) {
      import13.Inspector.instance.registerDirective(_anchor_5, this._ChildDirective_5_9);
    }
  }

  @override
  dynamic injectorGetInternal(dynamic token, int nodeIndex, dynamic notFoundResult) {
    if ((identical(token, import1.Child) && (5 == nodeIndex))) {
      return this._ChildDirective_5_9;
    }
    return notFoundResult;
  }

And View for structured directive

Working:

  void build() {
    this._compView_0 = ViewChildComponent0(this, 0);
    final _el_0 = this._compView_0.rootElement;
    this._ChildComponent_0_5 = (import5.isDevMode
        ? import9.debugInjectorWrap(import1.ChildComponent, () {

            // CORECT
            return import1.ChildComponent((this.parentView!).injectorGet(import1.Child, this.parentIndex));

          })
        : import1.ChildComponent((this.parentView!).injectorGet(import1.Child, this.parentIndex)));
    this._compView_0.create(this._ChildComponent_0_5);
    this.initRootNode(_el_0);
  }

NOT working

  void build() {
    this._compView_0 = ViewChildComponent0(this, 0);
    final _el_0 = this._compView_0.rootElement;
    this._ChildComponent_0_5 = (import5.isDevMode
        ? import9.debugInjectorWrap(import1.ChildComponent, () {

            // WRONG
            // parentView.parentView 
            return import1.ChildComponent(((this.parentView!).parentView!).injectorGet(import1.Child, (this.parentView!).parentIndex));

          })
        : import1.ChildComponent(((this.parentView!).parentView!).injectorGet(import1.Child, (this.parentView!).parentIndex)));
    this._compView_0.create(this._ChildComponent_0_5);
    this.initRootNode(_el_0);
  }

[SEVERE] ngdart on web/main.dart: Null check operator used on a null value #0 ElementAnnotationExtensions.targetKinds (package:analyzer/src/dart/element/extensions.dart:44:53)

Which ng* package(s) are the source of the bug?

ngdart

Which operating system(s) does this bug appear on?

Windows

Which browser(s) does this bug appear on?

Chrome 117.0.5938.132 64 bits

Is this a regression?

Yes

Description

I've been working on an AngularDart project of mine every day, and today I started getting this error "ngdart on web/main.dart: Null check operator used on a null value"

Please provide the steps to reproduce the bug

create a simple angular project and run webdev serve

https://github.com/insinfo/dart_bug_demo

Please provide the exception or error you saw

PS C:\MyDartProjects\dart_bug_demo> webdev serve
[INFO] Building new asset graph completed, took 1.7s
[INFO] Checking for unexpected pre-existing outputs. completed, took 0ms
[INFO] Serving `web` on http://127.0.0.1:8080
[SEVERE] ngdart on web/main.dart: Null check operator used on a null value
#0      ElementAnnotationExtensions.targetKinds (package:analyzer/src/dart/element/extensions.dart:44:53)
#1      BestPracticesVerifier.visitAnnotation (package:analyzer/src/error/best_practices_verifier.dart:323:25)
#2      AnnotationImpl.accept (package:analyzer/src/dart/ast/ast.dart:318:50)
#3      NodeListImpl.accept (package:analyzer/src/dart/ast/ast.dart:8777:20)
#4      AnnotatedNodeImpl.visitChildren (package:analyzer/src/dart/ast/ast.dart:154:17)
#5      ClassDeclarationImpl.visitChildren (package:analyzer/src/dart/ast/ast.dart:1823:11)
#6      RecursiveAstVisitor.visitClassDeclaration (package:analyzer/dart/ast/visitor.dart:793:10)
#7      BestPracticesVerifier.visitClassDeclaration (package:analyzer/src/error/best_practices_verifier.dart:404:13)
#8      ClassDeclarationImpl.accept (package:analyzer/src/dart/ast/ast.dart:1799:50)
#9      NodeListImpl.accept (package:analyzer/src/dart/ast/ast.dart:8777:20)
#10     CompilationUnitImpl.visitChildren (package:analyzer/src/dart/ast/ast.dart:2455:21)
#11     RecursiveAstVisitor.visitCompilationUnit (package:analyzer/dart/ast/visitor.dart:817:10)
#12     CompilationUnitImpl.accept (package:analyzer/src/dart/ast/ast.dart:2448:50)
#13     LibraryAnalyzer._computeHints (package:analyzer/src/dart/analysis/library_analyzer.dart:344:10)
#14     LibraryAnalyzer._computeDiagnostics.<anonymous closure> (package:analyzer/src/dart/analysis/library_analyzer.dart:274:9)
#15     _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:617:13)
#16     LibraryAnalyzer._computeDiagnostics (package:analyzer/src/dart/analysis/library_analyzer.dart:273:13)        
#17     LibraryAnalyzer.analyze (package:analyzer/src/dart/analysis/library_analyzer.dart:92:5)
#18     AnalysisDriver._computeAnalysisResult.<anonymous closure> (package:analyzer/src/dart/analysis/driver.dart:1373:11)
<asynchronous suspension>
#19     PerformanceLog.runAsync (package:analyzer/src/dart/analysis/performance_logger.dart:50:14)
<asynchronous suspension>
#20     AnalysisDriver._computeErrors (package:analyzer/src/dart/analysis/driver.dart:1410:26)
<asynchronous suspension>
#21     AnalysisDriver.performWork (package:analyzer/src/dart/analysis/driver.dart:1118:20)
<asynchronous suspension>
#22     AnalysisDriverScheduler._run (package:analyzer/src/dart/analysis/driver.dart:2171:7)
<asynchronous suspension>


[INFO] 10.7s elapsed, 29/33 actions completed.^CDeseja finalizar o arquivo em lotes (S/N)? s
PS C:\MyDartProjects\dart_bug_demo>

Please provide the dependency environment you discovered this bug in (run dart pub deps -s compact)

PS C:\MyDartProjects\dart_bug_demo> dart pub deps -s compact
Dart SDK 2.18.7
dart_bug_demo 0.0.0

dependencies:
- ngdart 7.1.1 [built_collection built_value collection intl js logging meta stack_trace stream_transform ngast ngcompiler build build_config code_builder csslib path quiver source_gen source_span]

dev dependencies:
- build_runner 2.3.3 [args async analyzer build build_config build_daemon build_resolvers build_runner_core code_builder collection crypto dart_style frontend_server_client glob graphs http_multi_server io js logging meta mime package_config path pool pub_semver pubspec_parse shelf shelf_web_socket stack_trace stream_transform timing watcher web_socket_channel yaml]
- build_web_compilers 3.2.6 [analyzer archive bazel_worker build build_config build_modules collection glob js logging path pool scratch_space source_maps source_span stack_trace]

transitive dependencies:
- _fe_analyzer_shared 47.0.0 [meta]
- analyzer 4.7.0 [_fe_analyzer_shared collection convert crypto glob meta package_config path pub_semver source_span watcher yaml]
- archive 3.4.2 [crypto path pointycastle]
- args 2.4.1
- async 2.11.0 [collection meta]
- bazel_worker 1.0.2 [async protobuf]
- boolean_selector 2.1.1 [source_span string_scanner]
- build 2.3.1 [analyzer async convert crypto glob logging meta path]
- build_config 1.1.1 [checked_yaml json_annotation path pubspec_parse yaml]
- build_daemon 3.1.1 [built_collection built_value http_multi_server logging path pool shelf shelf_web_socket stream_transform watcher web_socket_channel]
- build_modules 4.0.6 [analyzer async bazel_worker build build_config collection crypto glob graphs json_annotation logging path scratch_space stream_transform]
- build_resolvers 2.0.10 [analyzer async build crypto graphs logging path package_config pool pub_semver stream_transform yaml]
- build_runner_core 7.2.7 [async build build_config build_resolvers collection convert crypto glob graphs json_annotation logging meta path package_config pool timing watcher yaml]
- build_test 2.1.7 [async build build_config build_resolvers crypto glob html logging matcher package_config path stream_transform test test_core watcher]
- built_collection 5.1.1
- built_value 8.6.3 [built_collection collection fixnum meta]
- charcode 1.3.1
- checked_yaml 2.0.2 [json_annotation source_span yaml]
- clock 1.1.1
- code_builder 4.4.0 [built_collection built_value collection matcher meta]
- collection 1.18.0
- convert 3.1.1 [typed_data]
- coverage 1.6.3 [args logging package_config path source_maps stack_trace vm_service]
- crypto 3.0.2 [typed_data]
- csslib 0.17.2 [source_span]
- dart_style 2.2.4 [analyzer args path pub_semver source_span]
- file 6.1.4 [meta path]
- fixnum 1.0.1
- frontend_server_client 3.2.0 [async path]
- glob 2.1.1 [async collection file path string_scanner]
- graphs 2.3.1 [collection]
- html 0.15.3 [csslib source_span]
- http_multi_server 3.2.1 [async]
- http_parser 4.0.2 [collection source_span string_scanner typed_data]
- intl 0.17.0 [clock path]
- io 1.0.4 [meta path string_scanner]
- js 0.6.5 [meta]
- json_annotation 4.8.0 [meta]
- logging 1.1.1
- matcher 0.12.16 [async meta stack_trace term_glyph test_api]
- meta 1.10.0
- mime 1.0.4
- ngast 2.1.4 [charcode collection meta source_span string_scanner]
- ngcompiler 2.1.3 [ngdart ngast analyzer args build build_test code_builder collection csslib dart_style logging meta package_config path source_gen source_span stack_trace]
- node_preamble 2.0.2
- package_config 2.1.0 [path]
- path 1.8.3
- pointycastle 3.7.3 [collection convert js]
- pool 1.5.1 [async stack_trace]
- protobuf 2.1.0 [fixnum collection meta]
- pub_semver 2.1.4 [collection meta]
- pubspec_parse 1.2.3 [checked_yaml collection json_annotation pub_semver yaml]
- quiver 3.2.1 [matcher]
- scratch_space 1.0.1 [build crypto path pool]
- shelf 1.4.1 [async collection http_parser path stack_trace stream_channel]
- shelf_packages_handler 3.0.2 [path shelf shelf_static]
- shelf_static 1.1.2 [convert http_parser mime path shelf]
- shelf_web_socket 1.0.4 [shelf stream_channel web_socket_channel]
- source_gen 1.2.6 [analyzer async build dart_style glob meta path source_span yaml]
- source_map_stack_trace 2.1.1 [path source_maps stack_trace]
- source_maps 0.10.12 [source_span]
- source_span 1.10.0 [collection path term_glyph]
- stack_trace 1.11.1 [path]
- stream_channel 2.1.1 [async]
- stream_transform 2.1.0
- string_scanner 1.2.0 [source_span]
- term_glyph 1.2.1
- test 1.24.3 [analyzer async boolean_selector collection coverage http_multi_server io js node_preamble package_config path pool shelf shelf_packages_handler shelf_static shelf_web_socket source_span stack_trace stream_channel typed_data web_socket_channel webkit_inspection_protocol yaml test_api test_core matcher]
- test_api 0.6.0 [async boolean_selector collection meta source_span stack_trace stream_channel string_scanner term_glyph]
- test_core 0.5.3 [analyzer async args boolean_selector collection coverage frontend_server_client glob io meta package_config path pool source_map_stack_trace source_maps source_span stack_trace stream_channel vm_service yaml test_api]
- timing 1.0.1 [json_annotation]
- typed_data 1.3.2 [collection]
- vm_service 11.2.0
- watcher 1.0.2 [async path]
- web_socket_channel 2.4.0 [async crypto stream_channel]
- webkit_inspection_protocol 1.2.0 [logging]
- yaml 3.1.1 [collection source_span string_scanner]
PS C:\MyDartProjects\dart_bug_demo>

Anything else?

No response

Excessive change detection with requestAnimationFrame()

Which ng* package(s) are the source of the bug?

ngdart

Which operating system(s) does this bug appear on?

Windows, MacOS, Linux

Which browser(s) does this bug appear on?

Chrome 114.0.5735.106

Is this a regression?

No

Description

A minimum repro of the issue is created at: https://github.com/linuxerwang/web-angular.

When the page includes a requestAnimationFrame(), all elements of the page get constantly re-evaluated, thus causing performance issue:

<div *ngIf="heavyCalc()">Hello</div>
<canvas></canvas>
lass AppComponent implements AfterViewInit {
  @override
  Future<Null> ngAfterViewInit() async {
    window.requestAnimationFrame(onFrame);
  }

  onFrame(timeStamp) {
    window.requestAnimationFrame(onFrame);
  }

  heavyCalc() {
    print('--> calculating');
    return true;
  }
}

Is there a way to suppress change detection for requestAnimationFrame? ChangeDetectionStrategy.onPush doesn't seem helping.

Thanks.

Please provide the steps to reproduce the bug

https://github.com/linuxerwang/web-angular

$ webdev serve

Verify logs In web console.

Please provide the exception or error you saw

No response

Please provide the dependency environment you discovered this bug in (run dart pub deps -s compact)

Dart SDK 2.19.6
ngdart 8.0.0-dev.2

Anything else?

n/a

New library names to publish forked by AngularDart Community packages

This task is a part of AngularDart 8 Roadmap

Rename forked by AngularDart Community packages to be able publish and use them on pub.dev

New package names:
angular -> ngdart (the existing ngdart package utility will be renamed to ngdart_cli)
angular_ast -> ngast
angular_compiler -> ngcompiler
angular_forms -> ngforms
angular_router -> ngrouter
angular_test -> ngtest

Dart SDK: 2.17.0
AngularDart Version: 8.0.0

code_builder 4.2.0 breaks test with lint ignores

Which ng* package(s) are the source of the bug?

ngcompiler

Which operating system(s) does this bug appear on?

Linux

Which browser(s) does this bug appear on?

N/A

Is this a regression?

No

Description

As in CI 2842979323, currently ngcompiler tests are failing because the new code_builder (v5.2.0) adds a new lint no_leading_underscores_for_library_prefixes to the start of the code, causing test cases to fail. For example,

02:00 +97 -10: test/v1/angular_compiler/emitter/reflector_test.dart: should handle generic type parameters where the bound type extends another bound type [E]
  Expected: 'var _visited = false;\n'
              'void initReflector() {\n'
              '  if (_visited) {\n'
              '    return;\n'
              '  }\n'
              '  _visited = true;\n'
              '\n'
              '  _ngRef.registerFactory(\n'
              '      InjectsGeneric, (GenericType<String> p0) => InjectsGeneric(p0));\n'
              '  _ngRef.registerDependencies(InjectsGeneric, const [\n'
              '    [GenericType]\n'
              '  ]);\n'
              '}\n'
              ''
    Actual: '// ignore_for_file: no_leading_underscores_for_library_prefixes\n'
              'var _visited = false;\n'
              'void initReflector() {\n'
              '  if (_visited) {\n'
              '    return;\n'
              '  }\n'
              '  _visited = true;\n'
              '\n'
              '  _ngRef.registerFactory(\n'
              '      InjectsGeneric, (GenericType<String> p0) => InjectsGeneric(p0));\n'
              '  _ngRef.registerDependencies(InjectsGeneric, const [\n'
              '    [GenericType]\n'
              '  ]);\n'
              '}\n'
              ''
     Which: is different.
            Expected: var _visit ...
              Actual: // ignore_ ...
                      ^
             Differ at offset 0

As shown, ngcompiler is passing the test but the extra comment makes this evaluation to be false on Dart's side.

Please provide the steps to reproduce the bug

No response

Please provide the exception or error you saw

No response

Please provide the dependency environment you discovered this bug in (run dart pub deps -s compact)

Dart SDK 2.17.6
Flutter SDK 3.0.5
ngcompiler 2.1.1+0

dependencies:
- args 2.3.1
- build 2.3.0 [analyzer async convert crypto glob logging meta path]
- build_test 2.1.5 [async build build_config build_resolvers crypto glob html logging matcher package_config path stream_transform test test_core watcher]
- code_builder 4.1.0 [built_collection built_value collection matcher meta]
- collection 1.16.0
- csslib 0.17.2 [source_span]
- dart_style 2.2.3 [analyzer args path pub_semver source_span]
- logging 1.0.2
- meta 1.8.0
- ngast 2.1.3 [charcode collection meta source_span string_scanner]
- ngdart 7.1.0 [built_collection built_value collection intl js logging meta stack_trace stream_transform ngast ngcompiler build build_config code_builder csslib path quiver source_gen source_span]
- package_config 2.1.0 [path]
- path 1.8.2
- source_gen 1.2.2 [analyzer async build dart_style glob meta path source_span yaml]
- source_span 1.9.0 [collection path term_glyph]
- stack_trace 1.10.0 [path]

dev dependencies:
- analyzer 4.2.0 [_fe_analyzer_shared collection convert crypto glob meta package_config path pub_semver source_span watcher yaml]
- build_runner 2.1.11 [args async analyzer build build_config build_daemon build_resolvers build_runner_core code_builder collection crypto dart_style frontend_server_client glob graphs http_multi_server io js logging meta mime package_config path pool pub_semver pubspec_parse shelf shelf_web_socket stack_trace stream_transform timing watcher web_socket_channel yaml]
- lints 2.0.0
- mockito 5.2.0 [analyzer build code_builder collection dart_style matcher meta path source_gen test_api]
- test 1.21.3 [analyzer async boolean_selector collection coverage http_multi_server io js node_preamble package_config path pool shelf shelf_packages_handler shelf_static shelf_web_socket source_span stack_trace stream_channel typed_data web_socket_channel webkit_inspection_protocol yaml test_api test_core]

dependency overrides:
- ngast 2.1.3 [charcode collection meta source_span string_scanner]
- ngdart 7.1.0 [built_collection built_value collection intl js logging meta stack_trace stream_transform ngast ngcompiler build build_config code_builder csslib path quiver source_gen source_span]

transitive dependencies:
- _fe_analyzer_shared 41.0.0 [meta]
- async 2.9.0 [collection meta]
- boolean_selector 2.1.0 [source_span string_scanner]
- build_config 1.0.0 [checked_yaml json_annotation path pubspec_parse yaml]
- build_daemon 3.1.0 [built_collection built_value http_multi_server logging path pool shelf shelf_web_socket stream_transform watcher web_socket_channel]
- build_resolvers 2.0.9 [analyzer async build crypto graphs logging path package_config pool pub_semver stream_transform yaml]
- build_runner_core 7.2.3 [async build build_config build_resolvers collection convert crypto glob graphs json_annotation logging meta path package_config pool timing watcher yaml]
- built_collection 5.1.1
- built_value 8.3.3 [built_collection collection fixnum meta]
- charcode 1.3.1
- checked_yaml 2.0.1 [json_annotation source_span yaml]
- clock 1.1.1
- convert 3.0.2 [typed_data]
- coverage 1.5.0 [args logging package_config path source_maps stack_trace vm_service]
- crypto 3.0.2 [typed_data]
- file 6.1.2 [meta path]
- fixnum 1.0.1
- frontend_server_client 2.1.3 [async path]
- glob 2.1.0 [async collection file path string_scanner]
- graphs 2.1.0 [collection]
- html 0.15.0 [csslib source_span]
- http_multi_server 3.2.1 [async]
- http_parser 4.0.1 [collection source_span string_scanner typed_data]
- intl 0.17.0 [clock path]
- io 1.0.3 [meta path string_scanner]
- js 0.6.4
- json_annotation 4.5.0 [meta]
- matcher 0.12.12 [stack_trace]
- mime 1.0.2
- node_preamble 2.0.1
- pool 1.5.1 [async stack_trace]
- pub_semver 2.1.1 [collection meta]
- pubspec_parse 1.2.0 [checked_yaml collection json_annotation pub_semver yaml]
- quiver 3.1.0 [matcher]
- shelf 1.3.1 [async collection http_parser path stack_trace stream_channel]
- shelf_packages_handler 3.0.1 [path shelf shelf_static]
- shelf_static 1.1.1 [convert http_parser mime path shelf]
- shelf_web_socket 1.0.2 [shelf stream_channel web_socket_channel]
- source_map_stack_trace 2.1.0 [path stack_trace source_maps]
- source_maps 0.10.10 [source_span]
- stream_channel 2.1.0 [async]
- stream_transform 2.0.0
- string_scanner 1.1.1 [source_span]
- term_glyph 1.2.1
- test_api 0.4.11 [async boolean_selector collection meta source_span stack_trace stream_channel string_scanner term_glyph matcher]
- test_core 0.4.15 [analyzer async args boolean_selector collection coverage frontend_server_client glob io meta package_config path pool source_map_stack_trace source_maps source_span stack_trace stream_channel vm_service yaml matcher test_api]
- timing 1.0.0 [json_annotation]
- typed_data 1.3.1 [collection]
- vm_service 9.0.0
- watcher 1.0.1 [async path]
- web_socket_channel 2.2.0 [async crypto stream_channel]
- webkit_inspection_protocol 1.1.0 [logging]
- yaml 3.1.1 [collection source_span string_scanner]

Anything else?

Admittedly we can just add the extra comment to each test case, but if this happens again in the future the process will be very tedious. Maybe there's something to turn off the influence of comments on our test cases once and for all?

it seems that change detection doesn't work in javascript callbacks inside allowInterop

@GZGavinZhao @ykmnkmi

Which ng* package(s) are the source of the bug?

ngdart

Which operating system(s) does this bug appear on?

Windows

Which browser(s) does this bug appear on?

Chrome 117.0.5938.132 64 bits

Is this a regression?

No

Description

I'm using allowInterop to interact with JavaScript code, more specifically I'm creating an AngularDart application that uses Fabric.js to create a Badge Creator (Professional Employee ID Card), so I'm having a problem because it seems that AngularDart doesn't detect changes in variables What do I change inside allowInterop

Please provide the steps to reproduce the bug

 void initFabric() {
    canvas = Canvas(canvasEl);
    stage = Rect(
      jsify({
        'left':
            (canvas.width / 2) - ((currentWidth * (stage?.scaleX ?? 1)) / 2),
        'top': 50,
        'width': currentWidth,
        'height': currentHeight,
        'fill': '#fff',
        'lockMovementY': true,
        'lockMovementX': true,
        'selectable': false,
        'hoverCursor': 'default',
      }),
    );

    canvas.add(stage);

    num zoom = 1;
    canvas.on('mouse:wheel', allowInterop((opt) {
      final deltaY = opt.e.deltaY;   
      final mousePoint = canvas.getPointer(opt.e, true);
      zoom = canvas.getZoom();
      zoom *= pow(0.999, deltaY);
      if (zoom > 20) zoom = 20;
      if (zoom < 0.01) zoom = 0.01;    
      canvas.zoomToPoint(Point(mousePoint.x, mousePoint.y), zoom);
      opt.e.preventDefault();
      opt.e.stopPropagation();
    }));

    canvas.on('selection:created', allowInterop((obj) {
  //change detection doesn't work
      onSelectObject(obj);
    }));
    canvas.on('selection:updated', allowInterop((obj) {
  //change detection doesn't work
      onSelectObject(obj);
    }));

    canvas.on('selection:cleared', allowInterop((event) {
      //change detection doesn't work
      onUnSelectObject(event);
    }));
   
  }

  void onUnSelectObject(event) {
    //change current width of stage (valid drawing area)
 //change detection doesn't work
    currentWidth = stage!.getScaledWidth();
    currentHeight = stage!.getScaledHeight();
  }

  void onSelectObject(event) {
 //change detection doesn't work
    final activeObj = canvas.getActiveObject();
    final scaledWidth = activeObj.getScaledWidth();
    final scaledHeight = activeObj.getScaledHeight();

    currentWidth = scaledWidth;
    currentHeight = scaledHeight;

  }

Please provide the exception or error you saw

.

Please provide the dependency environment you discovered this bug in (run dart pub deps -s compact)

Dart SDK version: 3.2.1 (stable) (Wed Nov 22 08:59:13 2023 +0000) on "windows_x64"

Anything else?

No response

Unable to mock Router with null-safety mockito

Which ng* package(s) are the source of the bug?

ngrouter

Which operating system(s) does this bug appear on?

Linux

Which browser(s) does this bug appear on?

N/A

Is this a regression?

No

Description

When using the null-safety mockito (^5.0.0) to mock a Router (with the null-safety angular of course), testBed.create() fails when calling the stream getter of the Router class. Before in the pre-null-safety era, stream would just return null, and since no code seems to call it, we could get away with this. Now with null safety, you cannot escape it. You either get a missing stub error or Stream<RouterState> is not null error.

It's likely that we have to put a code directly after setup, but that would be an extra boilerplate. It would be best if we can avoid this.

Please provide the steps to reproduce the bug

Reproducible repo: https://github.com/GZGavinZhao/mockbug

The repo showcases the original version (how we would write it in pre-5.0 mockito, and three attempts to overcome this bug, both of which fail.

  1. Original version:
import 'package:mockbug/app_component.template.dart' as ng;

import 'app_po.dart';

@GenerateMocks([Router])
import 'router_1_test.mocks.dart';

import 'router_1_test.template.dart' as self;

late NgTestFixture<AppComponent> fixture;
late AppPo po;

@GenerateInjector([
  ValueProvider.forToken(appBaseHref, '/'),
  routerProviders,
  ClassProvider(Router, useClass: MockRouter),
])
final InjectorFactory rootInjector = self.rootInjector$Injector;

void main() {
  final injector = InjectorProbe(rootInjector);
  final testBed = NgTestBed<AppComponent>(
    ng.AppComponentNgFactory,
    rootInjector: injector.factory,
  );

  setUp(() async {
    fixture = await testBed.create();
    final context =
        HtmlPageLoaderElement.createFromElement(fixture.rootElement);
    po = AppPo.create(context);
  });

  test('the default title should be foo', () async {
    expect(po.title, 'Foo');
  });

  test('router is not called', () async {});

  tearDown(disposeAnyRunningTest);
}
  1. Attempt 1. We only list the part that changed.
@GenerateMocks(
  [],
  customMocks: [
    MockSpec<RouterImpl>(
      as: #MockRouter,
      returnNullOnMissingStub: true,
    ),
  ],
)
import 'router_2_test.mocks.dart';
  1. Attempt 2.
@GenerateMocks(
  [],
  customMocks: [
    MockSpec<RouterImpl>(
      as: #MockRouter,
      returnNullOnMissingStub: true,
      fallbackGenerators: {
        #stream: mockStream,
      },
    ),
  ],
)
import 'router_3_test.mocks.dart';

import 'router_3_test.template.dart' as self;

Stream<RouterState> mockStream() {
  return Stream.empty();
}
  1. Attempt 3.
@GenerateMocks([Router])
import 'router_4_test.mocks.dart';

void main() {
  setUp(() async {
    final mockRouter = injector.get<MockRouter>(Router);
    when(mockRouter.stream).thenAnswer((realInvocation) => Stream.empty());

    fixture = await testBed.create();
    final context =
        HtmlPageLoaderElement.createFromElement(fixture.rootElement);
    po = AppPo.create(context);
  });

  // tests...
}

InjectorProbe is a shared code here:

class InjectorProbe {
  InjectorFactory _parent;
  Injector? _injector;

  InjectorProbe(this._parent);

  InjectorFactory get factory => _factory;
  Injector? get injector => _injector;

  // Injector _factory([Injector? parent]) => _injector = _parent(parent);
  Injector _factory(Injector parent) => _injector = _parent(parent);
  T get<T>(dynamic token) => injector?.get(token);
}

Please provide the exception or error you saw

Original: 
  MissingStubError: 'stream'
  No stub was found which matches the arguments of this method call:
  stream
  
  Add a stub for this method using Mockito's 'when' API, or generate the MockRouter mock with a MockSpec with 'returnNullOnMissingStub: true' (see https://pub.dev/documentation/mockito/latest/annotations/MockSpec-class.html).
  dart:sdk_internal                                                        throw_
  package:mockito/src/mock.dart 191:7                                      [_noSuchMethod]
  package:mockito/src/mock.dart 185:45                                     noSuchMethod
  router_1_test.mocks.dart 47:14                                           get stream
  package:ngrouter/src/directives/router_link_active_directive.dart 44:36  ngAfterViewInit
  package:mockbug/app_component.template.dart 165:36                       detectChangesInternal
  package:ngdart/src/core/linker/views/component_view.dart 158:7           detectChangesDeprecated
  package:ngdart/src/core/linker/views/host_view.dart 182:19               detectChangesInternal
  package:ngdart/src/core/linker/views/host_view.dart 147:7                detectChangesDeprecated
  package:ngdart/src/core/change_detection/change_detector_ref.dart 175:5  DeprecatedDetectChanges.detectChanges
  package:ngdart/src/core/change_detection/host.dart 102:20                [_runTick]
  package:ngdart/src/core/change_detection/host.dart 78:7                  tick
  package:ngdart/src/core/application_ref.dart 113:5                       [_loadedRootComponent]
  package:ngdart/src/core/application_ref.dart 170:5                       TestApplicationRef.registerRootComponent
  package:ngtest/src/bootstrap.dart 93:12                                  loadComponent
  package:ngtest/src/bootstrap.dart 105:12                                 _runAndLoadComponent
  package:ngtest/src/bootstrap.dart 58:7                                   <fn>
  package:ngdart/src/core/change_detection/host.dart 207:26                <fn>
  package:ngdart/src/core/zone/ng_zone.dart 105:18                         <fn>
  dart:sdk_internal                                                        run
  package:ngdart/src/core/zone/ng_zone.dart 102:18                         [_run]
  dart:sdk_internal                                                        run
  package:ngdart/src/core/zone/ng_zone.dart 273:23                         run
  package:ngdart/src/core/application_ref.dart 148:52                      runInZone
  package:ngdart/src/core/change_detection/host.dart 205:5                 run
  package:ngtest/src/bootstrap.dart 51:16                                  bootstrapForTest

2/3:
  Expected a value of type 'Stream<RouterState>', but got one of type 'Null'
  dart:sdk_internal                                                        as_C
  router_3_test.mocks.dart 42:42                                           get stream
  package:ngrouter/src/directives/router_link_active_directive.dart 44:36  ngAfterViewInit
  package:mockbug/app_component.template.dart 165:36                       detectChangesInternal
  package:ngdart/src/core/linker/views/component_view.dart 158:7           detectChangesDeprecated
  package:ngdart/src/core/linker/views/host_view.dart 182:19               detectChangesInternal
  package:ngdart/src/core/linker/views/host_view.dart 147:7                detectChangesDeprecated
  package:ngdart/src/core/change_detection/change_detector_ref.dart 175:5  DeprecatedDetectChanges.detectChanges
  package:ngdart/src/core/change_detection/host.dart 102:20                [_runTick]
  package:ngdart/src/core/change_detection/host.dart 78:7                  tick
  package:ngdart/src/core/application_ref.dart 113:5                       [_loadedRootComponent]
  package:ngdart/src/core/application_ref.dart 170:5                       TestApplicationRef.registerRootComponent
  package:ngtest/src/bootstrap.dart 93:12                                  loadComponent
  package:ngtest/src/bootstrap.dart 105:12                                 _runAndLoadComponent
  package:ngtest/src/bootstrap.dart 58:7                                   <fn>
  package:ngdart/src/core/change_detection/host.dart 207:26                <fn>
  package:ngdart/src/core/zone/ng_zone.dart 105:18                         <fn>
  dart:sdk_internal                                                        run
  package:ngdart/src/core/zone/ng_zone.dart 102:18                         [_run]
  dart:sdk_internal                                                        run
  package:ngdart/src/core/zone/ng_zone.dart 273:23                         run
  package:ngdart/src/core/application_ref.dart 148:52                      runInZone
  package:ngdart/src/core/change_detection/host.dart 205:5                 run
  package:ngtest/src/bootstrap.dart 51:16                                  bootstrapForTest

4:
  Expected a value of type 'MockRouter', but got one of type 'Null'
  dart:sdk_internal         as_C
  utils.dart 14:30          get
  router_4_test.dart 38:29  <fn>
  dart:sdk_internal         _async
  router_4_test.dart 37:9   <fn>

Please provide the dependency environment you discovered this bug in (run dart pub deps -s compact)

Dart SDK 2.17.6
Flutter SDK 3.0.5
mockbug 0.0.1

dependencies:
- ngdart 7.1.0 [built_collection built_value collection intl js logging meta stack_trace stream_transform analyzer ngast ngcompiler build build_config code_builder csslib path lints quiver source_gen source_span]
- ngrouter 3.1.0 [ngdart collection js meta]

dev dependencies:
- build_runner 2.1.11 [args async analyzer build build_config build_daemon build_resolvers build_runner_core code_builder collection crypto dart_style frontend_server_client glob graphs http_multi_server io js logging meta mime package_config path pool pub_semver pubspec_parse shelf shelf_web_socket stack_trace stream_transform timing watcher web_socket_channel yaml]
- build_test 2.1.5 [async build build_config build_resolvers crypto glob html logging matcher package_config path stream_transform test test_core watcher]
- build_version 2.1.1 [build build_config pubspec_parse]
- build_web_compilers 3.2.3 [analyzer archive bazel_worker build build_config build_modules collection glob js logging path pool scratch_space source_maps source_span stack_trace]
- lints 2.0.0
- meta 1.8.0
- mockito 5.2.0 [analyzer build code_builder collection dart_style matcher meta path source_gen test_api]
- ngpageloader 5.0.0-dev.2 [analyzer build built_value build_config js matcher quiver source_gen webdriver collection]
- ngtest 4.1.0 [ngdart collection meta pedantic]
- test 1.21.4 [analyzer async boolean_selector collection coverage http_multi_server io js node_preamble package_config path pool shelf shelf_packages_handler shelf_static shelf_web_socket source_span stack_trace stream_channel typed_data web_socket_channel webkit_inspection_protocol yaml test_api test_core]

transitive dependencies:
- _fe_analyzer_shared 41.0.0 [meta]
- analyzer 4.2.0 [_fe_analyzer_shared collection convert crypto glob meta package_config path pub_semver source_span watcher yaml]
- archive 3.3.0 [crypto path]
- args 2.3.1
- async 2.9.0 [collection meta]
- bazel_worker 1.0.1 [async protobuf]
- boolean_selector 2.1.0 [source_span string_scanner]
- build 2.3.0 [analyzer async convert crypto glob logging meta path]
- build_config 1.0.0 [checked_yaml json_annotation path pubspec_parse yaml]
- build_daemon 3.1.0 [built_collection built_value http_multi_server logging path pool shelf shelf_web_socket stream_transform watcher web_socket_channel]
- build_modules 4.0.5 [analyzer async bazel_worker build build_config collection crypto glob graphs json_annotation logging path scratch_space stream_transform]
- build_resolvers 2.0.9 [analyzer async build crypto graphs logging path package_config pool pub_semver stream_transform yaml]
- build_runner_core 7.2.3 [async build build_config build_resolvers collection convert crypto glob graphs json_annotation logging meta path package_config pool timing watcher yaml]
- built_collection 5.1.1
- built_value 8.3.3 [built_collection collection fixnum meta]
- charcode 1.3.1
- checked_yaml 2.0.1 [json_annotation source_span yaml]
- clock 1.1.1
- code_builder 4.1.0 [built_collection built_value collection matcher meta]
- collection 1.16.0
- convert 3.0.2 [typed_data]
- coverage 1.3.2 [args logging package_config path source_maps stack_trace vm_service]
- crypto 3.0.2 [typed_data]
- csslib 0.17.2 [source_span]
- dart_style 2.2.3 [analyzer args path pub_semver source_span]
- file 6.1.2 [meta path]
- fixnum 1.0.1
- frontend_server_client 2.1.3 [async path]
- glob 2.1.0 [async collection file path string_scanner]
- graphs 2.1.0 [collection]
- html 0.15.0 [csslib source_span]
- http_multi_server 3.2.1 [async]
- http_parser 4.0.1 [collection source_span string_scanner typed_data]
- intl 0.17.0 [clock path]
- io 1.0.3 [meta path string_scanner]
- js 0.6.4
- json_annotation 4.6.0 [meta]
- logging 1.0.2
- matcher 0.12.11 [stack_trace]
- mime 1.0.2
- ngast 2.1.3 [analyzer charcode collection meta source_span string_scanner]
- ngcompiler 2.1.1+0 [analyzer ngdart ngast args build build_test code_builder collection csslib dart_style logging meta package_config path source_gen source_span stack_trace]
- node_preamble 2.0.1
- package_config 2.1.0 [path]
- path 1.8.2
- pedantic 1.11.1
- pool 1.5.1 [async stack_trace]
- protobuf 2.1.0 [fixnum collection meta]
- pub_semver 2.1.1 [collection meta]
- pubspec_parse 1.2.0 [checked_yaml collection json_annotation pub_semver yaml]
- quiver 3.1.0 [matcher]
- scratch_space 1.0.1 [build crypto path pool]
- shelf 1.3.1 [async collection http_parser path stack_trace stream_channel]
- shelf_packages_handler 3.0.1 [path shelf shelf_static]
- shelf_static 1.1.1 [convert http_parser mime path shelf]
- shelf_web_socket 1.0.2 [shelf stream_channel web_socket_channel]
- source_gen 1.2.2 [analyzer async build dart_style glob meta path source_span yaml]
- source_map_stack_trace 2.1.0 [path stack_trace source_maps]
- source_maps 0.10.10 [source_span]
- source_span 1.9.0 [collection path term_glyph]
- stack_trace 1.10.0 [path]
- stream_channel 2.1.0 [async]
- stream_transform 2.0.0
- string_scanner 1.1.1 [source_span]
- sync_http 0.3.1
- term_glyph 1.2.1
- test_api 0.4.12 [async boolean_selector collection meta source_span stack_trace stream_channel string_scanner term_glyph matcher]
- test_core 0.4.16 [analyzer async args boolean_selector collection coverage frontend_server_client glob io meta package_config path pool source_map_stack_trace source_maps source_span stack_trace stream_channel vm_service yaml matcher test_api]
- timing 1.0.0 [json_annotation]
- typed_data 1.3.1 [collection]
- vm_service 8.3.0
- watcher 1.0.1 [async path]
- web_socket_channel 2.2.0 [async crypto stream_channel]
- webdriver 3.0.0 [archive matcher path stack_trace sync_http]
- webkit_inspection_protocol 1.1.0 [logging]
- yaml 3.1.1 [collection source_span string_scanner]

Anything else?

No response

Static methods tear-off on events is not working

I have commented the test so we could merge the PR into the master.
The test that tests a button click binded to a static method does not work:

@Component(
  selector: 'test',
  exports: [TestStaticMethods],
  template: r'<button (click)="TestStaticMethods.doCapture"></button>',
)
class TestStaticMethods {
  // ignore: prefer_function_declarations_over_variables
  static void Function() overrideDoCapture = () {};
  static void doCapture() {
    overrideDoCapture();
  }
}

the doCapture is never called and test end up in a timeout.

Dunno if this is used at all, so I am guessing we could live without it for now

[WARNING] ngdart on web/pdfjs/3.11.174/web/debugger.css: Errors parsing CSS

Which ng* package(s) are the source of the bug?

ngdart

Which operating system(s) does this bug appear on?

Windows

Which browser(s) does this bug appear on?

Chrome 117.0.5938.132 64 bits

Is this a regression?

No

Description

I am accepting these warnings when I run webdev build or "dart run build_runner build" I copied the lib pdfjs 3.11.174 in the web folder to be able to use it in my project and I saw that it is parsing CSS files, is there a way to ignore these warnings so that the angular don't parse them

Please provide the steps to reproduce the bug

Create a simple project with ngcli and unzip the pdfjs lib in the web folder

Please provide the exception or error you saw

PS C:\MyDartProjects\dart_bug_demo> dart run build_runner build
Building package executable...
Built build_runner:build_runner.
[INFO] Generating build script completed, took 462ms
[INFO] Precompiling build script... completed, took 8.4s
[INFO] Building new asset graph completed, took 1.7s
[INFO] Checking for unexpected pre-existing outputs. completed, took 1ms
[WARNING] ngdart on web/pdfjs/3.11.174/web/debugger.css:
Errors parsing CSS:
error on line 21, column 18: expected ), but found ,
   ╷
21 │ #PDFBug :is(input, button, select) {
   │                  ^
   ╵
error on line 21, column 34: expected {, but found )
   ╷
21 │ #PDFBug :is(input, button, select) {
   │                                  ^
   ╵
error on line 21, column 36: expected }, but found {
   ╷
21 │ #PDFBug :is(input, button, select) {
   │                                    ^
   ╵
error on line 22, column 20: expected {, but found ;
   ╷
22 │   font: message-box;
   │                    ^
   ╵
error on line 72, column 30: expected ), but found ,
   ╷
72 │ #PDFBug table.showText :is(tr, td) {
   │                              ^
   ╵
error on line 72, column 34: expected {, but found )
   ╷
72 │ #PDFBug table.showText :is(tr, td) {
   │                                  ^
   ╵
error on line 72, column 36: expected }, but found {
   ╷
72 │ #PDFBug table.showText :is(tr, td) {
   │                                    ^
   ╵
error on line 73, column 11: parsing error expected {
   ╷
73 │   border: 1px solid black;
   │           ^
   ╵
error on line 73, column 12: parsing error expected }
   ╷
73 │   border: 1px solid black;
   │            ^^
   ╵
error on line 73, column 26: expected {, but found ;
   ╷
73 │   border: 1px solid black;
   │                          ^
   ╵
[WARNING] ngdart on web/pdfjs/3.11.174/web/viewer.css:
Errors parsing CSS:
error on line 43, column 20: expected ), but found ,
   ╷
43 │ .textLayer :is(span, br) {
   │                    ^
   ╵
error on line 43, column 24: expected {, but found )
   ╷
43 │ .textLayer :is(span, br) {
   │                        ^
   ╵
error on line 43, column 26: expected }, but found {
   ╷
43 │ .textLayer :is(span, br) {
   │                          ^
   ╵
error on line 44, column 21: expected {, but found ;
   ╷
44 │   color: transparent;
   │                     ^
   ╵
error on line 138, column 51: expected ), but found ,
    ╷
138 │   .annotationLayer .textWidgetAnnotation :is(input, textarea):required,
    │                                                   ^
    ╵
error on line 138, column 61: expected {, but found )
    ╷
138 │   .annotationLayer .textWidgetAnnotation :is(input, textarea):required,
    │                                                             ^
    ╵
error on line 138, column 62: expected }, but found :
    ╷
138 │   .annotationLayer .textWidgetAnnotation :is(input, textarea):required,
    │                                                              ^
    ╵
error on line 141, column 32: expected ), but found .
    ╷
141 │     .buttonWidgetAnnotation:is(.checkBox, .radioButton)
    │                                ^
    ╵
error on line 141, column 55: expected {, but found )
    ╷
141 │     .buttonWidgetAnnotation:is(.checkBox, .radioButton)
    │                                                       ^
    ╵
error on line 218, column 22: expected ), but found .
    ╷
218 │ .annotationLayer :is(.linkAnnotation, .buttonWidgetAnnotation.pushButton) > a {
    │                      ^
    ╵
error on line 218, column 73: expected {, but found )
    ╷
218 │ .annotationLayer :is(.linkAnnotation, .buttonWidgetAnnotation.pushButton) > a {
    │                                                                         ^
    ╵
error on line 227, column 1: expected }, but found .
    ╷
227 │ .annotationLayer
    │ ^
    ╵
error on line 228, column 7: expected ), but found .
    ╷
228 │   :is(.linkAnnotation, .buttonWidgetAnnotation.pushButton):not(.hasBorder)
    │       ^
    ╵
error on line 228, column 58: expected {, but found )
    ╷
228 │   :is(.linkAnnotation, .buttonWidgetAnnotation.pushButton):not(.hasBorder)
    │                                                          ^
    ╵
error on line 252, column 1: expected }, but found .
    ╷
252 │ .annotationLayer .textWidgetAnnotation :is(input, textarea),
    │ ^
    ╵
error on line 252, column 49: expected ), but found ,
    ╷
252 │ .annotationLayer .textWidgetAnnotation :is(input, textarea),
    │                                                 ^
    ╵
error on line 252, column 59: expected {, but found )
    ╷
252 │ .annotationLayer .textWidgetAnnotation :is(input, textarea),
    │                                                           ^
    ╵
error on line 252, column 60: expected }, but found ,
    ╷
252 │ .annotationLayer .textWidgetAnnotation :is(input, textarea),
    │                                                            ^
    ╵
error on line 254, column 45: expected ), but found .
    ╷
254 │ .annotationLayer .buttonWidgetAnnotation:is(.checkBox, .radioButton) input {
    │                                             ^
    ╵
error on line 254, column 68: expected {, but found )
    ╷
254 │ .annotationLayer .buttonWidgetAnnotation:is(.checkBox, .radioButton) input {
    │                                                                    ^
    ╵
error on line 265, column 1: expected }, but found .
    ╷
265 │ .annotationLayer .textWidgetAnnotation :is(input, textarea):required,
    │ ^
    ╵
error on line 265, column 49: expected ), but found ,
    ╷
265 │ .annotationLayer .textWidgetAnnotation :is(input, textarea):required,
    │                                                 ^
    ╵
error on line 265, column 59: expected {, but found )
    ╷
265 │ .annotationLayer .textWidgetAnnotation :is(input, textarea):required,
    │                                                           ^
    ╵
error on line 265, column 60: expected }, but found :
    ╷
265 │ .annotationLayer .textWidgetAnnotation :is(input, textarea):required,
    │                                                            ^
    ╵
error on line 268, column 30: expected ), but found .
    ╷
268 │   .buttonWidgetAnnotation:is(.checkBox, .radioButton)
    │                              ^
    ╵
error on line 268, column 53: expected {, but found )
    ╷
268 │   .buttonWidgetAnnotation:is(.checkBox, .radioButton)
    │                                                     ^
    ╵
error on line 285, column 1: expected }, but found .
    ╷
285 │ .annotationLayer .textWidgetAnnotation :is(input, textarea)[disabled],
    │ ^
    ╵
error on line 285, column 49: expected ), but found ,
    ╷
285 │ .annotationLayer .textWidgetAnnotation :is(input, textarea)[disabled],
    │                                                 ^
    ╵
error on line 285, column 59: expected {, but found )
    ╷
285 │ .annotationLayer .textWidgetAnnotation :is(input, textarea)[disabled],
    │                                                           ^
    ╵
error on line 285, column 60: expected }, but found [
    ╷
285 │ .annotationLayer .textWidgetAnnotation :is(input, textarea)[disabled],
    │                                                            ^
    ╵
error on line 285, column 69: expected {, but found ]
    ╷
285 │ .annotationLayer .textWidgetAnnotation :is(input, textarea)[disabled],
    │                                                                     ^
    ╵
error on line 285, column 70: expected }, but found ,
    ╷
285 │ .annotationLayer .textWidgetAnnotation :is(input, textarea)[disabled],
    │                                                                      ^
    ╵
error on line 288, column 30: expected ), but found .
    ╷
288 │   .buttonWidgetAnnotation:is(.checkBox, .radioButton)
    │                              ^
    ╵
error on line 288, column 53: expected {, but found )
    ╷
288 │   .buttonWidgetAnnotation:is(.checkBox, .radioButton)
    │                                                     ^
    ╵
error on line 295, column 1: expected }, but found .
    ╷
295 │ .annotationLayer .textWidgetAnnotation :is(input, textarea):hover,
    │ ^
    ╵
error on line 295, column 49: expected ), but found ,
    ╷
295 │ .annotationLayer .textWidgetAnnotation :is(input, textarea):hover,
    │                                                 ^
    ╵
error on line 295, column 59: expected {, but found )
    ╷
295 │ .annotationLayer .textWidgetAnnotation :is(input, textarea):hover,
    │                                                           ^
    ╵
error on line 295, column 60: expected }, but found :
    ╷
295 │ .annotationLayer .textWidgetAnnotation :is(input, textarea):hover,
    │                                                            ^
    ╵
error on line 298, column 30: expected ), but found .
    ╷
298 │   .buttonWidgetAnnotation:is(.checkBox, .radioButton)
    │                              ^
    ╵
error on line 298, column 53: expected {, but found )
    ╷
298 │   .buttonWidgetAnnotation:is(.checkBox, .radioButton)
    │                                                     ^
    ╵
error on line 302, column 1: expected }, but found .
    ╷
302 │ .annotationLayer .textWidgetAnnotation :is(input, textarea):hover,
    │ ^
    ╵
error on line 302, column 49: expected ), but found ,
    ╷
302 │ .annotationLayer .textWidgetAnnotation :is(input, textarea):hover,
    │                                                 ^
    ╵
error on line 302, column 59: expected {, but found )
    ╷
302 │ .annotationLayer .textWidgetAnnotation :is(input, textarea):hover,
    │                                                           ^
    ╵
error on line 308, column 1: expected }, but found .
    ╷
308 │ .annotationLayer .textWidgetAnnotation :is(input, textarea):focus,
    │ ^
    ╵
error on line 308, column 49: expected ), but found ,
    ╷
308 │ .annotationLayer .textWidgetAnnotation :is(input, textarea):focus,
    │                                                 ^
    ╵
error on line 308, column 59: expected {, but found )
    ╷
308 │ .annotationLayer .textWidgetAnnotation :is(input, textarea):focus,
    │                                                           ^
    ╵
error on line 316, column 1: expected }, but found .
    ╷
316 │ .annotationLayer .buttonWidgetAnnotation:is(.checkBox, .radioButton) :focus {
    │ ^
    ╵
error on line 316, column 45: expected ), but found .
    ╷
316 │ .annotationLayer .buttonWidgetAnnotation:is(.checkBox, .radioButton) :focus {
    │                                             ^
    ╵
error on line 316, column 68: expected {, but found )
    ╷
316 │ .annotationLayer .buttonWidgetAnnotation:is(.checkBox, .radioButton) :focus {
    │                                                                    ^
    ╵
error on line 380, column 1: expected }, but found .
    ╷
380 │ .annotationLayer .buttonWidgetAnnotation:is(.checkBox, .radioButton) input {
    │ ^
    ╵
error on line 380, column 45: expected ), but found .
    ╷
380 │ .annotationLayer .buttonWidgetAnnotation:is(.checkBox, .radioButton) input {
    │                                             ^
    ╵
error on line 380, column 68: expected {, but found )
    ╷
380 │ .annotationLayer .buttonWidgetAnnotation:is(.checkBox, .radioButton) input {
    │                                                                    ^
    ╵
error on line 494, column 2: parsing error expected }
    ╷
494 │ @media screen and (forced-colors: active) {
    │  ^^^^^
    ╵
error on line 494, column 19: expected {, but found (
    ╷
494 │ @media screen and (forced-colors: active) {
    │                   ^
    ╵
error on line 494, column 41: expected }, but found )
    ╷
494 │ @media screen and (forced-colors: active) {
    │                                         ^
    ╵
error on line 494, column 43: expected } after ruleset for @media
    ╷
494 │ @media screen and (forced-colors: active) {
    │                                           ^
    ╵
error on line 494, column 43: premature end of file unknown CSS
    ╷
494 │ @media screen and (forced-colors: active) {
    │                                           ^
    ╵
[INFO] Generating SDK summary completed, took 4.3s
[INFO] Running build completed, took 32.9s
[INFO] Caching finalized dependency graph completed, took 367ms
[INFO] Succeeded after 33.3s with 2545 outputs (7290 actions)
PS C:\MyDartProjects\dart_bug_demo> 


### Please provide the dependency environment you discovered this bug in (run `dart pub deps -s compact`)

```true
PS C:\MyDartProjects\dart_bug_demo> dart pub deps -s compact   
Dart SDK 2.18.7
dart_bug_demo 0.0.0

dependencies:
- ngdart 7.1.1 [built_collection built_value collection intl js logging meta stack_trace stream_transform ngast ngcompiler build build_config code_builder csslib path quiver source_gen source_span]

dev dependencies:
- build_runner 2.3.3 [args async analyzer build build_config build_daemon build_resolvers build_runner_core code_builder collection crypto dart_style frontend_server_client glob graphs http_multi_server io js logging meta mime package_config path pool pub_semver pubspec_parse shelf shelf_web_socket stack_trace stream_transform timing watcher web_socket_channel yaml]
- build_web_compilers 3.2.6 [analyzer archive bazel_worker build build_config build_modules collection glob js logging path pool scratch_space source_maps source_span stack_trace]

transitive dependencies:
- _fe_analyzer_shared 47.0.0 [meta]
- analyzer 4.7.0 [_fe_analyzer_shared collection convert crypto glob meta package_config path pub_semver source_span watcher yaml]
- archive 3.4.2 [crypto path pointycastle]
- args 2.4.1
- async 2.11.0 [collection meta]
- bazel_worker 1.0.2 [async protobuf]
- boolean_selector 2.1.1 [source_span string_scanner]
- build 2.3.1 [analyzer async convert crypto glob logging meta path]
- build_config 1.1.1 [checked_yaml json_annotation path pubspec_parse yaml]
- build_daemon 3.1.1 [built_collection built_value http_multi_server logging path pool shelf shelf_web_socket stream_transform watcher web_socket_channel]
- build_modules 4.0.6 [analyzer async bazel_worker build build_config collection crypto glob graphs json_annotation logging path scratch_space stream_transform]
- build_resolvers 2.0.10 [analyzer async build crypto graphs logging path package_config pool pub_semver stream_transform yaml]
- build_runner_core 7.2.7 [async build build_config build_resolvers collection convert crypto glob graphs json_annotation logging meta path package_config pool timing watcher yaml]
- build_test 2.1.7 [async build build_config build_resolvers crypto glob html logging matcher package_config path stream_transform test test_core watcher]
- built_collection 5.1.1
- built_value 8.6.3 [built_collection collection fixnum meta]
- charcode 1.3.1
- checked_yaml 2.0.2 [json_annotation source_span yaml]
- clock 1.1.1
- code_builder 4.4.0 [built_collection built_value collection matcher meta]
- collection 1.18.0
- convert 3.1.1 [typed_data]
- coverage 1.6.3 [args logging package_config path source_maps stack_trace vm_service]
- crypto 3.0.2 [typed_data]
- csslib 0.17.2 [source_span]
- dart_style 2.2.4 [analyzer args path pub_semver source_span]
- file 6.1.4 [meta path]
- fixnum 1.0.1
- frontend_server_client 3.2.0 [async path]
- glob 2.1.1 [async collection file path string_scanner]
- graphs 2.3.1 [collection]
- html 0.15.3 [csslib source_span]
- http_multi_server 3.2.1 [async]
- http_parser 4.0.2 [collection source_span string_scanner typed_data]
- intl 0.17.0 [clock path]
- io 1.0.4 [meta path string_scanner]
- js 0.6.5 [meta]
- json_annotation 4.8.0 [meta]
- logging 1.1.1
- matcher 0.12.16 [async meta stack_trace term_glyph test_api]
- meta 1.10.0
- mime 1.0.4
- ngast 2.1.4 [charcode collection meta source_span string_scanner]
- ngcompiler 2.1.3 [ngdart ngast analyzer args build build_test code_builder collection csslib dart_style logging meta package_config path source_gen source_span stack_trace]
- node_preamble 2.0.2
- package_config 2.1.0 [path]
- path 1.8.3
- pointycastle 3.7.3 [collection convert js]
- pool 1.5.1 [async stack_trace]
- protobuf 2.1.0 [fixnum collection meta]
- pub_semver 2.1.4 [collection meta]
- pubspec_parse 1.2.3 [checked_yaml collection json_annotation pub_semver yaml]
- quiver 3.2.1 [matcher]
- scratch_space 1.0.1 [build crypto path pool]
- shelf 1.4.1 [async collection http_parser path stack_trace stream_channel]
- shelf_packages_handler 3.0.2 [path shelf shelf_static]
- shelf_static 1.1.2 [convert http_parser mime path shelf]
- shelf_web_socket 1.0.4 [shelf stream_channel web_socket_channel]
- source_gen 1.2.6 [analyzer async build dart_style glob meta path source_span yaml]
- source_map_stack_trace 2.1.1 [path source_maps stack_trace]
- source_maps 0.10.12 [source_span]
- source_span 1.10.0 [collection path term_glyph]
- stack_trace 1.11.1 [path]
- stream_channel 2.1.1 [async]
- stream_transform 2.1.0
- string_scanner 1.2.0 [source_span]
- term_glyph 1.2.1
- test 1.24.3 [analyzer async boolean_selector collection coverage http_multi_server io js node_preamble package_config path pool shelf shelf_packages_handler shelf_static shelf_web_socket source_span stack_trace stream_channel typed_data web_socket_channel webkit_inspection_protocol yaml test_api test_core matcher]
- test_api 0.6.0 [async boolean_selector collection meta source_span stack_trace stream_channel string_scanner term_glyph]
- test_core 0.5.3 [analyzer async args boolean_selector collection coverage frontend_server_client glob io meta package_config path pool source_map_stack_trace source_maps source_span stack_trace stream_channel vm_service yaml test_api]
- timing 1.0.1 [json_annotation]
- typed_data 1.3.2 [collection]
- vm_service 11.2.0
- watcher 1.0.2 [async path]
- web_socket_channel 2.4.0 [async crypto stream_channel]
- webkit_inspection_protocol 1.2.0 [logging]
- yaml 3.1.1 [collection source_span string_scanner]

Anything else?

No response

Angular compiler is eliminating CSS Container Queries from a component's CSS file

Which ng* package(s) are the source of the bug?

ngcompiler, ngdart

Which operating system(s) does this bug appear on?

Windows

Which browser(s) does this bug appear on?

Chrome 113.0.5672.93

Is this a regression?

No

Description

Angular compiler is eliminating CSS Container Queries from a component's CSS file, is there any way to prevent this?

Please provide the steps to reproduce the bug

create a new dart web project add ngdart: ^7.1.1 create a component and add a css file using annotation and put

.grid-layout {    
    gap: 1.25rem;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;   
    container-type: inline-size;  
}
/*col-sm ≥576px */
@container (min-width: 576px) {
    .grid-item {
        background: red;
        width: calc((100% / 2) - 1.0rem);
    }
}

/*md ≥768px*/
@container (min-width: 768px) {
    .grid-item {
        background: blue;
        width: calc((100% / 2) - 1.0rem);
    }
}

Please provide the exception or error you saw

[WARNING] ngdart on lib/src/shared/components/datatable/grid.css: Errors parsing CSS:
error on line 51, column 12: expected :, but found (
   ╷
51 │ @container (min-width: 576px) {
   │            ^
   ╵
error on line 51, column 24: premature end of file unknown CSS
   ╷
51 │ @container (min-width: 576px) {
   │                        ^^^

Please provide the dependency environment you discovered this bug in (run dart pub deps -s compact)

Dart SDK version: 2.18.3

environment:   
  sdk: '>=2.18.0 <3.0.0'

dependencies:   
  ngdart: ^7.1.1 
  ngforms: ^4.1.1
  ngrouter: ^3.1.1   

dev_dependencies:   
  sass_builder: ^2.1.2 
  build_runner: any
  build_test: any
  build_web_compilers: any
  pedantic: any
  test: any

Anything else?

No response

Operand of null-aware operation '?.' has type 'String' which excludes null, when passing a string to a native directive

Which ng* package(s) are the source of the bug?

ngcompiler, ngdart

Which operating system(s) does this bug appear on?

Windows

Which browser(s) does this bug appear on?

Chrome 113.0.5672.93

Is this a regression?

No

Description

Operand of null-aware operation '?.' has type 'String' which excludes null, when passing a string to a native directive

Please provide the steps to reproduce the bug

create a new project with AngularDart 7, create a component and place some html using some default directive like class, style passing some value as shown below.

<span class="d-none d-lg-inline-block mx-lg-2">
   <div>
    <div #divName>
             {{ $pipe.titleCase(authService.authPayload.nomCgm) }}
     </div>
     <div class="fs-xs" [style.width]="divName.offsetWidth.toString() + 'px'" style="text-overflow: ellipsis;background: none;border: none;overflow: hidden; white-space: nowrap;">
              {{ $pipe.titleCase(authService.authPayload.nomSetor) }}
          </div>
    </div>
</span>

Please provide the exception or error you saw

Warning: Operand of null-aware operation '?.' has type 'String' which excludes null.


webdev serve web:8005 --auto refresh
[WARNING] Throwing away cached asset graph because the build phases have changed. This most commonly would happen as a result of adding a new dependency or updating your dependencies.
[WARNING] Throwing away cached asset graph because the language version of some package(s) changed. This would most commonly happen when updating dependencies or changing your min sdk constraint.
[INFO] Cleaning up outputs from previous builds. completed, took 1.9s
[INFO] Building new asset graph completed, took 2.8s
[INFO] Checking for unexpected pre-existing outputs. completed, took 1ms
[INFO] Serving `web` on http://127.0.0.1:8005
[INFO] build_web_compilers:ddc on lib/new_sali_frontend.ddc.module:
packages/new_sali_frontend/src/modules/home/components/main_nav/main_nav.template.dart:157:46: Warning: Operand of null-aware operation '?.' has type 'String' which excludes null.
      this._el_20.style.setProperty('width', currVal_1?.toString()) /* REF:package:new_sali_frontend/src/modules/home/components/main_nav/main_nav.html:1561:1614 */;
                                             ^
[INFO] Running build completed, took 1m 7s
[INFO] Caching finalized dependency graph completed, took 592ms
[INFO] Succeeded after 1m 7s with 5265 outputs (13680 actions)
[INFO] ------------------------------------------------------------------------------------------------------------------------------------- 
[INFO] Updating asset graph completed, took 5ms
[INFO] build_web_compilers:ddc on lib/new_sali_frontend.ddc.module:
packages/new_sali_frontend/src/modules/home/components/main_nav/main_nav.template.dart:156:46: Warning: Operand of null-aware operation '?.' has type 'String' which excludes null.
      this._el_20.style.setProperty('width', currVal_1?.toString()) /* REF:package:new_sali_frontend/src/modules/home/components/main_nav/main_nav.html:1545:1598 */;
                                             ^
[INFO] Running build completed, took 9.5s
[INFO] Caching finalized dependency graph completed, took 512ms
[INFO] Succeeded after 10.0s with 52 outputs (49 actions)

Please provide the dependency environment you discovered this bug in (run dart pub deps -s compact)

environment:   
  sdk: '>=2.18.0 <3.0.0'

dependencies:   
  ngdart: ^7.1.1 
  ngforms: ^4.1.1
  ngrouter: ^3.1.1

Anything else?

No response

Bump analyzer to v5

Previously we just add deprecated_member_use: ignore to the analysis_options.yaml file in the monorepo root. Now analyzer has gone to v5 so the usage of deprecated APIs must be dealt with now.

The hardest parts are the last three, since they change the class returned or require another variable, so likely we'll have to work around them.

  • Replace getType with getClass for LibraryCompilationUnitElement and LibraryElement.
  • Replace name with getDisplayString for DartType. Note: need to think about whether nullability
  • Replace element with element2. Note that the return type changes from ClassElement to InterfaceElement, so it requires a bit more work. Most times we should be able to just cast it to ClassElement since ClassElement implements InterfaceElement.
  • Replace enclosingElement with enclosingElement3.
  • Somehow replace resolveToBound from DartType with TypeSystem's instance method resolveToBound.
  • Replace parts (CompilationUnitElement) with parts2 (PartsElement) from LibraryElement.
  • Replace import (ImportElement) with imports2 (LibraryInputElement) from LibraryElement.

NgTestBed can't infer type of createXXFactory()

Consider the following code (from _tests/test/common/directives/for_test.dart):

// for_test.dart
void main() {
  group('ngFor', () {
    tearDown(() => disposeAnyRunningTest());

    test('should reflect initial elements', () async {
      var testBed = NgTestBed(ng.createNgForItemsTestFactory());
      var testFixture = await testBed.create();
      expect(testFixture.rootElement, hasTextContent('1;2;3;'));
    });
  );
}

@Component(
  selector: 'ngfor-items-test',
  template: '<div><copy-me *ngFor="let item of items">'
      '{{item.toString()}};</copy-me></div>',
  directives: [
    CopyMe,
    NgFor,
  ],
)
class NgForItemsTest extends BaseTestComponent {
  @ContentChild(TemplateRef)
  TemplateRef? contentTpl;
}

An analysis error is thrown on NgTestBed: Couldn't infer type parameter 'T'. However, when checking the generate template code, the function createNgForItemsTestFactory() clearly returns a type that is not dynamic:

ComponentFactory<import1.NgForItemsTest> createNgForItemsTestFactory() {
  return ComponentFactory('ngfor-items-test', viewFactory_NgForItemsTestHost0);
}

where import1 is imported as import 'for_test.dart' as import1;

This is not a huge problem as the developer merely needs to change NgTestBed into NgTestBed<NgForItems>, but this can be very counter-productive for those working on old code (like us), which stops them from performing analysis on the packages (25b75dd).

Dart SDK: 2.17.0
AngularDart: 7.1.0
OS: agnostic
Browser: n/a

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.