Skip to content
This repository was archived by the owner on Sep 16, 2022. It is now read-only.

Commit 6665eeb

Browse files
committed
fix(Compiler): Tighten/correct types emitted by the outliner.
* `ComponentFactory<dynamic>` -> `ComponentFactory<Component>` * `num` -> `int` * `const styles` -> `external List get styles` (what the view compiler does) ... also delete some more trailing/unused template files. Oops! PiperOrigin-RevId: 200607126
1 parent bff5029 commit 6665eeb

37 files changed

+336
-1869
lines changed

_goldens/test/_files/change_detection.outline.golden

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -15,53 +15,53 @@ import 'change_detection.dart' as _user;
1515
import 'package:angular/angular.dart';
1616

1717
// For @Component class CheckOnceComponent.
18-
const List<dynamic> styles$CheckOnceComponent = const [];
19-
external ComponentFactory get CheckOnceComponentNgFactory;
20-
external AppView<_user.CheckOnceComponent> viewFactory_CheckOnceComponent0(AppView<dynamic> parentView, num parentIndex);
18+
external List<dynamic> get styles$CheckOnceComponent;
19+
external ComponentFactory<_user.CheckOnceComponent> get CheckOnceComponentNgFactory;
20+
external AppView<_user.CheckOnceComponent> viewFactory_CheckOnceComponent0(AppView<dynamic> parentView, int parentIndex);
2121
class ViewCheckOnceComponent0 extends AppView<_user.CheckOnceComponent> {
22-
external ViewCheckOnceComponent0(AppView<dynamic> parentView, num parentIndex);
22+
external ViewCheckOnceComponent0(AppView<dynamic> parentView, int parentIndex);
2323
}
2424
// For @Component class CheckedComponent.
25-
const List<dynamic> styles$CheckedComponent = const [];
26-
external ComponentFactory get CheckedComponentNgFactory;
27-
external AppView<_user.CheckedComponent> viewFactory_CheckedComponent0(AppView<dynamic> parentView, num parentIndex);
25+
external List<dynamic> get styles$CheckedComponent;
26+
external ComponentFactory<_user.CheckedComponent> get CheckedComponentNgFactory;
27+
external AppView<_user.CheckedComponent> viewFactory_CheckedComponent0(AppView<dynamic> parentView, int parentIndex);
2828
class ViewCheckedComponent0 extends AppView<_user.CheckedComponent> {
29-
external ViewCheckedComponent0(AppView<dynamic> parentView, num parentIndex);
29+
external ViewCheckedComponent0(AppView<dynamic> parentView, int parentIndex);
3030
}
3131
// For @Component class CheckAlwaysComponent.
32-
const List<dynamic> styles$CheckAlwaysComponent = const [];
33-
external ComponentFactory get CheckAlwaysComponentNgFactory;
34-
external AppView<_user.CheckAlwaysComponent> viewFactory_CheckAlwaysComponent0(AppView<dynamic> parentView, num parentIndex);
32+
external List<dynamic> get styles$CheckAlwaysComponent;
33+
external ComponentFactory<_user.CheckAlwaysComponent> get CheckAlwaysComponentNgFactory;
34+
external AppView<_user.CheckAlwaysComponent> viewFactory_CheckAlwaysComponent0(AppView<dynamic> parentView, int parentIndex);
3535
class ViewCheckAlwaysComponent0 extends AppView<_user.CheckAlwaysComponent> {
36-
external ViewCheckAlwaysComponent0(AppView<dynamic> parentView, num parentIndex);
36+
external ViewCheckAlwaysComponent0(AppView<dynamic> parentView, int parentIndex);
3737
}
3838
// For @Component class DetachedComponent.
39-
const List<dynamic> styles$DetachedComponent = const [];
40-
external ComponentFactory get DetachedComponentNgFactory;
41-
external AppView<_user.DetachedComponent> viewFactory_DetachedComponent0(AppView<dynamic> parentView, num parentIndex);
39+
external List<dynamic> get styles$DetachedComponent;
40+
external ComponentFactory<_user.DetachedComponent> get DetachedComponentNgFactory;
41+
external AppView<_user.DetachedComponent> viewFactory_DetachedComponent0(AppView<dynamic> parentView, int parentIndex);
4242
class ViewDetachedComponent0 extends AppView<_user.DetachedComponent> {
43-
external ViewDetachedComponent0(AppView<dynamic> parentView, num parentIndex);
43+
external ViewDetachedComponent0(AppView<dynamic> parentView, int parentIndex);
4444
}
4545
// For @Component class OnPushComponent.
46-
const List<dynamic> styles$OnPushComponent = const [];
47-
external ComponentFactory get OnPushComponentNgFactory;
48-
external AppView<_user.OnPushComponent> viewFactory_OnPushComponent0(AppView<dynamic> parentView, num parentIndex);
46+
external List<dynamic> get styles$OnPushComponent;
47+
external ComponentFactory<_user.OnPushComponent> get OnPushComponentNgFactory;
48+
external AppView<_user.OnPushComponent> viewFactory_OnPushComponent0(AppView<dynamic> parentView, int parentIndex);
4949
class ViewOnPushComponent0 extends AppView<_user.OnPushComponent> {
50-
external ViewOnPushComponent0(AppView<dynamic> parentView, num parentIndex);
50+
external ViewOnPushComponent0(AppView<dynamic> parentView, int parentIndex);
5151
}
5252
// For @Component class StatefulComponent.
53-
const List<dynamic> styles$StatefulComponent = const [];
54-
external ComponentFactory get StatefulComponentNgFactory;
55-
external AppView<_user.StatefulComponent> viewFactory_StatefulComponent0(AppView<dynamic> parentView, num parentIndex);
53+
external List<dynamic> get styles$StatefulComponent;
54+
external ComponentFactory<_user.StatefulComponent> get StatefulComponentNgFactory;
55+
external AppView<_user.StatefulComponent> viewFactory_StatefulComponent0(AppView<dynamic> parentView, int parentIndex);
5656
class ViewStatefulComponent0 extends AppView<_user.StatefulComponent> {
57-
external ViewStatefulComponent0(AppView<dynamic> parentView, num parentIndex);
57+
external ViewStatefulComponent0(AppView<dynamic> parentView, int parentIndex);
5858
}
5959
// For @Component class DefaultComponent.
60-
const List<dynamic> styles$DefaultComponent = const [];
61-
external ComponentFactory get DefaultComponentNgFactory;
62-
external AppView<_user.DefaultComponent> viewFactory_DefaultComponent0(AppView<dynamic> parentView, num parentIndex);
60+
external List<dynamic> get styles$DefaultComponent;
61+
external ComponentFactory<_user.DefaultComponent> get DefaultComponentNgFactory;
62+
external AppView<_user.DefaultComponent> viewFactory_DefaultComponent0(AppView<dynamic> parentView, int parentIndex);
6363
class ViewDefaultComponent0 extends AppView<_user.DefaultComponent> {
64-
external ViewDefaultComponent0(AppView<dynamic> parentView, num parentIndex);
64+
external ViewDefaultComponent0(AppView<dynamic> parentView, int parentIndex);
6565
}
6666

