Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(ngdart)!: rename and remove deprecated fields from ChangeDetectionStrategy #41

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ void main() {
@Component(
selector: 'test',
template: '',
changeDetection: ChangeDetectionStrategy.OnPush,
changeDetection: ChangeDetectionStrategy.onPush,
)
class OnPushComponent {}
""");
Expand Down
16 changes: 8 additions & 8 deletions _tests/test/compiler_integration/on_push_validation_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ void main() {
<default></default>
</div>
''',
changeDetection: ChangeDetectionStrategy.OnPush,
changeDetection: ChangeDetectionStrategy.onPush,
directives: [DefaultComponent],
)
class TestComponent {}
""", warnings: [
allOf([
contains('<default>'),
contains(
'"DefaultComponent" doesn\'t use "ChangeDetectionStrategy.OnPush"',
'"DefaultComponent" doesn\'t use "ChangeDetectionStrategy.onPush"',
),
]),
]);
Expand All @@ -56,7 +56,7 @@ void main() {
<default @skipOnPushValidation></default>
</div>
''',
changeDetection: ChangeDetectionStrategy.OnPush,
changeDetection: ChangeDetectionStrategy.onPush,
directives: [DefaultComponent],
)
class TestComponent {}
Expand All @@ -73,7 +73,7 @@ void main() {
template: '''
<div @skipOnPushValidation></div>
''',
changeDetection: ChangeDetectionStrategy.OnPush,
changeDetection: ChangeDetectionStrategy.onPush,
)
class TestComponent {}
""", errors: [
Expand All @@ -91,7 +91,7 @@ void main() {
@Component(
selector: 'on-push',
template: '',
changeDetection: ChangeDetectionStrategy.OnPush,
changeDetection: ChangeDetectionStrategy.onPush,
)
class OnPushComponent {}
Expand All @@ -101,15 +101,15 @@ void main() {
<on-push @skipOnPushValidation></on-push>
''',
directives: [OnPushComponent],
changeDetection: ChangeDetectionStrategy.OnPush,
changeDetection: ChangeDetectionStrategy.onPush,
)
class TestComponent {}
""", errors: [
allOf([
contains('@skipOnPushValidation'),
contains(
'Can only be applied to a component using '
'"ChangeDetectionStrategy.Default"',
'"ChangeDetectionStrategy.checkAlways"',
),
]),
]);
Expand Down Expand Up @@ -138,7 +138,7 @@ void main() {
contains('@skipOnPushValidation'),
contains(
'Can only be used in the template of a component using '
'"ChangeDetectionStrategy.OnPush"',
'"ChangeDetectionStrategy.onPush"',
),
]),
]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ class DefaultComponent {
@Component(
selector: 'on-push-container',
template: '<template #container></template>',
changeDetection: ChangeDetectionStrategy.OnPush,
changeDetection: ChangeDetectionStrategy.onPush,
)
class OnPushContainerComponent {
@Input()
Expand Down Expand Up @@ -142,7 +142,7 @@ class LoadInOnPush {
</on-push-container>
''',
directives: [OnPushContainerComponent],
changeDetection: ChangeDetectionStrategy.OnPush,
changeDetection: ChangeDetectionStrategy.onPush,
)
class OnPushAncestorComponent {
@Input()
Expand Down Expand Up @@ -170,7 +170,7 @@ class LoadInOnPushDescendant {
</ng-container>
''',
directives: [NgIf],
changeDetection: ChangeDetectionStrategy.OnPush,
changeDetection: ChangeDetectionStrategy.onPush,
)
class OnPushEmbeddedContainerComponent {
OnPushEmbeddedContainerComponent(this._changeDetectorRef, this._ngZone);
Expand Down
235 changes: 0 additions & 235 deletions _tests/test/core/change_detection/detached_lifecycle_test.dart

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ void main() {
@Component(
selector: 'child',
template: '{{value}}',
changeDetection: ChangeDetectionStrategy.OnPush,
changeDetection: ChangeDetectionStrategy.onPush,
)
class Child {
var value = '';
Expand Down Expand Up @@ -245,7 +245,7 @@ abstract class HasValue {
providers: [
ExistingProvider(HasValue, ChildWithExistingProvider),
],
changeDetection: ChangeDetectionStrategy.OnPush,
changeDetection: ChangeDetectionStrategy.onPush,
)
class ChildWithExistingProvider implements HasValue {
@override
Expand Down
2 changes: 1 addition & 1 deletion _tests/test/core/change_detection/mark_for_check_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class UsesOnPushComponent {
directives: [
NgIf,
],
changeDetection: ChangeDetectionStrategy.OnPush,
changeDetection: ChangeDetectionStrategy.onPush,
)
class OnPushComponent {
final ChangeDetectorRef _changeDetector;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ class TestComponent {
template: '''
<template #template>{{templateText}}</template>
''',
changeDetection: ChangeDetectionStrategy.OnPush,
changeDetection: ChangeDetectionStrategy.onPush,
exportAs: 'templateProducer',
)
class TemplateProducerComponent implements OnInit {
Expand All @@ -149,7 +149,7 @@ class TemplateProducerComponent implements OnInit {
<template #container></template>
<div>{{text}}</div>
''',
changeDetection: ChangeDetectionStrategy.OnPush,
changeDetection: ChangeDetectionStrategy.onPush,
)
class TemplateConsumerComponent implements OnInit {
@ViewChild('container', read: ViewContainerRef)
Expand Down
2 changes: 1 addition & 1 deletion _tests/test/core/linker/component_loader_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ class DynamicComp extends Lifecycles {
@Component(
selector: 'dynamic-comp',
template: 'Dynamic{{input}}',
changeDetection: ChangeDetectionStrategy.OnPush,
changeDetection: ChangeDetectionStrategy.onPush,
)
class DynamicOnPushComp extends Lifecycles {
DynamicOnPushComp(super.log);
Expand Down
Loading