6767
external void initReflector();

_goldens/test/_files/component_loader_pattern.outline.golden

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ import 'package:angular/security.template.dart' deferred as security_lib;
1818
import 'example_of_file_that_is_not_generated_yet.template.dart' as example_lib;
1919

2020
// For @Component class TestComponent.
21-
const List<dynamic> styles$TestComponent = const [];
22-
external ComponentFactory get TestComponentNgFactory;
23-
external AppView<_user.TestComponent> viewFactory_TestComponent0(AppView<dynamic> parentView, num parentIndex);
21+
external List<dynamic> get styles$TestComponent;
22+
external ComponentFactory<_user.TestComponent> get TestComponentNgFactory;
23+
external AppView<_user.TestComponent> viewFactory_TestComponent0(AppView<dynamic> parentView, int parentIndex);
2424
class ViewTestComponent0 extends AppView<_user.TestComponent> {
25-
external ViewTestComponent0(AppView<dynamic> parentView, num parentIndex);
25+
external ViewTestComponent0(AppView<dynamic> parentView, int parentIndex);
2626
}
2727

2828
external void initReflector();

_goldens/test/_files/core_directives.outline.golden

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ import 'core_directives.dart' as _user;
1515
import 'package:angular/angular.dart';
1616

1717
// For @Component class TestFooComponent.
18-
const List<dynamic> styles$TestFooComponent = const [];
19-
external ComponentFactory get TestFooComponentNgFactory;
20-
external AppView<_user.TestFooComponent> viewFactory_TestFooComponent0(AppView<dynamic> parentView, num parentIndex);
18+
external List<dynamic> get styles$TestFooComponent;
19+
external ComponentFactory<_user.TestFooComponent> get TestFooComponentNgFactory;
20+
external AppView<_user.TestFooComponent> viewFactory_TestFooComponent0(AppView<dynamic> parentView, int parentIndex);
2121
class ViewTestFooComponent0 extends AppView<_user.TestFooComponent> {
22-
external ViewTestFooComponent0(AppView<dynamic> parentView, num parentIndex);
22+
external ViewTestFooComponent0(AppView<dynamic> parentView, int parentIndex);
2323
}
2424

2525
external void initReflector();

_goldens/test/_files/dart2js/dart2js_golden.template_debug.golden

Lines changed: 0 additions & 10 deletions
This file was deleted.

_goldens/test/_files/deferred/container_component.outline.golden

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ import 'package:_goldens/component.dart';
1717
import 'deferred_component.dart';
1818

1919
// For @Component class TestContainerComponent.
20-
const List<dynamic> styles$TestContainerComponent = const [];
21-
external ComponentFactory get TestContainerComponentNgFactory;
22-
external AppView<_user.TestContainerComponent> viewFactory_TestContainerComponent0(AppView<dynamic> parentView, num parentIndex);
20+
external List<dynamic> get styles$TestContainerComponent;
21+
external ComponentFactory<_user.TestContainerComponent> get TestContainerComponentNgFactory;
22+
external AppView<_user.TestContainerComponent> viewFactory_TestContainerComponent0(AppView<dynamic> parentView, int parentIndex);
2323
class ViewTestContainerComponent0 extends AppView<_user.TestContainerComponent> {
24-
external ViewTestContainerComponent0(AppView<dynamic> parentView, num parentIndex);
24+
external ViewTestContainerComponent0(AppView<dynamic> parentView, int parentIndex);
2525
}
2626

2727
external void initReflector();

_goldens/test/_files/deferred/deferred_component.outline.golden

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ import 'deferred_component.dart' as _user;
1515
import 'package:angular/angular.dart';
1616

1717
// For @Component class DeferredChildComponent.
18-
const List<dynamic> styles$DeferredChildComponent = const [];
19-
external ComponentFactory get DeferredChildComponentNgFactory;
20-
external AppView<_user.DeferredChildComponent> viewFactory_DeferredChildComponent0(AppView<dynamic> parentView, num parentIndex);
18+
external List<dynamic> get styles$DeferredChildComponent;
19+
external ComponentFactory<_user.DeferredChildComponent> get DeferredChildComponentNgFactory;
20+
external AppView<_user.DeferredChildComponent> viewFactory_DeferredChildComponent0(AppView<dynamic> parentView, int parentIndex);
2121
class ViewDeferredChildComponent0 extends AppView<_user.DeferredChildComponent> {
22-
external ViewDeferredChildComponent0(AppView<dynamic> parentView, num parentIndex);
22+
external ViewDeferredChildComponent0(AppView<dynamic> parentView, int parentIndex);
2323
}
2424

2525
external void initReflector();

_goldens/test/_files/directives/base_component.outline.golden

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ import 'components.dart';
1717
import 'directives.dart' as directive;
1818

1919
// For @Component class TestFooComponent.
20-
const List<dynamic> styles$TestFooComponent = const [];
21-
external ComponentFactory get TestFooComponentNgFactory;
22-
external AppView<_user.TestFooComponent> viewFactory_TestFooComponent0(AppView<dynamic> parentView, num parentIndex);
20+
external List<dynamic> get styles$TestFooComponent;
21+
external ComponentFactory<_user.TestFooComponent> get TestFooComponentNgFactory;
22+
external AppView<_user.TestFooComponent> viewFactory_TestFooComponent0(AppView<dynamic> parentView, int parentIndex);
2323
class ViewTestFooComponent0 extends AppView<_user.TestFooComponent> {
24-
external ViewTestFooComponent0(AppView<dynamic> parentView, num parentIndex);
24+
external ViewTestFooComponent0(AppView<dynamic> parentView, int parentIndex);
2525
}
2626

2727
external void initReflector();

_goldens/test/_files/directives/components.outline.golden

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ import 'components.dart' as _user;
1515
import 'package:angular/angular.dart';
1616

1717
// For @Component class TestSubComponent.
18-
const List<dynamic> styles$TestSubComponent = const [];
19-
external ComponentFactory get TestSubComponentNgFactory;
20-
external AppView<_user.TestSubComponent> viewFactory_TestSubComponent0(AppView<dynamic> parentView, num parentIndex);
18+
external List<dynamic> get styles$TestSubComponent;
19+
external ComponentFactory<_user.TestSubComponent> get TestSubComponentNgFactory;
20+
external AppView<_user.TestSubComponent> viewFactory_TestSubComponent0(AppView<dynamic> parentView, int parentIndex);
2121
class ViewTestSubComponent0 extends AppView<_user.TestSubComponent> {
22-
external ViewTestSubComponent0(AppView<dynamic> parentView, num parentIndex);
22+
external ViewTestSubComponent0(AppView<dynamic> parentView, int parentIndex);
2323
}
2424

2525
external void initReflector();

_goldens/test/_files/directives/directive_wrapper.outline.golden

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,18 @@ import 'dart:html';
1717
import 'package:angular/angular.dart';
1818

1919
// For @Component class TestFooComponent.
20-
const List<dynamic> styles$TestFooComponent = const [];
21-
external ComponentFactory get TestFooComponentNgFactory;
22-
external AppView<_user.TestFooComponent> viewFactory_TestFooComponent0(AppView<dynamic> parentView, num parentIndex);
20+
external List<dynamic> get styles$TestFooComponent;
21+
external ComponentFactory<_user.TestFooComponent> get TestFooComponentNgFactory;
22+
external AppView<_user.TestFooComponent> viewFactory_TestFooComponent0(AppView<dynamic> parentView, int parentIndex);
2323
class ViewTestFooComponent0 extends AppView<_user.TestFooComponent> {
24-
external ViewTestFooComponent0(AppView<dynamic> parentView, num parentIndex);
24+
external ViewTestFooComponent0(AppView<dynamic> parentView, int parentIndex);
2525
}
2626
// For @Component class DirectiveContainerTest.
27-
const List<dynamic> styles$DirectiveContainerTest = const [];
28-
external ComponentFactory get DirectiveContainerTestNgFactory;
29-
external AppView<_user.DirectiveContainerTest> viewFactory_DirectiveContainerTest0(AppView<dynamic> parentView, num parentIndex);
27+
external List<dynamic> get styles$DirectiveContainerTest;
28+
external ComponentFactory<_user.DirectiveContainerTest> get DirectiveContainerTestNgFactory;
29+
external AppView<_user.DirectiveContainerTest> viewFactory_DirectiveContainerTest0(AppView<dynamic> parentView, int parentIndex);
3030
class ViewDirectiveContainerTest0 extends AppView<_user.DirectiveContainerTest> {
31-
external ViewDirectiveContainerTest0(AppView<dynamic> parentView, num parentIndex);
31+
external ViewDirectiveContainerTest0(AppView<dynamic> parentView, int parentIndex);
3232
}
3333
// For @Directive class ChildDirective.
3434
class ChildDirectiveNgCd extends DirectiveChangeDetector {

_goldens/test/_files/directives/functional_directives.outline.golden

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ import 'dart:html';
1616
import 'package:angular/angular.dart';
1717

1818
// For @Component class AppComponent.
19-
const List<dynamic> styles$AppComponent = const [];
20-
external ComponentFactory get AppComponentNgFactory;
21-
external AppView<_user.AppComponent> viewFactory_AppComponent0(AppView<dynamic> parentView, num parentIndex);
19+
external List<dynamic> get styles$AppComponent;
20+
external ComponentFactory<_user.AppComponent> get AppComponentNgFactory;
21+
external AppView<_user.AppComponent> viewFactory_AppComponent0(AppView<dynamic> parentView, int parentIndex);
2222
class ViewAppComponent0 extends AppView<_user.AppComponent> {
23-
external ViewAppComponent0(AppView<dynamic> parentView, num parentIndex);
23+
external ViewAppComponent0(AppView<dynamic> parentView, int parentIndex);
2424
}
2525

2626
external void initReflector();

0 commit comments

Comments
 (0)